LCL: Fixes to SetCursor (Windows) for tabbed controls, one part of issue #14336

git-svn-id: trunk@21214 -
This commit is contained in:
martin 2009-08-13 10:33:26 +00:00
parent 7dbec45e6d
commit edaea50d9b

View File

@ -476,6 +476,7 @@ class procedure TWin32WSWinControl.SetCursor(const AWinControl: TWinControl;
var
P: TPoint;
lControl: TControl;
BoundsOffset: TRect;
begin
// in win32 controls have no cursor property. they can change their cursor
// by listening WM_SETCURSOR and adjusting global cursor
@ -493,8 +494,17 @@ begin
then
exit;
lControl := AWinControl.ControlAtPos(P, [capfOnlyClientAreas,
// BoundsOffset also corrects for tabbed controls
// -capfHasScrollOffset only corrects scrolled controls
if GetLCLClientBoundsOffset(aWinControl, BoundsOffset) then
begin
Dec(P.X, BoundsOffset.Left);
Dec(P.Y, BoundsOffset.Top);
end;
lControl := AWinControl.ControlAtPos(P, [capfOnlyClientAreas, capfHasScrollOffset,
capfAllowWinControls, capfRecursive]);
if (lControl = nil) then
lControl := AWinControl;
Windows.SetCursor(Screen.Cursors[lControl.Cursor]);