mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 05:15:56 +02:00
implement TWin32WidgetSet.GetDCOriginRelativeToWindow
git-svn-id: trunk@7024 -
This commit is contained in:
parent
09233bbe50
commit
8f6d8166b8
@ -1473,6 +1473,26 @@ begin
|
||||
Result := Windows.GetDC(OverlayWindow);
|
||||
end;
|
||||
|
||||
function TWin32WidgetSet.GetDCOriginRelativeToWindow(PaintDC: HDC;
|
||||
WindowHandle: HWND; var OriginDiff: TPoint): boolean;
|
||||
var
|
||||
DCOrg, winOrg: Windows.POINT;
|
||||
ORect: TRect;
|
||||
begin
|
||||
OriginDiff.X := 0;
|
||||
OriginDiff.Y := 0;
|
||||
Result := Windows.GetDCOrgEx(PaintDC, DCOrg);
|
||||
if not Result then exit;
|
||||
winOrg.X := 0;
|
||||
winOrg.Y := 0;
|
||||
Result := Windows.ClientToScreen(WindowHandle, winOrg);
|
||||
if not Result then exit;
|
||||
Result := GetLCLClientBoundsOffset(WindowHandle, ORect);
|
||||
if not Result then exit;
|
||||
OriginDiff.X := DCOrg.X - winOrg.X - ORect.Left;
|
||||
OriginDiff.Y := DCOrg.Y - winOrg.Y - ORect.Top;
|
||||
end;
|
||||
|
||||
function TWin32WidgetSet.GetDeviceSize(DC: HDC; var P: TPoint): Boolean;
|
||||
var
|
||||
hBitmap: HGDIOBJ;
|
||||
@ -3096,6 +3116,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.140 2005/03/25 16:41:35 micha
|
||||
implement TWin32WidgetSet.GetDCOriginRelativeToWindow
|
||||
|
||||
Revision 1.139 2005/03/14 21:49:41 micha
|
||||
check nil pointer to avoid AV (by jesusrmx)
|
||||
|
||||
|
@ -99,6 +99,7 @@ Function GetDC(HWnd: HWND): HDC; Override;
|
||||
function GetDeviceCaps(DC: HDC; Index: Integer): Integer; Override;
|
||||
function GetDeviceSize(DC: HDC; var P: TPoint): Boolean; Override;
|
||||
function GetDesignerDC(WindowHandle: HWND): HDC; Override;
|
||||
function GetDCOriginRelativeToWindow(PaintDC: HDC; WindowHandle: HWND; var OriginDiff: TPoint): boolean; override;
|
||||
function GetDIBits(DC: HDC; Bitmap: HBitmap; StartScan, NumScans: UINT; Bits: Pointer; var BitInfo: BitmapInfo; Usage: UINT): Integer; Override;
|
||||
function GetBitmapBits(Bitmap: HBITMAP; Count: Longint; Bits: Pointer): Longint; Override;
|
||||
Function GetFocus: HWND; Override;
|
||||
@ -196,6 +197,9 @@ Procedure DeleteCriticalSection(var CritSection: TCriticalSection); Override;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.56 2005/03/25 16:41:35 micha
|
||||
implement TWin32WidgetSet.GetDCOriginRelativeToWindow
|
||||
|
||||
Revision 1.55 2005/03/04 13:50:09 mattias
|
||||
fixed Arc and changed x,y to Left,Top to make meaning more clear
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user