mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-23 02:19:09 +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 clearMask;
|
||||||
procedure OffsetMousePos(APoint: PQtPoint); virtual;
|
procedure OffsetMousePos(APoint: PQtPoint); virtual;
|
||||||
procedure Update(ARect: PRect = nil); virtual;
|
procedure Update(ARect: PRect = nil); virtual;
|
||||||
|
procedure UpdateRegion(ARgn: QRegionH); virtual;
|
||||||
procedure Repaint(ARect: PRect = nil); virtual;
|
procedure Repaint(ARect: PRect = nil); virtual;
|
||||||
procedure setWindowTitle(Str: PWideString);
|
procedure setWindowTitle(Str: PWideString);
|
||||||
procedure WindowTitle(Str: PWideString);
|
procedure WindowTitle(Str: PWideString);
|
||||||
@ -415,6 +416,7 @@ type
|
|||||||
procedure DestroyNotify(AWidget: TQtWidget); override;
|
procedure DestroyNotify(AWidget: TQtWidget); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure Update(ARect: PRect = nil); override;
|
procedure Update(ARect: PRect = nil); override;
|
||||||
|
procedure UpdateRegion(ARgn: QRegionH); override;
|
||||||
procedure Repaint(ARect: PRect = nil); override;
|
procedure Repaint(ARect: PRect = nil); override;
|
||||||
property ScrollBarPolicy[AIndex: Boolean]: QtScrollBarPolicy read getScrollBarsPolicy write setScrollBarPolicy;
|
property ScrollBarPolicy[AIndex: Boolean]: QtScrollBarPolicy read getScrollBarsPolicy write setScrollBarPolicy;
|
||||||
end;
|
end;
|
||||||
@ -3511,6 +3513,14 @@ begin
|
|||||||
QWidget_update(Widget);
|
QWidget_update(Widget);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TQtWidget.UpdateRegion(ARgn: QRegionH);
|
||||||
|
begin
|
||||||
|
if ARgn <> nil then
|
||||||
|
QWidget_update(Widget, ARgn)
|
||||||
|
else
|
||||||
|
QWidget_update(Widget);
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Function: TQtWidget.Repaint
|
Function: TQtWidget.Repaint
|
||||||
Params: None
|
Params: None
|
||||||
@ -12522,6 +12532,14 @@ begin
|
|||||||
QWidget_update(viewportWidget);
|
QWidget_update(viewportWidget);
|
||||||
end;
|
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);
|
procedure TQtAbstractScrollArea.Repaint(ARect: PRect);
|
||||||
var
|
var
|
||||||
P: TPoint;
|
P: TPoint;
|
||||||
|
@ -4614,9 +4614,10 @@ end;
|
|||||||
function TQtWidgetSet.InvalidateRect(aHandle: HWND; Rect: pRect; bErase: Boolean): Boolean;
|
function TQtWidgetSet.InvalidateRect(aHandle: HWND; Rect: pRect; bErase: Boolean): Boolean;
|
||||||
begin
|
begin
|
||||||
{$ifdef VerboseQtWinAPI}
|
{$ifdef VerboseQtWinAPI}
|
||||||
WriteLn('[WinAPI Invalidate Rect]');
|
WriteLn('[WinAPI InvalidateRect]');
|
||||||
{$endif}
|
{$endif}
|
||||||
|
if AHandle = 0 then
|
||||||
|
exit(False);
|
||||||
if Rect <> nil then
|
if Rect <> nil then
|
||||||
begin
|
begin
|
||||||
with TQtWidget(aHandle).getClientOffset do
|
with TQtWidget(aHandle).getClientOffset do
|
||||||
@ -4629,6 +4630,28 @@ begin
|
|||||||
Result := True;
|
Result := True;
|
||||||
end;
|
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
|
Procedure: LeaveCriticalSection
|
||||||
Params: var CritSection: TCriticalSection
|
Params: var CritSection: TCriticalSection
|
||||||
|
@ -146,6 +146,7 @@ function GradientFill(DC: HDC; Vertices: PTriVertex; NumVertices : Longint;
|
|||||||
function HideCaret(hWnd: HWND): Boolean; override;
|
function HideCaret(hWnd: HWND): Boolean; override;
|
||||||
|
|
||||||
function InvalidateRect(aHandle : HWND; Rect : pRect; bErase : Boolean) : 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;
|
procedure InitializeCriticalSection(var CritSection: TCriticalSection); override;
|
||||||
function IntersectClipRect(dc: hdc; Left, Top, Right, Bottom: Integer): Integer; override;
|
function IntersectClipRect(dc: hdc; Left, Top, Right, Bottom: Integer): Integer; override;
|
||||||
function IsIconic(Handle: HWND): boolean; override;
|
function IsIconic(Handle: HWND): boolean; override;
|
||||||
|
Loading…
Reference in New Issue
Block a user