mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 20:59:12 +02:00
Qt: added winapi function PtInRegion(), added containsPoint(), containsRect() to TQtRegion.
git-svn-id: trunk@17357 -
This commit is contained in:
parent
dad49bfaff
commit
ee19b1a320
@ -248,6 +248,8 @@ type
|
|||||||
constructor Create(CreateHandle: Boolean; Poly: QPolygonH;
|
constructor Create(CreateHandle: Boolean; Poly: QPolygonH;
|
||||||
Const Fill: QtFillRule = QtWindingFill); virtual; overload;
|
Const Fill: QtFillRule = QtWindingFill); virtual; overload;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
function containsPoint(X,Y: Integer): Boolean;
|
||||||
|
function containsRect(R: TRect): Boolean;
|
||||||
function GetRegionType: integer;
|
function GetRegionType: integer;
|
||||||
function getBoundingRect: TRect;
|
function getBoundingRect: TRect;
|
||||||
end;
|
end;
|
||||||
@ -1609,6 +1611,20 @@ begin
|
|||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TQtRegion.containsPoint(X, Y: Integer): Boolean;
|
||||||
|
var
|
||||||
|
P: TQtPoint;
|
||||||
|
begin
|
||||||
|
P.X := X;
|
||||||
|
P.Y := Y;
|
||||||
|
Result := QRegion_contains(Widget, PQtPoint(@P));
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TQtRegion.containsRect(R: TRect): Boolean;
|
||||||
|
begin
|
||||||
|
Result := QRegion_contains(Widget, PRect(@R));
|
||||||
|
end;
|
||||||
|
|
||||||
function TQtRegion.GetRegionType: integer;
|
function TQtRegion.GetRegionType: integer;
|
||||||
var
|
var
|
||||||
R: TRect;
|
R: TRect;
|
||||||
|
@ -3807,6 +3807,17 @@ begin
|
|||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TQtWidgetSet.PtInRegion(RGN: HRGN; X, Y: Integer): Boolean;
|
||||||
|
begin
|
||||||
|
Result := False;
|
||||||
|
|
||||||
|
if not IsValidGDIObject(RGN) then
|
||||||
|
exit;
|
||||||
|
|
||||||
|
Result := TQtRegion(RGN).containsPoint(X, Y);
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Function: Rectangle
|
Function: Rectangle
|
||||||
Params: DC: HDC; X1, Y1, X2, Y2: Integer
|
Params: DC: HDC; X1, Y1, X2, Y2: Integer
|
||||||
|
@ -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 Polygon(DC: HDC; Points: PPoint; NumPts: Integer; Winding: boolean): boolean; override;
|
||||||
function Polyline(DC: HDC; Points: PPoint; NumPts: Integer): 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 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 Rectangle(DC: HDC; X1, Y1, X2, Y2: Integer): Boolean; override;
|
||||||
function RectVisible(dc : hdc; const ARect: TRect) : Boolean; override;
|
function RectVisible(dc : hdc; const ARect: TRect) : Boolean; override;
|
||||||
|
Loading…
Reference in New Issue
Block a user