mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-12 10:39:08 +02:00
Qt: implemented InvalidateRgn() to qt winapi. Added helper routine TQtWidget.UpdateRegion().
git-svn-id: trunk@32489 -
This commit is contained in:
parent
1337735deb
commit
9b4c8b8fb9
@ -201,6 +201,7 @@ type
|
||||
procedure clearMask;
|
||||
procedure OffsetMousePos(APoint: PQtPoint); virtual;
|
||||
procedure Update(ARect: PRect = nil); virtual;
|
||||
procedure UpdateRegion(ARgn: QRegionH); virtual;
|
||||
procedure Repaint(ARect: PRect = nil); virtual;
|
||||
procedure setWindowTitle(Str: PWideString);
|
||||
procedure WindowTitle(Str: PWideString);
|
||||
@ -415,6 +416,7 @@ type
|
||||
procedure DestroyNotify(AWidget: TQtWidget); override;
|
||||
destructor Destroy; override;
|
||||
procedure Update(ARect: PRect = nil); override;
|
||||
procedure UpdateRegion(ARgn: QRegionH); override;
|
||||
procedure Repaint(ARect: PRect = nil); override;
|
||||
property ScrollBarPolicy[AIndex: Boolean]: QtScrollBarPolicy read getScrollBarsPolicy write setScrollBarPolicy;
|
||||
end;
|
||||
@ -3511,6 +3513,14 @@ begin
|
||||
QWidget_update(Widget);
|
||||
end;
|
||||
|
||||
procedure TQtWidget.UpdateRegion(ARgn: QRegionH);
|
||||
begin
|
||||
if ARgn <> nil then
|
||||
QWidget_update(Widget, ARgn)
|
||||
else
|
||||
QWidget_update(Widget);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Function: TQtWidget.Repaint
|
||||
Params: None
|
||||
@ -12522,6 +12532,14 @@ begin
|
||||
QWidget_update(viewportWidget);
|
||||
end;
|
||||
|
||||
procedure TQtAbstractScrollArea.UpdateRegion(ARgn: QRegionH);
|
||||
begin
|
||||
if ARgn <> nil then
|
||||
QWidget_update(viewportWidget, ARgn)
|
||||
else
|
||||
QWidget_update(viewportWidget);
|
||||
end;
|
||||
|
||||
procedure TQtAbstractScrollArea.Repaint(ARect: PRect);
|
||||
var
|
||||
P: TPoint;
|
||||
|
@ -4614,9 +4614,10 @@ end;
|
||||
function TQtWidgetSet.InvalidateRect(aHandle: HWND; Rect: pRect; bErase: Boolean): Boolean;
|
||||
begin
|
||||
{$ifdef VerboseQtWinAPI}
|
||||
WriteLn('[WinAPI Invalidate Rect]');
|
||||
WriteLn('[WinAPI InvalidateRect]');
|
||||
{$endif}
|
||||
|
||||
if AHandle = 0 then
|
||||
exit(False);
|
||||
if Rect <> nil then
|
||||
begin
|
||||
with TQtWidget(aHandle).getClientOffset do
|
||||
@ -4629,6 +4630,28 @@ begin
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Function: InvalidateRgn
|
||||
Params: aHandle:
|
||||
Rect:
|
||||
bErase:
|
||||
Returns: True if invalidate is successfull.
|
||||
Invalidates region of widget.
|
||||
------------------------------------------------------------------------------}
|
||||
function TQtWidgetSet.InvalidateRgn(aHandle: HWND; Rgn: HRGN; Erase: Boolean
|
||||
): Boolean;
|
||||
begin
|
||||
{$ifdef VerboseQtWinAPI}
|
||||
WriteLn('[WinAPI InvalidateRgn]');
|
||||
{$endif}
|
||||
if aHandle = 0 then
|
||||
exit(False);
|
||||
if IsValidGDIObject(Rgn) and (TQtRegion(Rgn).Widget <> nil) then
|
||||
TQtWidget(aHandle).UpdateRegion(TQtRegion(Rgn).Widget)
|
||||
else
|
||||
TQtWidget(aHandle).Update;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Procedure: LeaveCriticalSection
|
||||
Params: var CritSection: TCriticalSection
|
||||
|
@ -146,6 +146,7 @@ function GradientFill(DC: HDC; Vertices: PTriVertex; NumVertices : Longint;
|
||||
function HideCaret(hWnd: HWND): Boolean; override;
|
||||
|
||||
function InvalidateRect(aHandle : HWND; Rect : pRect; bErase : Boolean) : Boolean; override;
|
||||
function InvalidateRgn(aHandle: HWND; Rgn: HRGN; Erase: Boolean): Boolean; override;
|
||||
procedure InitializeCriticalSection(var CritSection: TCriticalSection); override;
|
||||
function IntersectClipRect(dc: hdc; Left, Top, Right, Bottom: Integer): Integer; override;
|
||||
function IsIconic(Handle: HWND): boolean; override;
|
||||
|
Loading…
Reference in New Issue
Block a user