mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-03 17:00:19 +02:00
lcl: formatting
git-svn-id: trunk@30045 -
This commit is contained in:
parent
98c49e3bfb
commit
2bd0c336c8
@ -4922,7 +4922,7 @@ begin
|
|||||||
DebugLn('[TControl.WMMove] Name=',Name,':',ClassName,' Message.XPos=',DbgS(Message.XPos),' Message.YPos=',DbgS(Message.YPos),' OldLeft=',DbgS(Left),' OldTop=',DbgS(Top));
|
DebugLn('[TControl.WMMove] Name=',Name,':',ClassName,' Message.XPos=',DbgS(Message.XPos),' Message.YPos=',DbgS(Message.YPos),' OldLeft=',DbgS(Left),' OldTop=',DbgS(Top));
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
// Just sync the coordinates
|
// Just sync the coordinates
|
||||||
if Parent<>nil then
|
if Assigned(Parent) then
|
||||||
SetBoundsKeepBase(Message.XPos, Message.YPos, Width, Height)
|
SetBoundsKeepBase(Message.XPos, Message.YPos, Width, Height)
|
||||||
else
|
else
|
||||||
SetBounds(Message.XPos, Message.YPos, Width, Height);
|
SetBounds(Message.XPos, Message.YPos, Width, Height);
|
||||||
|
@ -570,7 +570,7 @@ end;
|
|||||||
|
|
||||||
procedure TCustomForm.DoShowWindow;
|
procedure TCustomForm.DoShowWindow;
|
||||||
begin
|
begin
|
||||||
if (ActiveControl = nil) and (not (csDesigning in ComponentState)) and (Parent=nil) then
|
if (ActiveControl = nil) and (not (csDesigning in ComponentState)) and (Parent = nil) then
|
||||||
begin
|
begin
|
||||||
// automatically choose a control to focus
|
// automatically choose a control to focus
|
||||||
{$IFDEF VerboseFocus}
|
{$IFDEF VerboseFocus}
|
||||||
@ -632,14 +632,14 @@ begin
|
|||||||
DebugLn(['[TCustomForm.WMSize] ',DbgSName(Self),' Message.SizeType=',Message.SizeType,' Message.Width=',Message.Width,' Message.Height=',Message.Height,' AutoSizeDelayed=',AutoSizeDelayed]);
|
DebugLn(['[TCustomForm.WMSize] ',DbgSName(Self),' Message.SizeType=',Message.SizeType,' Message.Width=',Message.Width,' Message.Height=',Message.Height,' AutoSizeDelayed=',AutoSizeDelayed]);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
if (Parent=nil) and ((Message.SizeType and SIZE_SourceIsInterface)>0) then
|
if (Parent = nil) and ((Message.SizeType and SIZE_SourceIsInterface) > 0) then
|
||||||
begin
|
begin
|
||||||
// this is a top level form (constraints depend on window manager)
|
// this is a top level form (constraints depend on window manager)
|
||||||
// and the widgetset set a size
|
// and the widgetset set a size
|
||||||
if (Message.Width<>Width) or (Message.Height<>Height) then
|
if (Message.Width <> Width) or (Message.Height <> Height) then
|
||||||
begin
|
begin
|
||||||
// the window manager sets another size => disable autosize to prevent endless loop
|
// the window manager sets another size => disable autosize to prevent endless loop
|
||||||
Include(FFormState,fsDisableAutoSize);
|
Include(FFormState, fsDisableAutoSize);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -689,12 +689,11 @@ end;
|
|||||||
|
|
||||||
procedure TCustomForm.WMWindowPosChanged(var Message: TLMWindowPosChanged);
|
procedure TCustomForm.WMWindowPosChanged(var Message: TLMWindowPosChanged);
|
||||||
begin
|
begin
|
||||||
if (Parent=nil) and (Message.WindowPos<>nil)
|
if (Parent = nil) and Assigned(Message.WindowPos) and ((Message.WindowPos^.flags and SWP_SourceIsInterface)>0) then
|
||||||
and ((Message.WindowPos^.flags and SWP_SourceIsInterface)>0)
|
begin
|
||||||
then begin
|
|
||||||
// this is a top level form (constraints depend on window manager)
|
// this is a top level form (constraints depend on window manager)
|
||||||
// and the widgetset set a size
|
// and the widgetset set a size
|
||||||
if (Message.WindowPos^.cx<>Width) or (Message.WindowPos^.cy<>Height) then
|
if (Message.WindowPos^.cx <> Width) or (Message.WindowPos^.cy <> Height) then
|
||||||
begin
|
begin
|
||||||
// the window manager sets another size => disable autosize to prevent endless loop
|
// the window manager sets another size => disable autosize to prevent endless loop
|
||||||
Include(FFormState,fsDisableAutoSize);
|
Include(FFormState,fsDisableAutoSize);
|
||||||
@ -1091,13 +1090,14 @@ var
|
|||||||
begin
|
begin
|
||||||
inherited CalculatePreferredSize(PreferredWidth, PreferredHeight,
|
inherited CalculatePreferredSize(PreferredWidth, PreferredHeight,
|
||||||
WithThemeSpace);
|
WithThemeSpace);
|
||||||
if (Parent=nil) and (Anchors*[akRight,akBottom]<>[]) then begin
|
if (Parent = nil) and (Anchors * [akRight, akBottom] <> []) then
|
||||||
|
begin
|
||||||
// do size bigger than the monitor workarea
|
// do size bigger than the monitor workarea
|
||||||
WorkArea:=Monitor.WorkareaRect;
|
WorkArea := Monitor.WorkareaRect;
|
||||||
if akRight in Anchors then
|
if akRight in Anchors then
|
||||||
PreferredWidth:=min(PreferredWidth,WorkArea.Right-WorkArea.Left);
|
PreferredWidth := min(PreferredWidth, WorkArea.Right - WorkArea.Left);
|
||||||
if akBottom in Anchors then
|
if akBottom in Anchors then
|
||||||
PreferredHeight:=min(PreferredHeight,WorkArea.Bottom-WorkArea.Top);
|
PreferredHeight := min(PreferredHeight, WorkArea.Bottom - WorkArea.Top);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -6680,14 +6680,12 @@ begin
|
|||||||
if CompareRect(@NewBoundsRealized,@FBoundsRealized) then exit;
|
if CompareRect(@NewBoundsRealized,@FBoundsRealized) then exit;
|
||||||
|
|
||||||
TopParent:=GetTopParent;
|
TopParent:=GetTopParent;
|
||||||
if (TopParent is TWinControl)
|
if (TopParent is TWinControl) and (wcfKillIntfSetBounds in TWinControl(TopParent).FWinControlFlags) then
|
||||||
and (wcfKillIntfSetBounds in TWinControl(TopParent).FWinControlFlags)
|
|
||||||
then
|
|
||||||
RaiseLoop;
|
RaiseLoop;
|
||||||
|
|
||||||
FBoundsRealized := NewBoundsRealized;
|
FBoundsRealized := NewBoundsRealized;
|
||||||
if ([caspCreatingHandles,caspComputingBounds]*AutoSizePhases<>[])
|
if ([caspCreatingHandles,caspComputingBounds]*AutoSizePhases<>[]) then
|
||||||
then begin
|
begin
|
||||||
// while the LCL is creating handles the widgetset may send default bounds
|
// while the LCL is creating handles the widgetset may send default bounds
|
||||||
// we have not yet told the widgetset the final bounds
|
// we have not yet told the widgetset the final bounds
|
||||||
// => the InvalidatePreferredSize and the InvalidateClientRectCache
|
// => the InvalidatePreferredSize and the InvalidateClientRectCache
|
||||||
@ -6699,7 +6697,7 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if Parent<>nil then
|
if Assigned(Parent) then
|
||||||
SetBoundsKeepBase(Message.XPos, Message.YPos, NewWidth, NewHeight)
|
SetBoundsKeepBase(Message.XPos, Message.YPos, NewWidth, NewHeight)
|
||||||
else
|
else
|
||||||
SetBounds(Message.XPos, Message.YPos, NewWidth, NewHeight);
|
SetBounds(Message.XPos, Message.YPos, NewWidth, NewHeight);
|
||||||
|
Loading…
Reference in New Issue
Block a user