mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 13:59:20 +02:00
LCL: TWinControl.ClientRectNeedsInterfaceUpdate: consider LCL-interface difference in size
git-svn-id: trunk@24915 -
This commit is contained in:
parent
51476f192e
commit
9d8521dfe8
@ -3700,6 +3700,7 @@ end;
|
|||||||
-------------------------------------------------------------------------------}
|
-------------------------------------------------------------------------------}
|
||||||
function TWinControl.ClientRectNeedsInterfaceUpdate: boolean;
|
function TWinControl.ClientRectNeedsInterfaceUpdate: boolean;
|
||||||
var
|
var
|
||||||
|
InterfaceWidth, InterfaceHeight: integer;
|
||||||
IntfClientRect: TRect;
|
IntfClientRect: TRect;
|
||||||
begin
|
begin
|
||||||
if (not HandleAllocated) or (csDestroyingHandle in ControlState)
|
if (not HandleAllocated) or (csDestroyingHandle in ControlState)
|
||||||
@ -3708,9 +3709,18 @@ begin
|
|||||||
exit(false);
|
exit(false);
|
||||||
if wcfClientRectNeedsUpdate in FWinControlFlags then
|
if wcfClientRectNeedsUpdate in FWinControlFlags then
|
||||||
exit(true);
|
exit(true);
|
||||||
|
// get the current interface bounds
|
||||||
|
LCLIntf.GetWindowSize(Handle,InterfaceWidth,InterfaceHeight);
|
||||||
LCLIntf.GetClientRect(Handle,IntfClientRect);
|
LCLIntf.GetClientRect(Handle,IntfClientRect);
|
||||||
|
// The LCL is not always in sync with the interface.
|
||||||
|
// Add the difference between LCL size and interface size to the
|
||||||
|
// interface clientrect
|
||||||
|
inc(IntfClientRect.Right,Width-InterfaceWidth);
|
||||||
|
inc(IntfClientRect.Bottom,Height-InterfaceHeight);
|
||||||
Result:=(FClientWidth<>IntfClientRect.Right)
|
Result:=(FClientWidth<>IntfClientRect.Right)
|
||||||
or (FClientHeight<>IntfClientRect.Bottom);
|
or (FClientHeight<>IntfClientRect.Bottom);
|
||||||
|
if Result then
|
||||||
|
Include(FWinControlFlags,wcfClientRectNeedsUpdate);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{-------------------------------------------------------------------------------
|
{-------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user