Z
zhangdl
Unregistered / Unconfirmed
GUEST, unregistred user!
从共享社区下载"通用商务管理"代友中,有控件
我在安装PagecOntrol98控件时d6中,设计和运行包分开后,出现以下错误
[Error] Tabcontrolreg.pas(36): Undeclared identifier: 'Form'
[Error] Tabcontrolreg.pas(38): Undeclared identifier: 'Form'
[Error] Tabcontrolreg.pas(49): Undeclared identifier: 'IFormDesigner'
[Error] Tabcontrolreg.pas(59): ')' expected but identifier 'Form' found
[Error] Tabcontrolreg.pas(60): 'END' expected but 'TRY' found
[Error] Tabcontrolreg.pas(67): '.' expected but ';' found
[Warning] Tabcontrolreg.pas(71): Text after final 'END.' - ignored by compiler
[Error] Tabcontrolreg.pas(18): Unsatisfied forward or external declaration: 'TPageControl98Editor.GetVerb'
[Error] Tabcontrolreg.pas(19): Unsatisfied forward or external declaration: 'TPageControl98Editor.GetVerbCount'
[Error] Tabcontrolreg.pas(22): Unsatisfied forward or external declaration: 'Register'
以下是属性编缉器代码
unit Tabcontrolreg;
interface
uses DesignIntf,DesignEditors,Classes;
type
// TActivePage98Property
TActivePage98Property = class(TComponentProperty)
public
function GetAttributes: TPropertyAttributes; override;
procedure GetValues(Proc: TGetStrProc); override;
end;
{ TPageControl98Editor }
type
TPageControl98Editor = class(TDefaultEditor)
procedure ExecuteVerb(Index: Integer); override;
function GetVerb(Index: Integer): Ansistring; override;
function GetVerbCount: Integer; override;
end;
procedure Register;
implementation
uses TabControl98,PageControl98,CommCtrlEx,ComCtl98;
function TActivePage98Property.GetAttributes: TPropertyAttributes;
begin
Result := [paValueList];
end;
procedure TActivePage98Property.GetValues(Proc: TGetStrProc);
var
I: Integer;
Component: TComponent;
begin
//Designer.
for I := 0 to Designer.Form.ComponentCount - 1 do
begin
Component := Designer.Form.Components;
if (Component.Name <> '') and (Component is TTabSheet98) and
(TTabSheet98(Component).PageControl = GetComponent(0)) then
Proc(Component.Name);
end;
end;
procedure TPageControl98Editor.ExecuteVerb(Index: Integer);
var
PageControl: TCustomPageControl98;
Page: TTabSheet98;
Designer: IFormDesigner;
begin
if Component is TTabSheet98 then
PageControl := TTabSheet98(Component).PageControl else
PageControl := TPageControl98(Component);
if PageControl <> nil then
begin
Designer := Self.Designer;
if Index = 0 then
begin
Page := TTabSheet98.Create(Designer.Form);
try
Page.Name := Designer.UniqueName(TTabSheet98.ClassName);
Page.Parent := PageControl;
Page.PageControl := PageControl;
except
Page.Free;
raise;
end;
PageControl.ActivePage := Page;
Designer.SelectComponent(Page);
Designer.Modified;
end else
begin
Page := PageControl.FindNextPage(PageControl.ActivePage,
Index = 1, False);
if (Page <> nil) and (Page <> PageControl.ActivePage) then
begin
PageControl.ActivePage := Page;
if Component is TTabSheet98 then Designer.SelectComponent(Page);
Designer.Modified;
end;
end;
end;
end;
function TPageControl98Editor.GetVerb(Index: Integer): AnsiString;
begin
case Index of
0 : Result:= StrAddPage;
1 : Result:= StrNextPage;
2 : Result:= StrPrevPage;
end;
end;
function TPageControl98Editor.GetVerbCount: Integer;
begin
Result := 3;
end;
procedure Register;
begin
RegisterComponents('Travail', [TPageControl98]);
RegisterClasses([TTabSheet98]);
RegisterComponentEditor(TPageControl98, TPageControl98Editor);
RegisterComponentEditor(TTabSheet98, TPageControl98Editor);
RegisterPropertyEditor(TypeInfo(TTabSheet98), TPageControl98, 'ActivePage', TActivePage98Property);
end;
end.
我在安装PagecOntrol98控件时d6中,设计和运行包分开后,出现以下错误
[Error] Tabcontrolreg.pas(36): Undeclared identifier: 'Form'
[Error] Tabcontrolreg.pas(38): Undeclared identifier: 'Form'
[Error] Tabcontrolreg.pas(49): Undeclared identifier: 'IFormDesigner'
[Error] Tabcontrolreg.pas(59): ')' expected but identifier 'Form' found
[Error] Tabcontrolreg.pas(60): 'END' expected but 'TRY' found
[Error] Tabcontrolreg.pas(67): '.' expected but ';' found
[Warning] Tabcontrolreg.pas(71): Text after final 'END.' - ignored by compiler
[Error] Tabcontrolreg.pas(18): Unsatisfied forward or external declaration: 'TPageControl98Editor.GetVerb'
[Error] Tabcontrolreg.pas(19): Unsatisfied forward or external declaration: 'TPageControl98Editor.GetVerbCount'
[Error] Tabcontrolreg.pas(22): Unsatisfied forward or external declaration: 'Register'
以下是属性编缉器代码
unit Tabcontrolreg;
interface
uses DesignIntf,DesignEditors,Classes;
type
// TActivePage98Property
TActivePage98Property = class(TComponentProperty)
public
function GetAttributes: TPropertyAttributes; override;
procedure GetValues(Proc: TGetStrProc); override;
end;
{ TPageControl98Editor }
type
TPageControl98Editor = class(TDefaultEditor)
procedure ExecuteVerb(Index: Integer); override;
function GetVerb(Index: Integer): Ansistring; override;
function GetVerbCount: Integer; override;
end;
procedure Register;
implementation
uses TabControl98,PageControl98,CommCtrlEx,ComCtl98;
function TActivePage98Property.GetAttributes: TPropertyAttributes;
begin
Result := [paValueList];
end;
procedure TActivePage98Property.GetValues(Proc: TGetStrProc);
var
I: Integer;
Component: TComponent;
begin
//Designer.
for I := 0 to Designer.Form.ComponentCount - 1 do
begin
Component := Designer.Form.Components;
if (Component.Name <> '') and (Component is TTabSheet98) and
(TTabSheet98(Component).PageControl = GetComponent(0)) then
Proc(Component.Name);
end;
end;
procedure TPageControl98Editor.ExecuteVerb(Index: Integer);
var
PageControl: TCustomPageControl98;
Page: TTabSheet98;
Designer: IFormDesigner;
begin
if Component is TTabSheet98 then
PageControl := TTabSheet98(Component).PageControl else
PageControl := TPageControl98(Component);
if PageControl <> nil then
begin
Designer := Self.Designer;
if Index = 0 then
begin
Page := TTabSheet98.Create(Designer.Form);
try
Page.Name := Designer.UniqueName(TTabSheet98.ClassName);
Page.Parent := PageControl;
Page.PageControl := PageControl;
except
Page.Free;
raise;
end;
PageControl.ActivePage := Page;
Designer.SelectComponent(Page);
Designer.Modified;
end else
begin
Page := PageControl.FindNextPage(PageControl.ActivePage,
Index = 1, False);
if (Page <> nil) and (Page <> PageControl.ActivePage) then
begin
PageControl.ActivePage := Page;
if Component is TTabSheet98 then Designer.SelectComponent(Page);
Designer.Modified;
end;
end;
end;
end;
function TPageControl98Editor.GetVerb(Index: Integer): AnsiString;
begin
case Index of
0 : Result:= StrAddPage;
1 : Result:= StrNextPage;
2 : Result:= StrPrevPage;
end;
end;
function TPageControl98Editor.GetVerbCount: Integer;
begin
Result := 3;
end;
procedure Register;
begin
RegisterComponents('Travail', [TPageControl98]);
RegisterClasses([TTabSheet98]);
RegisterComponentEditor(TPageControl98, TPageControl98Editor);
RegisterComponentEditor(TTabSheet98, TPageControl98Editor);
RegisterPropertyEditor(TypeInfo(TTabSheet98), TPageControl98, 'ActivePage', TActivePage98Property);
end;
end.