Designer: IDEComponentsMaster class proposition for manipulating components (now with single method). r49372 from free-sparta branch by Maciej Izak.

git-svn-id: trunk@49529 -
This commit is contained in:
juha 2015-07-12 23:05:13 +00:00
parent 2ca8f21e64
commit 2f54ed431e
3 changed files with 24 additions and 1 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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