mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 03:16:10 +02:00
IDE: fixed example designnonlcl
git-svn-id: trunk@56283 -
This commit is contained in:
parent
50a915579e
commit
5a8b53d7bf
@ -120,7 +120,7 @@ end;
|
||||
procedure TFrameDesignerForm.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
// workaround problem with out assumption that Width = ClientWidth, Height = ClientHeight
|
||||
// workaround problem with assumption that Width = ClientWidth, Height = ClientHeight
|
||||
NonFormProxyDesignerForm.AutoScroll := False;
|
||||
end;
|
||||
|
||||
|
@ -42,6 +42,9 @@ type
|
||||
TMyWidgetMediator = class(TDesignerMediator,IMyWidgetDesigner)
|
||||
private
|
||||
FMyForm: TMyForm;
|
||||
protected
|
||||
procedure Notification(AComponent: TComponent; Operation: TOperation);
|
||||
override;
|
||||
public
|
||||
// needed by the Lazarus form editor
|
||||
class function CreateMediator(TheOwner, aForm: TComponent): TDesignerMediator;
|
||||
@ -102,6 +105,20 @@ begin
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TMyWidgetMediator.Notification(AComponent: TComponent;
|
||||
Operation: TOperation);
|
||||
begin
|
||||
inherited Notification(AComponent, Operation);
|
||||
if Operation=opRemove then
|
||||
begin
|
||||
if FMyForm=AComponent then
|
||||
begin
|
||||
FMyForm.Designer:=nil;
|
||||
FMyForm:=nil;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
class function TMyWidgetMediator.CreateMediator(TheOwner, aForm: TComponent
|
||||
): TDesignerMediator;
|
||||
var
|
||||
@ -110,6 +127,7 @@ begin
|
||||
Result:=inherited CreateMediator(TheOwner,aForm);
|
||||
Mediator:=TMyWidgetMediator(Result);
|
||||
Mediator.FMyForm:=aForm as TMyForm;
|
||||
Mediator.FMyForm.FreeNotification(Mediator);
|
||||
Mediator.FMyForm.Designer:=Mediator;
|
||||
end;
|
||||
|
||||
|
@ -86,7 +86,7 @@ type
|
||||
function OnPropHookGetAncestorInstProp(const InstProp: TInstProp;
|
||||
out AncestorInstProp: TInstProp): boolean;
|
||||
protected
|
||||
FNonFormForms: TAvlTree; // tree of TNonControlDesignerForm sorted for LookupRoot
|
||||
FNonFormForms: TAvlTree; // tree of TNonFormProxyDesignerForm sorted for LookupRoot
|
||||
procedure SetSelection(const ASelection: TPersistentSelectionList);
|
||||
procedure OnObjectInspectorModified(Sender: TObject);
|
||||
procedure SetObj_Inspector(AnObjectInspector: TObjectInspectorDlg); virtual;
|
||||
@ -845,7 +845,8 @@ begin
|
||||
(Result as INonFormDesigner).LookupRoot := LookupRoot;
|
||||
FNonFormForms.Add(Result);
|
||||
|
||||
if Result is BaseFormEditor1.NonFormProxyDesignerForm[NonControlProxyDesignerFormId] then begin
|
||||
if Result is BaseFormEditor1.NonFormProxyDesignerForm[NonControlProxyDesignerFormId]
|
||||
then begin
|
||||
// create the mediator
|
||||
MediatorClass:=GetDesignerMediatorClass(TComponentClass(LookupRoot.ClassType));
|
||||
if MediatorClass<>nil then
|
||||
|
Loading…
Reference in New Issue
Block a user