mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-27 15:30:48 +02:00
LCL: added debugging for Disable/EnableAutoSizing
git-svn-id: trunk@24094 -
This commit is contained in:
parent
41a4364e46
commit
e7b5a78d0f
@ -457,7 +457,7 @@ var
|
||||
MaxBtnPerRow: Integer;
|
||||
begin
|
||||
if FNoteBook<>nil then
|
||||
NoteBook.DisableAutoSizing;
|
||||
NoteBook.DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TComponentPalette.ReAlignButtons'){$ENDIF};
|
||||
try
|
||||
ButtonCount:=0;
|
||||
// skip the first control (this is the selection tool (TSpeedButton))
|
||||
@ -487,7 +487,7 @@ begin
|
||||
end;
|
||||
finally
|
||||
if NoteBook<>nil then
|
||||
NoteBook.EnableAutoSizing;
|
||||
NoteBook.EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TComponentPalette.ReAlignButtons'){$ENDIF};
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -660,11 +660,11 @@ end;
|
||||
|
||||
procedure TComponentPalette.ShowHideControls(Show: boolean);
|
||||
begin
|
||||
NoteBook.DisableAutoSizing;
|
||||
NoteBook.DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TComponentPalette.ShowHideControls'){$ENDIF};
|
||||
try
|
||||
inherited ShowHideControls(Show);
|
||||
finally
|
||||
NoteBook.EnableAutoSizing;
|
||||
NoteBook.EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TComponentPalette.ShowHideControls'){$ENDIF};
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -1262,7 +1262,7 @@ begin
|
||||
|
||||
// menu
|
||||
{$IFNDEF OldAutoSize}
|
||||
MainIDEBar.DisableAutoSizing;
|
||||
MainIDEBar.DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TMainIDE.Create'){$ENDIF};
|
||||
try
|
||||
{$ENDIF}
|
||||
SetupStandardIDEMenuItems;
|
||||
@ -1272,7 +1272,7 @@ begin
|
||||
ConnectMainBarEvents;
|
||||
{$IFNDEF OldAutoSize}
|
||||
finally
|
||||
MainIDEBar.EnableAutoSizing;
|
||||
MainIDEBar.EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TMainIDE.Create'){$ENDIF};
|
||||
end;
|
||||
{$ENDIF}
|
||||
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TMainIDE.Create MENU');{$ENDIF}
|
||||
@ -1342,7 +1342,7 @@ begin
|
||||
|
||||
DebugLn('[TMainIDE.Destroy] A ');
|
||||
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TMainIDE.Destroy A ');{$ENDIF}
|
||||
MainIDEBar.DisableAutoSizing;
|
||||
MainIDEBar.DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TMainIDE.Destroy'){$ENDIF};
|
||||
|
||||
if DebugBoss<>nil then DebugBoss.EndDebugging;
|
||||
|
||||
|
@ -3769,7 +3769,7 @@ destructor TSourceNotebook.Destroy;
|
||||
var
|
||||
i: integer;
|
||||
begin
|
||||
DisableAutoSizing;
|
||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TSourceNotebook.Destroy'){$ENDIF};
|
||||
FProcessingCommand:=false;
|
||||
for i:=FSourceEditorList.Count-1 downto 0 do
|
||||
Editors[i].Free;
|
||||
@ -6405,7 +6405,7 @@ Begin
|
||||
writeln('[TSourceNotebook.NewFile] A ');
|
||||
{$ENDIF}
|
||||
{$IFNDEF OldAutoSize}
|
||||
DisableAutoSizing;
|
||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TSourceNotebook.NewFile'){$ENDIF};
|
||||
try
|
||||
{$ENDIF}
|
||||
Visible:=true;
|
||||
@ -6422,7 +6422,7 @@ Begin
|
||||
UpdateProjectFiles;
|
||||
{$IFNDEF OldAutoSize}
|
||||
finally
|
||||
EnableAutoSizing;
|
||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TSourceNotebook.NewFile'){$ENDIF};
|
||||
end;
|
||||
{$ENDIF}
|
||||
if FocusIt then FocusEditor;
|
||||
@ -6443,7 +6443,7 @@ begin
|
||||
if TempEditor=nil then exit;
|
||||
//debugln(['TSourceNotebook.CloseFile ',TempEditor.FileName,' ',TempEditor.APageIndex]);
|
||||
{$IFNDEF OldAutoSize}
|
||||
DisableAutoSizing;
|
||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TSourceNotebook.CloseFile'){$ENDIF};
|
||||
try
|
||||
{$ENDIF}
|
||||
Visible:=true;
|
||||
@ -6482,7 +6482,7 @@ begin
|
||||
end;
|
||||
{$IFNDEF OldAutoSize}
|
||||
finally
|
||||
EnableAutoSizing;
|
||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TSourceNotebook.CloseFile'){$ENDIF};
|
||||
end;
|
||||
{$ENDIF}
|
||||
if (TempEditor <> nil) then
|
||||
|
@ -862,6 +862,9 @@ type
|
||||
FAnchorSides: array[TAnchorKind] of TAnchorSide;
|
||||
FAnchoredControls: TFPList; // list of TControl anchored to this control
|
||||
FAutoSizingLockCount: Integer; // in/decreased by DisableAutoSizing/EnableAutoSizing
|
||||
{$IFDEF DebugDisableAutoSizing}
|
||||
FAutoSizingLockReasons: TStrings;
|
||||
{$ENDIF}
|
||||
FBaseBounds: TRect;
|
||||
FBaseBoundsLock: integer;
|
||||
FBaseParentClientSize: TPoint;
|
||||
@ -1295,8 +1298,11 @@ type
|
||||
procedure CNPreferredSizeChanged;
|
||||
procedure InvalidatePreferredSize; virtual;
|
||||
function GetAnchorsDependingOnParent(WithNormalAnchors: Boolean): TAnchors;
|
||||
procedure DisableAutoSizing;
|
||||
procedure EnableAutoSizing;
|
||||
procedure DisableAutoSizing{$IFDEF DebugDisableAutoSizing}(const Reason: string){$ENDIF};
|
||||
procedure EnableAutoSizing{$IFDEF DebugDisableAutoSizing}(const Reason: string){$ENDIF};
|
||||
{$IFDEF DebugDisableAutoSizing}
|
||||
procedure WriteAutoSizeReasons;
|
||||
{$ENDIF}
|
||||
procedure UpdateBaseBounds(StoreBounds, StoreParentClientSize,
|
||||
UseLoadedValues: boolean); virtual;
|
||||
{$IFDEF OldAutoSize}
|
||||
|
@ -3071,11 +3071,11 @@ procedure TControl.Loaded;
|
||||
// all components on the form finished loading
|
||||
ClearLoadingFlags(TopParent);
|
||||
// call LoadedAll
|
||||
DisableAutoSizing;
|
||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.Loaded.CheckLoading'){$ENDIF};
|
||||
try
|
||||
AControl.LoadedAll;
|
||||
finally
|
||||
EnableAutoSizing;
|
||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.Loaded.CheckLoading'){$ENDIF};
|
||||
end;
|
||||
end;
|
||||
{$ENDIF}
|
||||
@ -3201,13 +3201,13 @@ procedure TControl.ReadState(Reader: TReader);
|
||||
begin
|
||||
{$IFNDEF OldAutoSize}
|
||||
Include(FControlFlags,cfLoading);
|
||||
DisableAutoSizing;
|
||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.ReadState'){$ENDIF};
|
||||
try
|
||||
{$ENDIF}
|
||||
inherited ReadState(Reader);
|
||||
{$IFNDEF OldAutoSize}
|
||||
finally
|
||||
EnableAutoSizing;
|
||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.ReadState'){$ENDIF};
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
@ -3550,7 +3550,7 @@ procedure TControl.SetParent(NewParent: TWinControl);
|
||||
begin
|
||||
if FParent = NewParent then exit;
|
||||
{$IFNDEF OldAutoSize}
|
||||
DisableAutoSizing;
|
||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.SetParent'){$ENDIF};
|
||||
try
|
||||
{$ENDIF}
|
||||
CheckNewParent(NewParent);
|
||||
@ -3563,7 +3563,7 @@ begin
|
||||
if NewParent <> nil then NewParent.InsertControl(Self);
|
||||
{$IFNDEF OldAutoSize}
|
||||
finally
|
||||
EnableAutoSizing;
|
||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.SetParent'){$ENDIF};
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
@ -3736,7 +3736,7 @@ begin
|
||||
begin
|
||||
//DebugLn(['TControl.SetVisible ',DbgSName(Self),' NewVisible=',Value]);
|
||||
{$IFNDEF OldAutoSize}
|
||||
DisableAutoSizing;
|
||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.SetVisible'){$ENDIF};
|
||||
try
|
||||
{$ENDIF}
|
||||
VisibleChanging;
|
||||
@ -3791,7 +3791,7 @@ begin
|
||||
end;
|
||||
{$IFNDEF OldAutoSize}
|
||||
finally
|
||||
EnableAutoSizing;
|
||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.SetVisible'){$ENDIF};
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
@ -4296,6 +4296,9 @@ begin
|
||||
//DebugLn('[TControl.Destroy] END ',DbgSName(Self));
|
||||
for HandlerType := Low(TControlHandlerType) to High(TControlHandlerType) do
|
||||
FreeThenNil(FControlHandlers[HandlerType]);
|
||||
{$IFDEF DebugDisableAutoSizing}
|
||||
FreeAndNil(FAutoSizingLockReasons);
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -4310,7 +4313,7 @@ var
|
||||
Side: TAnchorKind;
|
||||
begin
|
||||
{$IFNDEF OldAutoSize}
|
||||
DisableAutoSizing;
|
||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.Create'){$ENDIF};
|
||||
try
|
||||
{$ENDIF}
|
||||
//if AnsiCompareText(ClassName,'TSpeedButton')=0 then
|
||||
@ -4348,7 +4351,7 @@ begin
|
||||
//DebugLn('TControl.Create END ',Name,':',ClassName);
|
||||
{$IFNDEF OldAutoSize}
|
||||
finally
|
||||
EnableAutoSizing;
|
||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.Create'){$ENDIF};
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
@ -4832,25 +4835,31 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TControl.DisableAutoSizing;
|
||||
procedure TControl.DisableAutoSizing
|
||||
{$IFDEF DebugDisableAutoSizing}(const Reason: string){$ENDIF};
|
||||
begin
|
||||
{$IFDEF OldAutoSize}
|
||||
inc(FAutoSizingLockCount);
|
||||
{$ELSE}
|
||||
inc(FAutoSizingLockCount);
|
||||
{$IFDEF DebugDisableAutoSizing}
|
||||
if FAutoSizingLockReasons=nil then FAutoSizingLockReasons:=TStringList.Create;
|
||||
FAutoSizingLockReasons.Add(Reason);
|
||||
{$ENDIF}
|
||||
//DebugLn([Space(FAutoSizingLockCount*2),'TControl.DisableAutoSizing ',DbgSName(Self),' ',FAutoSizingLockCount]);
|
||||
if FAutoSizingLockCount=1 then
|
||||
begin
|
||||
if Parent<>nil then
|
||||
begin
|
||||
//DebugLn([Space(FAutoSizingLockCount*2),'TControl.DisableAutoSizing ',DbgSName(Self),' disable Parent=',DbgSName(Parent)]);
|
||||
Parent.DisableAutoSizing;
|
||||
Parent.DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.DisableAutoSizing'){$ENDIF};
|
||||
end;
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
procedure TControl.EnableAutoSizing;
|
||||
procedure TControl.EnableAutoSizing
|
||||
{$IFDEF DebugDisableAutoSizing}(const Reason: string){$ENDIF};
|
||||
|
||||
{$IFDEF OldAutoSize}
|
||||
procedure AdjustSizeRecursive(AControl: TControl);
|
||||
@ -4869,13 +4878,35 @@ procedure TControl.EnableAutoSizing;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF DebugDisableAutoSizing}
|
||||
procedure CheckReason;
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
i:=FAutoSizingLockReasons.Count-1;
|
||||
while i>=0 do begin
|
||||
if FAutoSizingLockReasons[i]=Reason then begin
|
||||
FAutoSizingLockReasons.Delete(i);
|
||||
exit;
|
||||
end;
|
||||
dec(i);
|
||||
end;
|
||||
RaiseGDBException('TControl.EnableAutoSizing never disabled with reason: '+Reason);
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
begin
|
||||
{$IFDEF DebugDisableAutoSizing}
|
||||
CheckReason;
|
||||
{$ENDIF}
|
||||
|
||||
if FAutoSizingLockCount<=0 then RaiseGDBException('TControl.EnableAutoSizing');
|
||||
{$IFDEF OldAutoSize}
|
||||
dec(FAutoSizingLockCount);
|
||||
if FAutoSizingLockCount=0 then
|
||||
AdjustSizeRecursive(Self);
|
||||
{$ELSE}
|
||||
|
||||
dec(FAutoSizingLockCount);
|
||||
//DebugLn([Space(FAutoSizingLockCount*2),'TControl.EnableAutoSizing ',DbgSName(Self),' ',FAutoSizingLockCount]);
|
||||
if (FAutoSizingLockCount=0) then
|
||||
@ -4883,13 +4914,21 @@ begin
|
||||
if (Parent<>nil) then
|
||||
begin
|
||||
//DebugLn([Space(FAutoSizingLockCount*2),'TControl.EnableAutoSizing ',DbgSName(Self),' enable Parent ',DbgSName(Parent)]);
|
||||
Parent.EnableAutoSizing;
|
||||
Parent.EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.DisableAutoSizing'){$ENDIF};
|
||||
end else
|
||||
DoAllAutoSize;
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
{$IFDEF DebugDisableAutoSizing}
|
||||
procedure TControl.WriteAutoSizeReasons;
|
||||
begin
|
||||
DebugLn(['TControl.WriteAutoSizeReasons ',DbgSName(Self)]);
|
||||
debugln(FAutoSizingLockReasons.Text);
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
procedure TControl.EndAutoSizing;
|
||||
procedure Error;
|
||||
begin
|
||||
|
@ -100,7 +100,7 @@ begin
|
||||
if not (csDestroying in ComponentState) then GlobalNameSpace.BeginWrite;
|
||||
try
|
||||
{$IFNDEF OldAutoSize}
|
||||
DisableAutoSizing;
|
||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomForm.Destroy'){$ENDIF};
|
||||
{$ENDIF}
|
||||
FreeThenNil(FIcon);
|
||||
FreeIconHandles;
|
||||
@ -858,7 +858,7 @@ begin
|
||||
FormEndUpdated;
|
||||
Visible:=(fsVisible in FFormState);
|
||||
{$IFNDEF OldAutoSize}
|
||||
EnableAutoSizing;
|
||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomForm.BeginFormUpdate'){$ENDIF};
|
||||
{$ENDIF}
|
||||
end;
|
||||
end;
|
||||
@ -1367,6 +1367,7 @@ var
|
||||
I: Integer;
|
||||
begin
|
||||
if (csDesigning in ComponentState) or (not Showing) then exit;
|
||||
{$IFDEF DebugDisableAutoSizing}WriteAutoSizeReasons;{$ENDIF}
|
||||
// update this form
|
||||
InitiateAction;
|
||||
// update main menu's top-most items
|
||||
@ -2241,7 +2242,7 @@ begin
|
||||
inc(FFormUpdateCount);
|
||||
{$IFNDEF OldAutoSize}
|
||||
if FFormUpdateCount=1 then
|
||||
DisableAutoSizing;
|
||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomForm.BeginFormUpdate'){$ENDIF};
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
|
@ -591,7 +591,7 @@ end;
|
||||
procedure TCustomNoteBook.AddRemovePageHandle(APage: TCustomPage);
|
||||
begin
|
||||
{$IFNDEF OldAutoSize}
|
||||
DisableAutoSizing;
|
||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomNoteBook.AddRemovePageHandle'){$ENDIF};
|
||||
try
|
||||
{$ENDIF}
|
||||
if (not (csDestroying in APage.ComponentState))
|
||||
@ -622,7 +622,7 @@ begin
|
||||
end;
|
||||
{$IFNDEF OldAutoSize}
|
||||
finally
|
||||
EnableAutoSizing;
|
||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomNoteBook.AddRemovePageHandle'){$ENDIF};
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
@ -30,14 +30,14 @@ end;
|
||||
procedure TScrollingWinControl.CreateWnd;
|
||||
begin
|
||||
{$IFNDEF OldAutoSize}
|
||||
DisableAutoSizing;
|
||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TScrollingWinControl.CreateWnd'){$ENDIF};
|
||||
try
|
||||
{$ENDIF}
|
||||
inherited CreateWnd;
|
||||
UpdateScrollBars;
|
||||
{$IFNDEF OldAutoSize}
|
||||
finally
|
||||
EnableAutoSizing;
|
||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TScrollingWinControl.CreateWnd'){$ENDIF};
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
@ -3325,7 +3325,7 @@ begin
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
DisableAutoSizing;
|
||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.DoAutoSize'){$ENDIF};
|
||||
{$IFDEF OldAutoSize}
|
||||
// obsolete
|
||||
DisableAlign;
|
||||
@ -3422,7 +3422,7 @@ begin
|
||||
end;
|
||||
finally
|
||||
Exclude(FControlFlags,cfAutoSizeNeeded);
|
||||
EnableAutoSizing;
|
||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.DoAutoSize'){$ENDIF};
|
||||
{$IFDEF OldAutoSize}
|
||||
// obsolete
|
||||
EnableAlign;
|
||||
@ -3577,7 +3577,7 @@ begin
|
||||
Inc(FAlignLevel);
|
||||
//DebugLn(['TWinControl.DisableAlign ',dbgsName(Self),' ',FAlignLevel]);
|
||||
{$ELSE}
|
||||
DisableAutoSizing;
|
||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.DisableAlign'){$ENDIF};
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
@ -3710,7 +3710,7 @@ begin
|
||||
ReAlign;
|
||||
end;
|
||||
{$ELSE}
|
||||
EnableAutoSizing;
|
||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.DisableAlign'){$ENDIF};
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
@ -5842,8 +5842,8 @@ begin
|
||||
if AControl.FAutoSizingLockCount>0 then
|
||||
begin
|
||||
// the AControl has disabled autosizing => disable it for the parent=self too
|
||||
//DebugLn(['TWinControl.Insert ',DbgSName(Self),' Control=',DbgSName(AControl),' disable Parent']);
|
||||
DisableAutoSizing;
|
||||
//DebugLn([Space(FAutoSizingLockCount*2+2),'TWinControl.Insert ',DbgSName(Self),' Control=',DbgSName(AControl),' disable Parent']);
|
||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.DisableAutoSizing'){$ENDIF};
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
@ -5892,8 +5892,8 @@ begin
|
||||
begin
|
||||
// AControl has disabled autosizing and thus for its parent=Self too
|
||||
// end disable autosize for parent=self
|
||||
//DebugLn(['TWinControl.Remove ',DbgSName(Self),' Control=',DbgSName(AControl),' enable Parent']);
|
||||
EnableAutoSizing;
|
||||
//DebugLn([Space(FAutoSizingLockCount*2),'TWinControl.Remove ',DbgSName(Self),' Control=',DbgSName(AControl),' enable Parent']);
|
||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.DisableAutoSizing'){$ENDIF};
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
@ -5998,7 +5998,7 @@ end;
|
||||
procedure TWinControl.InsertControl(AControl: TControl; Index: integer);
|
||||
begin
|
||||
{$IFNDEF OldAutoSize}
|
||||
DisableAutoSizing;
|
||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.InsertControl'){$ENDIF};
|
||||
try
|
||||
{$ENDIF}
|
||||
AControl.ValidateContainer(Self);
|
||||
@ -6026,7 +6026,7 @@ begin
|
||||
Perform(CM_CONTROLCHANGE, WParam(AControl), LParam(True));
|
||||
{$IFNDEF OldAutoSize}
|
||||
finally
|
||||
EnableAutoSizing;
|
||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.InsertControl'){$ENDIF};
|
||||
end;
|
||||
{$ENDIF}
|
||||
//debugln(['TWinControl.InsertControl ',DbgSName(Self),' ',csDesigning in ComponentState,' ',DbgSName(AControl),' ',csDesigning in AControl.ComponentState]);
|
||||
@ -6040,7 +6040,7 @@ var
|
||||
AWinControl: TWinControl;
|
||||
begin
|
||||
{$IFNDEF OldAutoSize}
|
||||
DisableAutoSizing;
|
||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.RemoveControl'){$ENDIF};
|
||||
try
|
||||
{$ENDIF}
|
||||
Perform(CM_CONTROLCHANGE, WParam(AControl), LParam(False));
|
||||
@ -6072,7 +6072,7 @@ begin
|
||||
end;
|
||||
{$IFNDEF OldAutoSize}
|
||||
finally
|
||||
EnableAutoSizing;
|
||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.RemoveControl'){$ENDIF};
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
@ -7045,7 +7045,7 @@ begin
|
||||
// obsolete
|
||||
DisableAlign;
|
||||
{$ENDIF}
|
||||
DisableAutoSizing;
|
||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.CreateWnd'){$ENDIF};
|
||||
try
|
||||
{$IFNDEF OldAutoSize}
|
||||
if (Parent<>nil) and (not Parent.HandleAllocated) then
|
||||
@ -7132,7 +7132,7 @@ begin
|
||||
{$ENDIF}
|
||||
finally
|
||||
//DebugLn(['TWinControl.CreateWnd ',DbgSName(Self)]);
|
||||
EnableAutoSizing;
|
||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.CreateWnd'){$ENDIF};
|
||||
{$IFDEF OldAutoSize}
|
||||
// obsolete
|
||||
EnableAlign;
|
||||
@ -7165,7 +7165,7 @@ begin
|
||||
{$IFDEF OldAutoSize}
|
||||
DisableAlign;
|
||||
{$ENDIF}
|
||||
DisableAutoSizing;
|
||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.InitializeWnd'){$ENDIF};
|
||||
try
|
||||
{$IFDEF CHECK_POSITION}
|
||||
if CheckPosition(Self) then
|
||||
@ -7207,7 +7207,7 @@ begin
|
||||
then TWSWinControlClass(WidgetSetClass).SetCursor(Self, Screen.Cursors[crDefault])
|
||||
else TWSWinControlClass(WidgetSetClass).SetCursor(Self, Screen.Cursors[Cursor]);
|
||||
finally
|
||||
EnableAutoSizing;
|
||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.InitializeWnd'){$ENDIF};
|
||||
{$IFDEF OldAutoSize}
|
||||
EnableAlign;
|
||||
{$ENDIF}
|
||||
@ -7299,7 +7299,7 @@ begin
|
||||
{$ELSE}
|
||||
//DebugLn(['TWinControl.Loaded START ',DbgSName(Self),' cfWidthLoaded=',cfWidthLoaded in FControlFlags,' cfHeightLoaded=',cfHeightLoaded in FControlFlags,' ']);
|
||||
{$ENDIF}
|
||||
DisableAutoSizing;
|
||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.Loaded'){$ENDIF};
|
||||
try
|
||||
//DebugLn(['TWinControl.Loaded ',DbgSName(Self),' cfWidthLoaded=',cfWidthLoaded in FControlFlags,' cfHeightLoaded=',cfHeightLoaded in FControlFlags,' ']);
|
||||
if cfClientWidthLoaded in FControlFlags then
|
||||
@ -7367,7 +7367,7 @@ begin
|
||||
{$IFNDEF OldAutoSize}
|
||||
//DebugLn(['TWinControl.Loaded enableautosizing ',DbgSName(Self),' ',dbgs(BoundsRect)]);
|
||||
{$ENDIF}
|
||||
EnableAutoSizing;
|
||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.Loaded'){$ENDIF};
|
||||
{$IFDEF OldAutoSize}
|
||||
// obsolete
|
||||
EnableAlign;
|
||||
@ -7401,7 +7401,7 @@ begin
|
||||
begin
|
||||
//DebugLn(['TWinControl.DestroyWnd ',DbgSName(Self)]);
|
||||
{$IFNDEF OldAutoSize}
|
||||
DisableAutoSizing;
|
||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.DestroyWnd'){$ENDIF};
|
||||
try
|
||||
{$ENDIF}
|
||||
FinalizeWnd;
|
||||
@ -7418,7 +7418,7 @@ begin
|
||||
FWinControlFlags := FWinControlFlags + [wcfColorChanged, wcfFontChanged];
|
||||
{$IFNDEF OldAutoSize}
|
||||
finally
|
||||
EnableAutoSizing;
|
||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.DestroyWnd'){$ENDIF};
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
@ -7673,7 +7673,7 @@ begin
|
||||
{$IFDEF OldAutoSize}
|
||||
LockRealizeBounds;
|
||||
{$ELSE}
|
||||
DisableAutoSizing;
|
||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.SetBounds'){$ENDIF};
|
||||
{$ENDIF}
|
||||
try
|
||||
{$IFDEF CHECK_POSITION}
|
||||
@ -7690,7 +7690,7 @@ begin
|
||||
{$IFDEF OldAutoSize}
|
||||
UnlockRealizeBounds;
|
||||
{$ELSE}
|
||||
EnableAutoSizing;
|
||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.SetBounds'){$ENDIF};
|
||||
{$ENDIF}
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user