mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 04:39:22 +02:00
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:
parent
2ca8f21e64
commit
2f54ed431e
@ -431,6 +431,12 @@ type
|
|||||||
TPropertyEditorFilterFunc =
|
TPropertyEditorFilterFunc =
|
||||||
function(const ATestEditor: TPropertyEditor): Boolean of object;
|
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 RegisterEditorForm(const AEditorForm: TObject; const AReference: TPersistent);
|
||||||
procedure UnregisterEditorForm(const AEditorForm: TObject);
|
procedure UnregisterEditorForm(const AEditorForm: TObject);
|
||||||
|
@ -2812,6 +2812,9 @@ var
|
|||||||
ARight:=ALeft+TControl(AComponent).Width;
|
ARight:=ALeft+TControl(AComponent).Width;
|
||||||
ABottom:=ATop+TControl(AComponent).Height;
|
ABottom:=ATop+TControl(AComponent).Height;
|
||||||
end else begin
|
end else begin
|
||||||
|
if Assigned(IDEComponentsMaster) then
|
||||||
|
if not IDEComponentsMaster.DrawNonVisualComponents(ALookupRoot) then
|
||||||
|
Exit;
|
||||||
ARight:=ALeft+NonVisualCompWidth;
|
ARight:=ALeft+NonVisualCompWidth;
|
||||||
ABottom:=ATop+NonVisualCompWidth;
|
ABottom:=ATop+NonVisualCompWidth;
|
||||||
end;
|
end;
|
||||||
|
@ -475,6 +475,10 @@ begin
|
|||||||
else
|
else
|
||||||
IsNonVisual := DesignerProcs.ComponentIsNonVisual(Child);
|
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
|
if Child.InheritsFrom(MinClass) and (IsNonVisual or not OnlyNonVisual) then
|
||||||
begin
|
begin
|
||||||
Best := Child;
|
Best := Child;
|
||||||
@ -2014,6 +2018,13 @@ begin
|
|||||||
|
|
||||||
if ComponentIsIcon(MouseDownComponent) then
|
if ComponentIsIcon(MouseDownComponent) then
|
||||||
begin
|
begin
|
||||||
|
if Assigned(IDEComponentsMaster) then
|
||||||
|
if not IDEComponentsMaster.DrawNonVisualComponents(FLookupRoot) then
|
||||||
|
begin
|
||||||
|
MouseDownComponent := nil;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
|
||||||
NonVisualComp := MouseDownComponent;
|
NonVisualComp := MouseDownComponent;
|
||||||
MoveNonVisualComponentIntoForm(NonVisualComp);
|
MoveNonVisualComponentIntoForm(NonVisualComp);
|
||||||
end;
|
end;
|
||||||
@ -3572,7 +3583,10 @@ begin
|
|||||||
ControlSelection.DrawMarkers(DDC);
|
ControlSelection.DrawMarkers(DDC);
|
||||||
end;
|
end;
|
||||||
// non visual component icons
|
// non visual component icons
|
||||||
DrawNonVisualComponents(DDC);
|
if not Assigned(IDEComponentsMaster)
|
||||||
|
or IDEComponentsMaster.DrawNonVisualComponents(FLookupRoot) then
|
||||||
|
DrawNonVisualComponents(DDC);
|
||||||
|
|
||||||
// guidelines and grabbers
|
// guidelines and grabbers
|
||||||
if (ControlSelection.SelectionForm=Form) then
|
if (ControlSelection.SelectionForm=Form) then
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user