mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-18 19:29:31 +02:00
LCL: Implement a platform independent RectInRegion. Code presented at forum by vcunha.
git-svn-id: trunk@39156 -
This commit is contained in:
parent
7da6d64aa2
commit
ad5eed1a72
@ -1499,6 +1499,24 @@ begin
|
||||
);
|
||||
end;
|
||||
|
||||
// This is found in Windows API but can be implemented in platform independent way.
|
||||
function RectInRegion(RGN: HRGN; ARect: TRect): Boolean;
|
||||
var
|
||||
RectRgn, EmptyRgn: HRGN;
|
||||
begin
|
||||
RectRgn := CreateRectRgnIndirect(ARect);
|
||||
try
|
||||
EmptyRgn := CreateEmptyRegion;
|
||||
try
|
||||
Result := CombineRgn(EmptyRgn, RectRgn, RGN, RGN_AND) <> NULLREGION;
|
||||
finally
|
||||
DeleteObject(EmptyRgn);
|
||||
end;
|
||||
finally
|
||||
DeleteObject(RectRgn);
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Function: RGB
|
||||
Params: R: Red color
|
||||
|
@ -336,6 +336,7 @@ function OffsetRect(var Rect: TRect; dx,dy: Integer): Boolean; inline;
|
||||
function PtInRect(const Rect : TRect; const Point : TPoint) : Boolean; inline;
|
||||
function PointToSmallPoint(const P : TPoint) : TSmallPoint; inline;
|
||||
|
||||
function RectInRegion(RGN: HRGN; ARect: TRect): Boolean;
|
||||
function RGB(R, G, B : Byte) : TColorRef; inline;
|
||||
|
||||
function ScrollWindow(hWnd: HWND; XAmount, YAmount: Integer; Rect, ClipRect: PRect): Boolean; inline;
|
||||
@ -350,7 +351,6 @@ function SubtractRect(out lprcDst: TRect; const lprcSrc1, lprcSrc2: TRect): Bool
|
||||
function UnionRect(var DestRect: TRect; const SrcRect1, SrcRect2: TRect): Boolean; //pbd
|
||||
|
||||
|
||||
|
||||
//##apiwiz##epi## // Do not remove
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user