mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 16:37:49 +02:00
cocoa: update interface ClientToScreen api call to recognize clientOffset for non-composite controls. todo: ScreenToClient must be updated accordingly
git-svn-id: trunk@58704 -
This commit is contained in:
parent
1877bd1e5c
commit
728361e306
@ -94,12 +94,27 @@ begin
|
||||
end;
|
||||
|
||||
function TCocoaWidgetSet.ClientToScreen(Handle: HWND; var P: TPoint): Boolean;
|
||||
var
|
||||
r : NSRect;
|
||||
cl : NSView;
|
||||
clr : TRect;
|
||||
begin
|
||||
Result := Handle <> 0;
|
||||
|
||||
if Result then
|
||||
begin
|
||||
// must use lclContentView! - it's client view
|
||||
NSObject(Handle).lclContentView.lclLocalToScreen(P.X, P.Y);
|
||||
cl := NSObject(Handle).lclContentView;
|
||||
if HWND(cl) = Handle then
|
||||
begin
|
||||
// if Handle is lclContentView, then we should check clientRect
|
||||
// (i.e. TabControl doesn't have lclContentView, yet its clientRect is adjusted)
|
||||
clr := NSObject(Handle).lclClientFrame;
|
||||
P.X := P.X + clr.Left;
|
||||
P.Y := P.Y + clr.Top;
|
||||
end;
|
||||
cl.lclLocalToScreen(P.X, P.Y);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCocoaWidgetSet.CallDefaultWndHandler(Sender: TObject; var Message);
|
||||
|
Loading…
Reference in New Issue
Block a user