mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 04:18:48 +02:00
LCL: Fixes to SetCursor (Windows) for tabbed controls, one part of issue #14336
git-svn-id: trunk@21214 -
This commit is contained in:
parent
7dbec45e6d
commit
edaea50d9b
@ -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]);
|
||||
|
Loading…
Reference in New Issue
Block a user