You've already forked lazarus-ccr
Finished implementation of MapWindowPoints (the interface in win32 compatible now)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@65 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -7466,7 +7466,7 @@ begin
|
|||||||
if Visible then
|
if Visible then
|
||||||
begin
|
begin
|
||||||
// Create the minimum rectangle to be recaptured.
|
// Create the minimum rectangle to be recaptured.
|
||||||
MapWindowPoints(Tree.Handle, 0, @R.TopLeft, 2);
|
MapWindowPoints(Tree.Handle, 0, R, 2);
|
||||||
DragRect := GetDragImageRect;
|
DragRect := GetDragImageRect;
|
||||||
IntersectRect(R, R, DragRect);
|
IntersectRect(R, R, DragRect);
|
||||||
|
|
||||||
@ -7477,7 +7477,7 @@ begin
|
|||||||
PaintTarget.Y := R.Top - DragRect.Top;
|
PaintTarget.Y := R.Top - DragRect.Top;
|
||||||
|
|
||||||
// The source rectangle is determined by the offsets in the tree.
|
// The source rectangle is determined by the offsets in the tree.
|
||||||
MapWindowPoints(0, Tree.Handle, @R.TopLeft, 2);
|
MapWindowPoints(0, Tree.Handle, R, 2);
|
||||||
OffsetRect(R, -Tree.FOffsetX, -Tree.FOffsetY);
|
OffsetRect(R, -Tree.FOffsetX, -Tree.FOffsetY);
|
||||||
|
|
||||||
// Finally let the tree paint the relevant part and upate the drag image on screen.
|
// Finally let the tree paint the relevant part and upate the drag image on screen.
|
||||||
@ -11193,7 +11193,7 @@ begin
|
|||||||
GetWindowRect(Treeview.Handle, RW);
|
GetWindowRect(Treeview.Handle, RW);
|
||||||
|
|
||||||
// Convert to client coordinates.
|
// Convert to client coordinates.
|
||||||
MapWindowPoints(0, Treeview.Handle, @RW.TopLeft, 2);
|
MapWindowPoints(0, Treeview.Handle, RW, 2);
|
||||||
|
|
||||||
// Consider the header within this rectangle.
|
// Consider the header within this rectangle.
|
||||||
OffsetRect(R, RW.Left, RW.Top);
|
OffsetRect(R, RW.Left, RW.Top);
|
||||||
@ -11239,7 +11239,7 @@ begin
|
|||||||
OffsetRect(R, RW.Left, RW.Top);
|
OffsetRect(R, RW.Left, RW.Top);
|
||||||
|
|
||||||
// Expressed in client coordinates (because RedrawWindow wants them so, they will actually become negative).
|
// Expressed in client coordinates (because RedrawWindow wants them so, they will actually become negative).
|
||||||
MapWindowPoints(0, Handle, @R.TopLeft, 2);
|
MapWindowPoints(0, Handle, R, 2);
|
||||||
RedrawWindow(Handle, @R, 0, RDW_FRAME or RDW_INVALIDATE or RDW_VALIDATE or RDW_NOINTERNALPAINT or
|
RedrawWindow(Handle, @R, 0, RDW_FRAME or RDW_INVALIDATE or RDW_VALIDATE or RDW_NOINTERNALPAINT or
|
||||||
RDW_NOERASE or RDW_NOCHILDREN);
|
RDW_NOERASE or RDW_NOCHILDREN);
|
||||||
end;
|
end;
|
||||||
@ -19681,7 +19681,7 @@ begin
|
|||||||
GetCursorPos(P);
|
GetCursorPos(P);
|
||||||
R := ClientRect;
|
R := ClientRect;
|
||||||
ClipRect := R;
|
ClipRect := R;
|
||||||
MapWindowPoints(Handle, 0, @R.TopLeft, 2);
|
MapWindowPoints(Handle, 0, R, 2);
|
||||||
InRect := PtInRect(R, P);
|
InRect := PtInRect(R, P);
|
||||||
ClientP := ScreenToClient(P);
|
ClientP := ScreenToClient(P);
|
||||||
Panning := [tsWheelPanning, tsWheelScrolling] * FStates <> [];
|
Panning := [tsWheelPanning, tsWheelScrolling] * FStates <> [];
|
||||||
@ -23604,7 +23604,7 @@ begin
|
|||||||
|
|
||||||
// Calculate the screen area not covered by the drag image and which needs an update.
|
// Calculate the screen area not covered by the drag image and which needs an update.
|
||||||
DragRect := Tree.FDragImage.GetDragImageRect;
|
DragRect := Tree.FDragImage.GetDragImageRect;
|
||||||
MapWindowPoints(0, Handle, @DragRect.TopLeft, 2);
|
MapWindowPoints(0, Handle, DragRect, 2);
|
||||||
DragRegion := CreateRectRgnIndirect(DragRect);
|
DragRegion := CreateRectRgnIndirect(DragRect);
|
||||||
|
|
||||||
// Start with non-client area if requested.
|
// Start with non-client area if requested.
|
||||||
@ -23615,7 +23615,7 @@ begin
|
|||||||
// Determine the outer rectangle of the entire tree window.
|
// Determine the outer rectangle of the entire tree window.
|
||||||
GetWindowRect(Handle, NCRect);
|
GetWindowRect(Handle, NCRect);
|
||||||
// Express the tree window rectangle in client coordinates (because RedrawWindow wants them so).
|
// Express the tree window rectangle in client coordinates (because RedrawWindow wants them so).
|
||||||
MapWindowPoints(0, Handle, @NCRect.TopLeft, 2);
|
MapWindowPoints(0, Handle, NCRect, 2);
|
||||||
NCRegion := CreateRectRgnIndirect(NCRect);
|
NCRegion := CreateRectRgnIndirect(NCRect);
|
||||||
// Determine client rect in screen coordinates and create another region for it.
|
// Determine client rect in screen coordinates and create another region for it.
|
||||||
UpdateRegion := CreateRectRgnIndirect(ClientRect);
|
UpdateRegion := CreateRectRgnIndirect(ClientRect);
|
||||||
|
@ -62,23 +62,32 @@ begin
|
|||||||
Failed:=Status and HRESULT($80000000)<>0;
|
Failed:=Status and HRESULT($80000000)<>0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function MapWindowPoints(hWndFrom, hWndTo: HWND; lpPoints: PPoint; cPoints: UINT): Integer;
|
function MapWindowPoints(hWndFrom, hWndTo: HWND; var lpPoints; cPoints: UINT): Integer;
|
||||||
var
|
var
|
||||||
I:integer;
|
I:Integer;
|
||||||
|
XOffset, YOffset: SmallInt;
|
||||||
FromRect,ToRect: TRect;
|
FromRect,ToRect: TRect;
|
||||||
begin
|
begin
|
||||||
Logger.AddCheckPoint(lcDummyFunctions,'MapWiindowsPoints');
|
|
||||||
//todo: implement result
|
|
||||||
GetWindowRect(hWndFrom,FromRect);
|
GetWindowRect(hWndFrom,FromRect);
|
||||||
GetWindowRect(hWndTo,ToRect);
|
GetWindowRect(hWndTo,ToRect);
|
||||||
|
XOffset:=(FromRect.Left - ToRect.Left);
|
||||||
|
YOffset:=(FromRect.Top - ToRect.Top);
|
||||||
for i:=0 to cPoints - 1 do
|
for i:=0 to cPoints - 1 do
|
||||||
begin
|
begin
|
||||||
(lpPoints+i)^.x:=(FromRect.Left - ToRect.Left) + (lpPoints+i)^.x;
|
{
|
||||||
(lpPoints+i)^.y:=(FromRect.Top - ToRect.Top) + (lpPoints+i)^.y;
|
Mode Delphi does not support treating a pointer as a array
|
||||||
|
if ObjFpc is used than this syntax is preferred
|
||||||
|
PPoint(@lpPoints)[i].x:= XOffset + PPoint(@lpPoints)[i].x;
|
||||||
|
PPoint(@lpPoints)[i].y:= YOffset + PPoint(@lpPoints)[i].y;
|
||||||
|
}
|
||||||
|
PPoint(@lpPoints+i)^.x:= XOffset + PPoint(@lpPoints+i)^.x;
|
||||||
|
PPoint(@lpPoints+i)^.y:= YOffset + PPoint(@lpPoints+i)^.y;
|
||||||
end;
|
end;
|
||||||
|
Result:=MakeLong(XOffset,YOffset);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function InvalidateRect(aHandle : HWND; ARect : pRect; bErase : Boolean) : Boolean;
|
function InvalidateRect(aHandle : HWND; ARect : pRect; bErase : Boolean) : Boolean;
|
||||||
begin
|
begin
|
||||||
Logger.EnterMethod(lcPaint,'InvalidateRect');
|
Logger.EnterMethod(lcPaint,'InvalidateRect');
|
||||||
|
Reference in New Issue
Block a user