mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-30 11:02:56 +02:00
nonlcldesigner: register MyForm
git-svn-id: trunk@22634 -
This commit is contained in:
parent
9e8c913c8c
commit
415c71e3ac
@ -36,7 +36,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
LCLProc, LCLType, Classes, SysUtils, FormEditingIntf, LCLIntf, Graphics,
|
LCLProc, LCLType, Classes, SysUtils, FormEditingIntf, LCLIntf, Graphics,
|
||||||
MyWidgetSet;
|
ProjectIntf, MyWidgetSet;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -66,6 +66,17 @@ type
|
|||||||
property MyForm: TMyForm read FMyForm;
|
property MyForm: TMyForm read FMyForm;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TFileDescPascalUnitWithMyForm }
|
||||||
|
|
||||||
|
TFileDescPascalUnitWithMyForm = class(TFileDescPascalUnitWithResource)
|
||||||
|
public
|
||||||
|
constructor Create; override;
|
||||||
|
function GetInterfaceUsesSection: string; override;
|
||||||
|
function GetLocalizedName: string; override;
|
||||||
|
function GetLocalizedDescription: string; override;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure Register;
|
procedure Register;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -74,6 +85,8 @@ procedure Register;
|
|||||||
begin
|
begin
|
||||||
FormEditingHook.RegisterDesignerMediator(TMyWidgetMediator);
|
FormEditingHook.RegisterDesignerMediator(TMyWidgetMediator);
|
||||||
RegisterComponents('MyWidgets',[TMyButton,TMyGroupBox]);
|
RegisterComponents('MyWidgets',[TMyButton,TMyGroupBox]);
|
||||||
|
RegisterProjectFileDescriptor(TFileDescPascalUnitWithMyForm.Create,
|
||||||
|
FileDescGroupName);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TMyWidgetMediator }
|
{ TMyWidgetMediator }
|
||||||
@ -216,5 +229,30 @@ begin
|
|||||||
and (TMyWidget(Parent).AcceptChildsAtDesignTime);
|
and (TMyWidget(Parent).AcceptChildsAtDesignTime);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TFileDescPascalUnitWithMyForm }
|
||||||
|
|
||||||
|
constructor TFileDescPascalUnitWithMyForm.Create;
|
||||||
|
begin
|
||||||
|
inherited Create;
|
||||||
|
Name:='MyForm';
|
||||||
|
ResourceClass:=TMyForm;
|
||||||
|
UseCreateFormStatements:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TFileDescPascalUnitWithMyForm.GetInterfaceUsesSection: string;
|
||||||
|
begin
|
||||||
|
Result:=Result+'Classes, SysUtils, MyWidgetSet';
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TFileDescPascalUnitWithMyForm.GetLocalizedName: string;
|
||||||
|
begin
|
||||||
|
Result:='MyForm';
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TFileDescPascalUnitWithMyForm.GetLocalizedDescription: string;
|
||||||
|
begin
|
||||||
|
Result:='Create a new MyForm from example package NotLCLDesigner';
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user