mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-05 22:01:46 +02:00
gtk: implement SetWindowRgn based on patch of Massimo Magnano (issue #0015870)
git-svn-id: trunk@24006 -
This commit is contained in:
parent
e513f0292c
commit
edc0a237f0
@ -9619,6 +9619,30 @@ begin
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Function SetWindowRgn
|
||||
Params: hWnd: HWND; hRgn: HRGN; bRedraw: Boolean
|
||||
Returns: 0 - fails, in other case success
|
||||
------------------------------------------------------------------------------}
|
||||
function TGtkWidgetSet.SetWindowRgn(hWnd: HWND; hRgn: HRGN; bRedraw: Boolean): longint;
|
||||
var
|
||||
Widget: PGtkWidget;
|
||||
Window: PGdkWindow;
|
||||
begin
|
||||
Widget := GetFixedWidget(PGtkWidget(hWnd));
|
||||
if Widget = nil then
|
||||
Widget := PGtkWidget(hWnd);
|
||||
if Widget = nil then
|
||||
Exit(0);
|
||||
Window := GetControlWindow(Widget);
|
||||
if Window = nil then
|
||||
Exit(0);
|
||||
gdk_window_shape_combine_region(Window, PGDIObject(hRgn)^.GDIRegionObject, 0, 0);
|
||||
if bRedraw then
|
||||
gdk_window_invalidate_region(Window, PGDIObject(hRgn)^.GDIRegionObject, True);
|
||||
Result := 1;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Function: ShowCaret
|
||||
Params: none
|
||||
|
@ -205,6 +205,7 @@ function SetWindowLong(Handle: HWND; Idx: Integer; NewLong: PtrInt): PtrInt; ove
|
||||
function SetWindowOrgEx(dc : hdc; NewX, NewY : Integer; OldPoint: PPoint) : Boolean; override;
|
||||
function SetWindowPos(hWnd: HWND; hWndInsertAfter: HWND;
|
||||
X, Y, cx, cy: Integer; uFlags: UINT): Boolean; override;
|
||||
function SetWindowRgn(hWnd: HWND; hRgn: HRGN; bRedraw: Boolean): longint; override;
|
||||
function ShowCaret(hWnd: HWND): Boolean; override;
|
||||
function ShowScrollBar(Handle: HWND; wBar: Integer; bShow: Boolean): Boolean; override;
|
||||
function ShowWindow(hWnd: HWND; nCmdShow: Integer): Boolean; override;
|
||||
|
Loading…
Reference in New Issue
Block a user