mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 00:37:47 +02:00
LCL + Designer: A new flag TWinControl.DesignerDeleting. Make TPairSplitter use it. Issue #26618
git-svn-id: trunk@46072 -
This commit is contained in:
parent
b6da8dd7a5
commit
9d6fca6e69
@ -2991,6 +2991,9 @@ Begin
|
||||
// remove all child controls owned by the LookupRoot
|
||||
if (APersistent is TWinControl) then begin
|
||||
AWinControl:=TWinControl(APersistent);
|
||||
// Component may to auto-create new components during deletion unless informed.
|
||||
// ComponentState does not have csDestroying yet when removing children.
|
||||
AWinControl.DesignerDeleting := True;
|
||||
i:=AWinControl.ControlCount-1;
|
||||
while (i>=0) do begin
|
||||
ChildControl:=AWinControl.Controls[i];
|
||||
@ -3005,6 +3008,7 @@ Begin
|
||||
end else
|
||||
dec(i);
|
||||
end;
|
||||
AWinControl.DesignerDeleting := False;
|
||||
end;
|
||||
// remove component
|
||||
{$IFDEF VerboseDesigner}
|
||||
|
@ -1893,6 +1893,7 @@ type
|
||||
FDoubleBuffered: Boolean;
|
||||
FDockSite: Boolean;
|
||||
FUseDockManager: Boolean;
|
||||
FDesignerDeleting: Boolean;
|
||||
procedure AlignControl(AControl: TControl);
|
||||
function GetBrush: TBrush;
|
||||
function GetControl(const Index: Integer): TControl;
|
||||
@ -2120,6 +2121,7 @@ type
|
||||
property Showing: Boolean read FShowing; // handle visible
|
||||
property UseDockManager: Boolean read FUseDockManager
|
||||
write SetUseDockManager default False;
|
||||
property DesignerDeleting: Boolean read FDesignerDeleting write FDesignerDeleting;
|
||||
property VisibleDockClientCount: Integer read GetVisibleDockClientCount;
|
||||
public
|
||||
// size, position, bounds
|
||||
|
@ -170,19 +170,26 @@ end;
|
||||
procedure TPairSplitterSide.SetParent(AParent: TWinControl);
|
||||
var
|
||||
ASplitter: TCustomPairSplitter;
|
||||
DeletingSplitter: Boolean;
|
||||
begin
|
||||
CheckNewParent(AParent);
|
||||
// remove from side list of old parent
|
||||
ASplitter := Splitter;
|
||||
if ASplitter <> nil then
|
||||
if ASplitter <> nil then begin
|
||||
ASplitter.RemoveSide(Self);
|
||||
DeletingSplitter := (csDestroying in ASplitter.ComponentState) or DesignerDeleting;
|
||||
end
|
||||
else
|
||||
DeletingSplitter := False;
|
||||
|
||||
inherited SetParent(AParent);
|
||||
|
||||
// add to side list of new parent
|
||||
ASplitter:=Splitter;
|
||||
if ASplitter <> nil then
|
||||
ASplitter.AddSide(Self);
|
||||
if not DeletingSplitter then begin
|
||||
// add to side list of new parent
|
||||
ASplitter:=Splitter;
|
||||
if ASplitter <> nil then
|
||||
ASplitter.AddSide(Self);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TPairSplitterSide.WMPaint(var PaintMessage: TLMPaint);
|
||||
@ -281,7 +288,7 @@ begin
|
||||
i := Low(FSides);
|
||||
repeat
|
||||
if FSides[i] = ASide then
|
||||
Exit;
|
||||
Exit;
|
||||
if FSides[i] =nil then
|
||||
begin
|
||||
FSides[i] := ASide;
|
||||
@ -309,7 +316,8 @@ begin
|
||||
FSides[i] := nil;
|
||||
end;
|
||||
// if the user deletes a side at designtime, autocreate a new one
|
||||
if (csDesigning in ComponentState) then
|
||||
if (ComponentState * [csDesigning,csDestroying] = [csDesigning])
|
||||
and not DesignerDeleting then
|
||||
CreateSides;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user