From 2f54ed431e790022440964fcab6dfa9f23ad2700 Mon Sep 17 00:00:00 2001 From: juha Date: Sun, 12 Jul 2015 23:05:13 +0000 Subject: [PATCH] Designer: IDEComponentsMaster class proposition for manipulating components (now with single method). r49372 from free-sparta branch by Maciej Izak. git-svn-id: trunk@49529 - --- components/ideintf/componenteditors.pas | 6 ++++++ designer/controlselection.pp | 3 +++ designer/designer.pp | 16 +++++++++++++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/components/ideintf/componenteditors.pas b/components/ideintf/componenteditors.pas index ab80668339..3f191891e6 100644 --- a/components/ideintf/componenteditors.pas +++ b/components/ideintf/componenteditors.pas @@ -431,6 +431,12 @@ type TPropertyEditorFilterFunc = function(const ATestEditor: TPropertyEditor): Boolean of object; + TIDEComponentsMaster = class + function DrawNonVisualComponents(ALookupRoot: TComponent): Boolean; virtual; abstract; + end; + +var + IDEComponentsMaster: TIDEComponentsMaster = nil; procedure RegisterEditorForm(const AEditorForm: TObject; const AReference: TPersistent); procedure UnregisterEditorForm(const AEditorForm: TObject); diff --git a/designer/controlselection.pp b/designer/controlselection.pp index 2244f8984f..b06653d405 100644 --- a/designer/controlselection.pp +++ b/designer/controlselection.pp @@ -2812,6 +2812,9 @@ var ARight:=ALeft+TControl(AComponent).Width; ABottom:=ATop+TControl(AComponent).Height; end else begin + if Assigned(IDEComponentsMaster) then + if not IDEComponentsMaster.DrawNonVisualComponents(ALookupRoot) then + Exit; ARight:=ALeft+NonVisualCompWidth; ABottom:=ATop+NonVisualCompWidth; end; diff --git a/designer/designer.pp b/designer/designer.pp index bdaf608e18..580199c163 100644 --- a/designer/designer.pp +++ b/designer/designer.pp @@ -475,6 +475,10 @@ begin else IsNonVisual := DesignerProcs.ComponentIsNonVisual(Child); + if IsNonVisual and Assigned(IDEComponentsMaster) then + if not IDEComponentsMaster.DrawNonVisualComponents(Root) then + Exit; + if Child.InheritsFrom(MinClass) and (IsNonVisual or not OnlyNonVisual) then begin Best := Child; @@ -2014,6 +2018,13 @@ begin if ComponentIsIcon(MouseDownComponent) then begin + if Assigned(IDEComponentsMaster) then + if not IDEComponentsMaster.DrawNonVisualComponents(FLookupRoot) then + begin + MouseDownComponent := nil; + Exit; + end; + NonVisualComp := MouseDownComponent; MoveNonVisualComponentIntoForm(NonVisualComp); end; @@ -3572,7 +3583,10 @@ begin ControlSelection.DrawMarkers(DDC); end; // non visual component icons - DrawNonVisualComponents(DDC); + if not Assigned(IDEComponentsMaster) + or IDEComponentsMaster.DrawNonVisualComponents(FLookupRoot) then + DrawNonVisualComponents(DDC); + // guidelines and grabbers if (ControlSelection.SelectionForm=Form) then begin