mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 18:59:21 +02:00
customdrawnws: Minor adjustments and improvements, adds a temporary work around to see something in the screen on Rectangle drawing while there isnt yet a proper Pen and Brush
git-svn-id: trunk@33672 -
This commit is contained in:
parent
ca8736cbb4
commit
2488c66a69
@ -30,6 +30,7 @@ interface
|
|||||||
uses
|
uses
|
||||||
// RTL
|
// RTL
|
||||||
Types, Classes, SysUtils, Math,
|
Types, Classes, SysUtils, Math,
|
||||||
|
fpimage, fpcanvas,
|
||||||
{$ifdef CD_Windows}Windows, WinProc,{$endif}
|
{$ifdef CD_Windows}Windows, WinProc,{$endif}
|
||||||
{$ifdef CD_Cocoa}MacOSAll, CocoaAll,{$endif}
|
{$ifdef CD_Cocoa}MacOSAll, CocoaAll,{$endif}
|
||||||
{$ifdef CD_X11}X, XLib, XUtil, {unitxft, Xft font support}{$endif}
|
{$ifdef CD_X11}X, XLib, XUtil, {unitxft, Xft font support}{$endif}
|
||||||
|
@ -4948,6 +4948,7 @@ begin
|
|||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
//if not IsValidDC(DC) then Exit(False);
|
//if not IsValidDC(DC) then Exit(False);
|
||||||
|
LazDC.Brush.FPColor := colWhite;
|
||||||
LazDC.Rectangle(X1, Y1, X2, Y2);
|
LazDC.Rectangle(X1, Y1, X2, Y2);
|
||||||
{ R := NormalizeRect(Rect(X1, Y1, X2, Y2));
|
{ R := NormalizeRect(Rect(X1, Y1, X2, Y2));
|
||||||
if IsRectEmpty(R) then Exit(True);
|
if IsRectEmpty(R) then Exit(True);
|
||||||
|
@ -292,7 +292,7 @@ Var
|
|||||||
end;
|
end;
|
||||||
if (ControlDC = 0) or not needParentPaint then
|
if (ControlDC = 0) or not needParentPaint then
|
||||||
begin
|
begin
|
||||||
DCIndex := Windows.SaveDC(DC);
|
//DCIndex := Windows.SaveDC(DC);
|
||||||
|
|
||||||
{$ifdef DEBUG_WINDOW_ORG}
|
{$ifdef DEBUG_WINDOW_ORG}
|
||||||
LCLIntf.GetWindowOrgEx(DC, @WindowOrg);
|
LCLIntf.GetWindowOrgEx(DC, @WindowOrg);
|
||||||
@ -301,9 +301,9 @@ Var
|
|||||||
[lWinControl.Name, PaintMsg.DC, WindowOrg.X, WindowOrg.Y, -parLeft, -parTop]));
|
[lWinControl.Name, PaintMsg.DC, WindowOrg.X, WindowOrg.Y, -parLeft, -parTop]));
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
MoveWindowOrgEx(DC, ORect.Left, ORect.Top);
|
//MoveWindowOrgEx(DC, ORect.Left, ORect.Top); <- substitute with a non-native window org change
|
||||||
DeliverMessage(lWinControl, PaintMsg);
|
DeliverMessage(lWinControl, PaintMsg);
|
||||||
Windows.RestoreDC(DC, DCIndex);
|
//Windows.RestoreDC(DC, DCIndex);
|
||||||
|
|
||||||
{$ifdef DEBUG_WINDOW_ORG}
|
{$ifdef DEBUG_WINDOW_ORG}
|
||||||
LCLIntf.GetWindowOrgEx(DC, @WindowOrg);
|
LCLIntf.GetWindowOrgEx(DC, @WindowOrg);
|
||||||
@ -313,6 +313,7 @@ Var
|
|||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// Now convert the rawimage to a HBITMAP and draw it to the screen
|
||||||
WindowInfo^.Image.GetRawImage(lRawImage);
|
WindowInfo^.Image.GetRawImage(lRawImage);
|
||||||
WinProc_RawImage_CreateBitmaps(lRawImage, lBitmap, lMask, True);
|
WinProc_RawImage_CreateBitmaps(lRawImage, lBitmap, lMask, True);
|
||||||
Windows.SelectObject(WindowInfo^.BitmapDC, lBitmap);
|
Windows.SelectObject(WindowInfo^.BitmapDC, lBitmap);
|
||||||
|
Loading…
Reference in New Issue
Block a user