gtk: implement SetWindowRgn based on patch of Massimo Magnano (issue #0015870)

git-svn-id: trunk@24006 -
This commit is contained in:
paul 2010-03-15 08:26:05 +00:00
parent e513f0292c
commit edc0a237f0
2 changed files with 25 additions and 0 deletions

View File

@ -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

View File

@ -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;