LCL, gtk2, Primitive implementation of InvalidateRgn, Normalize Rect before invalidating Rect

git-svn-id: trunk@40670 -
This commit is contained in:
jesus 2013-03-29 20:56:52 +00:00
parent 323e3534d0
commit abc6f21f08
2 changed files with 26 additions and 0 deletions

View File

@ -6246,6 +6246,21 @@ begin
Rect^.Top := 0;//PaintWidget^.Allocation.Y;
Rect^.Right := PaintWidget^.Allocation.Width;
Rect^.Bottom := PaintWidget^.Allocation.Height;
end else
begin
// normalize rect
r := Rect^;
if r.Left>r.Right then
begin
r.Left := r.Right;
r.Right := Rect^.Left;
end;
if r.Top>r.Bottom then
begin
r.Top := r.Bottom;
r.Bottom := Rect^.Top;
end;
Rect := @r;
end;
gdkRect.X := Rect^.Left;
@ -6287,6 +6302,16 @@ begin
GTKAPIWidget_InvalidateCaret(PGTKAPIWidget(Widget));
end;
function TGtk2WidgetSet.InvalidateRgn(Handle: HWND; Rgn: HRGN; Erase: Boolean
): Boolean;
var
R: TRect;
begin
// TODO: use gdk_window_invalidate_region to implement this function
GetRgnBox(Rgn, @R);
InvalidateRect(Handle, @R, Erase);
end;
function TGtk2WidgetSet.IsIconic(handle: HWND): boolean;
var
GtkWindow: PGtkWindow absolute handle;

View File

@ -157,6 +157,7 @@ function GetWindowSize(Handle : hwnd; var Width, Height: integer): boolean; over
procedure InitializeCriticalSection(var CritSection: TCriticalSection); override;
function InvalidateRect(aHandle : HWND; Rect : pRect; bErase : Boolean) : Boolean; override;
function InvalidateRgn(Handle: HWND; Rgn: HRGN; Erase: Boolean): Boolean; override;
function IsIconic(handle: HWND): boolean; override;
function IsWindow(handle: HWND): boolean; override;
function IsWindowEnabled(handle: HWND): boolean; override;