mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-02 20:21:12 +02:00
IDEIntf: designer mediator: LCLForm and Designer
git-svn-id: trunk@21624 -
This commit is contained in:
parent
dca985f3e8
commit
4e4340b68b
@ -2507,7 +2507,9 @@ end;
|
||||
procedure TDesigner.SetMediator(const AValue: TDesignerMediator);
|
||||
begin
|
||||
if FMediator=AValue then exit;
|
||||
if FMediator<>nil then FMediator.Designer:=nil;
|
||||
FMediator:=AValue;
|
||||
if FMediator<>nil then FMediator.Designer:=Self;
|
||||
end;
|
||||
|
||||
procedure TDesigner.SetShowEditorHints(const AValue: boolean);
|
||||
|
@ -43,6 +43,7 @@ type
|
||||
private
|
||||
FFrameWidth: integer;
|
||||
FMediator: TDesignerMediator;
|
||||
procedure SetMediator(const AValue: TDesignerMediator);
|
||||
protected
|
||||
procedure SetFrameWidth(const AValue: integer); virtual;
|
||||
public
|
||||
@ -53,7 +54,7 @@ type
|
||||
procedure DoSaveBounds; override;
|
||||
public
|
||||
property FrameWidth: integer read FFrameWidth write SetFrameWidth;
|
||||
property Mediator: TDesignerMediator read FMediator write FMediator;
|
||||
property Mediator: TDesignerMediator read FMediator write SetMediator;
|
||||
end;
|
||||
|
||||
|
||||
@ -62,6 +63,14 @@ implementation
|
||||
|
||||
{ TNonControlDesignerForm }
|
||||
|
||||
procedure TNonControlDesignerForm.SetMediator(const AValue: TDesignerMediator);
|
||||
begin
|
||||
if FMediator=AValue then exit;
|
||||
if FMediator<>nil then FMediator.LCLForm:=nil;
|
||||
FMediator:=AValue;
|
||||
if FMediator<>nil then FMediator.LCLForm:=Self;
|
||||
end;
|
||||
|
||||
procedure TNonControlDesignerForm.SetFrameWidth(const AValue: integer);
|
||||
begin
|
||||
if FFrameWidth = AValue then
|
||||
|
@ -90,10 +90,21 @@ type
|
||||
which will emulate the painting, handle the mouse and editing bounds. }
|
||||
|
||||
TDesignerMediator = class(TComponent)
|
||||
private
|
||||
FDesigner: TComponentEditorDesigner;
|
||||
FLCLForm: TForm;
|
||||
protected
|
||||
procedure SetDesigner(const AValue: TComponentEditorDesigner);
|
||||
procedure SetLCLForm(const AValue: TForm); virtual;
|
||||
public
|
||||
class function FormClass: TComponentClass; virtual; abstract;
|
||||
class function CreateMediator(TheOwner, aForm: TComponent): TDesignerMediator; virtual; abstract;
|
||||
class procedure InitFormInstance(aForm: TComponent); virtual; // called after NewInstance, before constructor
|
||||
public
|
||||
procedure SetBounds(AComponent: TComponent; NewBounds: TRect); virtual; abstract;
|
||||
procedure GetBounds(AComponent: TComponent; out CurBounds: TRect); virtual; abstract;
|
||||
property LCLForm: TForm read FLCLForm write SetLCLForm;
|
||||
property Designer: TComponentEditorDesigner read FDesigner write SetDesigner;
|
||||
end;
|
||||
TDesignerMediatorClass = class of TDesignerMediator;
|
||||
|
||||
@ -182,6 +193,19 @@ implementation
|
||||
|
||||
{ TDesignerMediator }
|
||||
|
||||
procedure TDesignerMediator.SetDesigner(const AValue: TComponentEditorDesigner
|
||||
);
|
||||
begin
|
||||
if FDesigner=AValue then exit;
|
||||
FDesigner:=AValue;
|
||||
end;
|
||||
|
||||
procedure TDesignerMediator.SetLCLForm(const AValue: TForm);
|
||||
begin
|
||||
if FLCLForm=AValue then exit;
|
||||
FLCLForm:=AValue;
|
||||
end;
|
||||
|
||||
class procedure TDesignerMediator.InitFormInstance(aForm: TComponent);
|
||||
begin
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user