mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-14 03:19:32 +02:00
Cocoa: Fix #40395: TCocoaWidgetSet.PtInRegion() implemented
This commit is contained in:
parent
285d0248e2
commit
2a6fa122d1
@ -2047,6 +2047,34 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: PtInRegion
|
||||
Params: RNG - Handle to region
|
||||
X, Y - Point
|
||||
Returns: If the specified point lies in the region
|
||||
------------------------------------------------------------------------------}
|
||||
function TCocoaWidgetSet.PtInRegion(RGN: HRGN; X, Y: Integer): Boolean;
|
||||
begin
|
||||
Result := False;
|
||||
|
||||
{$IFDEF VerboseWinAPI}
|
||||
DebugLn('TCocoaWidgetSet.PtInRegion RGN: ' + DbgS(RGN), ' X: ', DbgS(X),
|
||||
' Y: ', DbgS(Y));
|
||||
{$ENDIF}
|
||||
|
||||
if not (TObject(RGN) is TCocoaRegion) then
|
||||
begin
|
||||
DebugLn('TCocoaWidgetSet.PtInRegion Error - invalid region ', DbgS(RGN), '!');
|
||||
Exit;
|
||||
end;
|
||||
|
||||
Result := TCocoaRegion(RGN).ContainsPoint(Classes.Point(X, Y));
|
||||
|
||||
{$IFDEF VerboseWinAPI}
|
||||
DebugLn('TCocoaRegion.PtInRegion Result: ' + DbgS(Result));
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
function TCocoaWidgetSet.Rectangle(DC: HDC; X1, Y1, X2, Y2: Integer): Boolean;
|
||||
var
|
||||
ctx: TCocoaContext;
|
||||
|
@ -148,6 +148,7 @@ function PolyBezier(DC: HDC; Points: PPoint; NumPts: Integer; Filled, Continuous
|
||||
function Polygon(DC: HDC; Points: PPoint; NumPts: Integer; Winding: boolean): boolean; override;
|
||||
function Polyline(DC: HDC; Points: PPoint; NumPts: Integer): boolean; override;
|
||||
function PostMessage(Handle: HWND; Msg: Cardinal; wParam: WParam; lParam: LParam): Boolean; override;
|
||||
function PtInRegion(RGN: HRGN; X, Y: Integer): Boolean; override;
|
||||
|
||||
function Rectangle(DC: HDC; X1, Y1, X2, Y2: Integer): Boolean; override;
|
||||
function RectVisible(dc : hdc; const ARect: TRect) : Boolean; override;
|
||||
|
Loading…
Reference in New Issue
Block a user