LCL: TWinControl.ClientRectNeedsInterfaceUpdate: consider LCL-interface difference in size

git-svn-id: trunk@24915 -
This commit is contained in:
mattias 2010-04-25 14:29:58 +00:00
parent 51476f192e
commit 9d8521dfe8

View File

@ -3700,6 +3700,7 @@ end;
-------------------------------------------------------------------------------}
function TWinControl.ClientRectNeedsInterfaceUpdate: boolean;
var
InterfaceWidth, InterfaceHeight: integer;
IntfClientRect: TRect;
begin
if (not HandleAllocated) or (csDestroyingHandle in ControlState)
@ -3708,9 +3709,18 @@ begin
exit(false);
if wcfClientRectNeedsUpdate in FWinControlFlags then
exit(true);
// get the current interface bounds
LCLIntf.GetWindowSize(Handle,InterfaceWidth,InterfaceHeight);
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)
or (FClientHeight<>IntfClientRect.Bottom);
if Result then
Include(FWinControlFlags,wcfClientRectNeedsUpdate);
end;
{-------------------------------------------------------------------------------