mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 01:29:08 +02:00
Gtk3: implemented TGtk3WidgetSet.PaintRgn().
This commit is contained in:
parent
98f5b86bb3
commit
7a1413e616
@ -3179,11 +3179,27 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TGtk3WidgetSet.PaintRgn(DC: HDC; RGN: HRGN): Boolean;
|
function TGtk3WidgetSet.PaintRgn(DC: HDC; RGN: HRGN): Boolean;
|
||||||
|
var
|
||||||
|
GtkDC: TGtk3DeviceContext absolute DC;
|
||||||
|
crRegion: Pcairo_region_t;
|
||||||
|
i: Integer;
|
||||||
|
R: Tcairo_rectangle_int_t;
|
||||||
begin
|
begin
|
||||||
{$IFDEF GTK3DEBUGNOTIMPLEMENTED}
|
Result := False;
|
||||||
DebugLn('WARNING: TGtk3WidgetSet.PaintRgn not implemented ...');
|
if not IsValidDC(DC) then
|
||||||
{$ENDIF}
|
exit;
|
||||||
Result:=inherited PaintRgn(DC, RGN);
|
if not IsValidGDIObject(RGN) then
|
||||||
|
exit;
|
||||||
|
crRegion := TGtk3Region(RGN).Handle;
|
||||||
|
if crRegion = nil then
|
||||||
|
exit;
|
||||||
|
|
||||||
|
for i := 0 to cairo_region_num_rectangles(crRegion) - 1 do
|
||||||
|
begin
|
||||||
|
cairo_region_get_rectangle(crRegion, i, @R);
|
||||||
|
GtkDC.fillRect(R.x, R.y, R.Width, R.Height, HBRUSH(GtkDC.CurrentBrush));
|
||||||
|
end;
|
||||||
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TGtk3WidgetSet.PeekMessage(var lpMsg: TMsg; Handle: HWND;
|
function TGtk3WidgetSet.PeekMessage(var lpMsg: TMsg; Handle: HWND;
|
||||||
|
Loading…
Reference in New Issue
Block a user