mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 21:59:16 +02:00
Cocoa: Cursor compatible with TGraphicControl
This commit is contained in:
parent
cbd7579c15
commit
e277fcd78b
@ -1866,6 +1866,22 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function getWinControlAtMouse(): TControl;
|
||||||
|
begin
|
||||||
|
Result:= Application.GetControlAtMouse;
|
||||||
|
if not Assigned(Result) then
|
||||||
|
exit;
|
||||||
|
|
||||||
|
// find TWinControl (not TGraphicControl)
|
||||||
|
// see also TControl.SetTempCursor()
|
||||||
|
while not (Result is TWinControl) do
|
||||||
|
begin
|
||||||
|
Result:= Result.Parent;
|
||||||
|
if not Assigned(Result) then
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
class procedure TCocoaWSWinControl.SetCursor(const AWinControl: TWinControl;
|
class procedure TCocoaWSWinControl.SetCursor(const AWinControl: TWinControl;
|
||||||
const ACursor: HCursor);
|
const ACursor: HCursor);
|
||||||
var
|
var
|
||||||
@ -1883,7 +1899,7 @@ begin
|
|||||||
// after clicking the Button.
|
// after clicking the Button.
|
||||||
if not ((AWinControl is TCustomForm) and (csDesigning in AWinControl.ComponentState)) then
|
if not ((AWinControl is TCustomForm) and (csDesigning in AWinControl.ComponentState)) then
|
||||||
begin
|
begin
|
||||||
control:= Application.GetControlAtMouse;
|
control:= getWinControlAtMouse;
|
||||||
if control<>AWinControl then
|
if control<>AWinControl then
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user