mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-29 12:16:17 +02:00
LCL: fixed compiling with DebugDisableAutoSizing, bug #17817
git-svn-id: trunk@28059 -
This commit is contained in:
parent
e7da031bee
commit
1c7a2d7963
@ -179,7 +179,7 @@ var
|
|||||||
btn: TPanelButton;
|
btn: TPanelButton;
|
||||||
aButton: TPanelBitBtn;
|
aButton: TPanelBitBtn;
|
||||||
begin
|
begin
|
||||||
DisableAutoSizing;
|
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomButtonPanel.DoShowButtons'){$ENDIF};
|
||||||
|
|
||||||
for btn := Low(btn) to High(btn) do
|
for btn := Low(btn) to High(btn) do
|
||||||
begin
|
begin
|
||||||
@ -204,7 +204,7 @@ begin
|
|||||||
|
|
||||||
UpdateButtonOrder;
|
UpdateButtonOrder;
|
||||||
UpdateButtonLayout;
|
UpdateButtonLayout;
|
||||||
EnableAutoSizing;
|
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomButtonPanel.DoShowButtons'){$ENDIF};
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomButtonPanel.SetShowButtons(Value: TPanelButtons);
|
procedure TCustomButtonPanel.SetShowButtons(Value: TPanelButtons);
|
||||||
@ -221,7 +221,7 @@ procedure TCustomButtonPanel.DoShowGlyphs;
|
|||||||
var
|
var
|
||||||
btn: TPanelButton;
|
btn: TPanelButton;
|
||||||
begin
|
begin
|
||||||
DisableAutoSizing;
|
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomButtonPanel.DoShowGlyphs'){$ENDIF};
|
||||||
for btn := Low(btn) to High(btn) do
|
for btn := Low(btn) to High(btn) do
|
||||||
begin
|
begin
|
||||||
if FButtons[btn] = nil then Continue;
|
if FButtons[btn] = nil then Continue;
|
||||||
@ -235,7 +235,7 @@ begin
|
|||||||
FButtons[btn].Glyph.Assign(nil);
|
FButtons[btn].Glyph.Assign(nil);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
EnableAutoSizing;
|
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomButtonPanel.DoShowGlyphs'){$ENDIF};
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomButtonPanel.SetShowGlyphs(Value: TPanelButtons);
|
procedure TCustomButtonPanel.SetShowGlyphs(Value: TPanelButtons);
|
||||||
@ -354,14 +354,14 @@ end;
|
|||||||
|
|
||||||
procedure TCustomButtonPanel.SetAlign(Value: TAlign);
|
procedure TCustomButtonPanel.SetAlign(Value: TAlign);
|
||||||
begin
|
begin
|
||||||
DisableAutoSizing;
|
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomButtonPanel.SetAlign'){$ENDIF};
|
||||||
try
|
try
|
||||||
inherited SetAlign(Value);
|
inherited SetAlign(Value);
|
||||||
UpdateButtonLayout;
|
UpdateButtonLayout;
|
||||||
UpdateBevel;
|
UpdateBevel;
|
||||||
UpdateSizes;
|
UpdateSizes;
|
||||||
finally
|
finally
|
||||||
EnableAutoSizing;
|
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomButtonPanel.SetAlign'){$ENDIF};
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -409,7 +409,7 @@ begin
|
|||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
DisableAutoSizing;
|
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomButtonPanel.SetShowBevel'){$ENDIF};
|
||||||
try
|
try
|
||||||
FBevel := TBevel.Create(Self);
|
FBevel := TBevel.Create(Self);
|
||||||
FBevel.Parent := Self;
|
FBevel.Parent := Self;
|
||||||
@ -417,7 +417,7 @@ begin
|
|||||||
|
|
||||||
UpdateBevel;
|
UpdateBevel;
|
||||||
finally
|
finally
|
||||||
EnableAutoSizing;
|
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomButtonPanel.SetShowBevel'){$ENDIF};
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -3376,7 +3376,7 @@ var
|
|||||||
OldSide: TAnchorSideReference;
|
OldSide: TAnchorSideReference;
|
||||||
begin
|
begin
|
||||||
if FSide=AValue then exit;
|
if FSide=AValue then exit;
|
||||||
FOwner.DisableAutoSizing;
|
FOwner.DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TAnchorSide.SetSide'){$ENDIF};
|
||||||
if AValue=asrCenter then begin
|
if AValue=asrCenter then begin
|
||||||
OldSide:=FSide;
|
OldSide:=FSide;
|
||||||
FixCenterAnchoring;
|
FixCenterAnchoring;
|
||||||
@ -3386,7 +3386,7 @@ begin
|
|||||||
FOwner.AnchorSideChanged(Self);
|
FOwner.AnchorSideChanged(Self);
|
||||||
if FControl<>nil then
|
if FControl<>nil then
|
||||||
FControl.ForeignAnchorSideChanged(Self,ascoChangeSide);
|
FControl.ForeignAnchorSideChanged(Self,ascoChangeSide);
|
||||||
FOwner.EnableAutoSizing;
|
FOwner.EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TAnchorSide.SetSide'){$ENDIF};
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TAnchorSide.GetOwner: TPersistent;
|
function TAnchorSide.GetOwner: TPersistent;
|
||||||
|
@ -509,7 +509,7 @@ begin
|
|||||||
if (FloatingClass<>nil) and (FloatingClass<>TWinControlClass(ClassType)) then
|
if (FloatingClass<>nil) and (FloatingClass<>TWinControlClass(ClassType)) then
|
||||||
begin
|
begin
|
||||||
Result := TWinControl(FloatingClass.NewInstance);
|
Result := TWinControl(FloatingClass.NewInstance);
|
||||||
Result.DisableAutoSizing;
|
Result.DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.CreateFloatingDockSite'){$ENDIF};
|
||||||
Result.Create(Self);
|
Result.Create(Self);
|
||||||
// resize with minimal resizes
|
// resize with minimal resizes
|
||||||
NewClientWidth:=Bounds.Right-Bounds.Left;
|
NewClientWidth:=Bounds.Right-Bounds.Left;
|
||||||
@ -519,7 +519,7 @@ begin
|
|||||||
Result.SetBounds(Bounds.Left,Bounds.Top,NewWidth,NewHeight);
|
Result.SetBounds(Bounds.Left,Bounds.Top,NewWidth,NewHeight);
|
||||||
Result.SetClientSize(Point(NewClientWidth,NewClientHeight));
|
Result.SetClientSize(Point(NewClientWidth,NewClientHeight));
|
||||||
debugln('TControl.CreateFloatingDockSite A ',DbgSName(Self),' ',DbgSName(Result),' ',dbgs(Result.BoundsRect));
|
debugln('TControl.CreateFloatingDockSite A ',DbgSName(Self),' ',DbgSName(Result),' ',dbgs(Result.BoundsRect));
|
||||||
Result.EnableAutoSizing;
|
Result.EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.CreateFloatingDockSite'){$ENDIF};
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -3807,7 +3807,7 @@ begin
|
|||||||
RaiseAlreadyDocking;
|
RaiseAlreadyDocking;
|
||||||
|
|
||||||
// dock
|
// dock
|
||||||
DisableAutoSizing;
|
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.Dock'){$ENDIF};
|
||||||
Include(FControlState, csDocking);
|
Include(FControlState, csDocking);
|
||||||
try
|
try
|
||||||
OldHostDockSite:=HostDockSite;
|
OldHostDockSite:=HostDockSite;
|
||||||
@ -3837,7 +3837,7 @@ begin
|
|||||||
NewDockSite.FDockClients.Remove(Self);
|
NewDockSite.FDockClients.Remove(Self);
|
||||||
Exclude(FControlState, csDocking);
|
Exclude(FControlState, csDocking);
|
||||||
end;
|
end;
|
||||||
EnableAutoSizing;
|
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.Dock'){$ENDIF};
|
||||||
|
|
||||||
//DebugLn(['TControl.Dock END ',DbgSName(Self),' ',DbgSName(HostDockSite)]);
|
//DebugLn(['TControl.Dock END ',DbgSName(Self),' ',DbgSName(HostDockSite)]);
|
||||||
end;
|
end;
|
||||||
@ -3861,9 +3861,9 @@ var
|
|||||||
NewPosition: TPoint;
|
NewPosition: TPoint;
|
||||||
begin
|
begin
|
||||||
if DropControl<>nil then
|
if DropControl<>nil then
|
||||||
DropControl.DisableAutoSizing;
|
DropControl.DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.ManualDock DropControl'){$ENDIF};
|
||||||
if NewDockSite<>nil then
|
if NewDockSite<>nil then
|
||||||
NewDockSite.DisableAutoSizing;
|
NewDockSite.DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.ManualDock NewDockSite'){$ENDIF};
|
||||||
if (NewDockSite=nil) then begin
|
if (NewDockSite=nil) then begin
|
||||||
// undock / float this control
|
// undock / float this control
|
||||||
// float the control at the same screen position
|
// float the control at the same screen position
|
||||||
@ -3919,9 +3919,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if NewDockSite<>nil then
|
if NewDockSite<>nil then
|
||||||
NewDockSite.EnableAutoSizing;
|
NewDockSite.EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.ManualDock NewDockSite'){$ENDIF};
|
||||||
if DropControl<>nil then
|
if DropControl<>nil then
|
||||||
DropControl.EnableAutoSizing;
|
DropControl.EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.ManualDock DropControl'){$ENDIF};
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -3938,7 +3938,7 @@ var
|
|||||||
FloatHost: TWinControl;
|
FloatHost: TWinControl;
|
||||||
begin
|
begin
|
||||||
DebugLn(['TControl.ManualFloat ',DbgSName(Self)]);
|
DebugLn(['TControl.ManualFloat ',DbgSName(Self)]);
|
||||||
DisableAutoSizing;
|
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.ManualFloat'){$ENDIF};
|
||||||
// undock from old host dock site
|
// undock from old host dock site
|
||||||
if HostDockSite = nil then
|
if HostDockSite = nil then
|
||||||
begin
|
begin
|
||||||
@ -3966,7 +3966,7 @@ begin
|
|||||||
else
|
else
|
||||||
Dock(nil, TheScreenRect);
|
Dock(nil, TheScreenRect);
|
||||||
end;
|
end;
|
||||||
EnableAutoSizing;
|
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.ManualFloat'){$ENDIF};
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -3983,7 +3983,7 @@ var
|
|||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
|
|
||||||
DisableAutoSizing;
|
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.ReplaceDockedControl'){$ENDIF};
|
||||||
OldDockSite := Control.HostDockSite;
|
OldDockSite := Control.HostDockSite;
|
||||||
if (OldDockSite<>nil) and (not HostDockSiteManagerAvailable(OldDockSite)) then
|
if (OldDockSite<>nil) and (not HostDockSiteManagerAvailable(OldDockSite)) then
|
||||||
exit;
|
exit;
|
||||||
@ -3997,7 +3997,7 @@ begin
|
|||||||
OldDockSite.DockManager.SetReplacingControl(nil);
|
OldDockSite.DockManager.SetReplacingControl(nil);
|
||||||
end;
|
end;
|
||||||
Result:=Control.ManualDock(NewDockSite,DropControl,ControlSide);
|
Result:=Control.ManualDock(NewDockSite,DropControl,ControlSide);
|
||||||
EnableAutoSizing;
|
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.ReplaceDockedControl'){$ENDIF};
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TControl.AddHandlerOnResize(const OnResizeEvent: TNotifyEvent;
|
procedure TControl.AddHandlerOnResize(const OnResizeEvent: TNotifyEvent;
|
||||||
@ -4890,11 +4890,11 @@ begin
|
|||||||
if FBiDiMode=AValue then exit;
|
if FBiDiMode=AValue then exit;
|
||||||
FBiDiMode:=AValue;
|
FBiDiMode:=AValue;
|
||||||
FParentBiDiMode := False;
|
FParentBiDiMode := False;
|
||||||
DisableAutoSizing;
|
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.SetBiDiMode'){$ENDIF};
|
||||||
try
|
try
|
||||||
Perform(CM_BIDIMODECHANGED, 0, 0); // see TWinControl.CMBiDiModeChanged
|
Perform(CM_BIDIMODECHANGED, 0, 0); // see TWinControl.CMBiDiModeChanged
|
||||||
finally
|
finally
|
||||||
EnableAutoSizing;
|
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.SetBiDiMode'){$ENDIF};
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ var
|
|||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
Form := TForm(TForm.NewInstance);
|
Form := TForm(TForm.NewInstance);
|
||||||
Form.DisableAutoSizing;
|
Form.DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('ShowInputDialog'){$ENDIF};
|
||||||
Form.CreateNew(nil, 0);
|
Form.CreateNew(nil, 0);
|
||||||
with Form do
|
with Form do
|
||||||
begin
|
begin
|
||||||
@ -93,7 +93,7 @@ begin
|
|||||||
|
|
||||||
// upon show, the edit control will be focused for editing, because it's
|
// upon show, the edit control will be focused for editing, because it's
|
||||||
// the first in the tab order
|
// the first in the tab order
|
||||||
Form.EnableAutoSizing;
|
Form.EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('ShowInputDialog'){$ENDIF};
|
||||||
if ShowModal = mrOk then
|
if ShowModal = mrOk then
|
||||||
begin
|
begin
|
||||||
Value := Edit.Text;
|
Value := Edit.Text;
|
||||||
|
Loading…
Reference in New Issue
Block a user