mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 03:56:12 +02:00
Qt: More winapi & TQtWidget routines implemented.
git-svn-id: trunk@12236 -
This commit is contained in:
parent
60d708414c
commit
5bdb68667e
@ -151,6 +151,8 @@ type
|
|||||||
function getGeometry: TRect; virtual;
|
function getGeometry: TRect; virtual;
|
||||||
function getVisible: Boolean; virtual;
|
function getVisible: Boolean; virtual;
|
||||||
function getText: WideString; virtual;
|
function getText: WideString; virtual;
|
||||||
|
function getHeight: Integer;
|
||||||
|
function getWidth: Integer;
|
||||||
procedure grabMouse; virtual;
|
procedure grabMouse; virtual;
|
||||||
function hasFocus: Boolean; virtual;
|
function hasFocus: Boolean; virtual;
|
||||||
procedure lowerWidget;
|
procedure lowerWidget;
|
||||||
@ -2264,6 +2266,16 @@ begin
|
|||||||
Result := FText;
|
Result := FText;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TQtWidget.getHeight: Integer;
|
||||||
|
begin
|
||||||
|
Result := QWidget_height(Widget);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TQtWidget.getWidth: Integer;
|
||||||
|
begin
|
||||||
|
Result := QWidget_width(Widget);
|
||||||
|
end;
|
||||||
|
|
||||||
function TQtWidget.getClientBounds: TRect;
|
function TQtWidget.getClientBounds: TRect;
|
||||||
begin
|
begin
|
||||||
QWidget_contentsRect(Widget, @Result);
|
QWidget_contentsRect(Widget, @Result);
|
||||||
|
@ -2334,19 +2334,67 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TQtWidgetSet.GetScrollBarSize(Handle: HWND; BarKind: Integer): integer;
|
function TQtWidgetSet.GetScrollBarSize(Handle: HWND; BarKind: Integer): integer;
|
||||||
|
var
|
||||||
|
w: TQtWidget;
|
||||||
|
ScrollBar: TQtScrollBar;
|
||||||
begin
|
begin
|
||||||
Result := 15;
|
{$ifdef VerboseQtWinAPI}
|
||||||
{$ifdef VerboseQtWinAPI_MISSING_IMPLEMENTATION}
|
writeln('Trace:> [WinAPI GetScrollBarSize] Handle: ' + dbghex(Handle),' BarKind: ',BarKind);
|
||||||
WriteLn('***** [WinAPI TQtWidgetSet.GetScrollBarSize] missing implementation ');
|
|
||||||
{$endif}
|
{$endif}
|
||||||
|
Result := 0;
|
||||||
|
if Handle = 0 then exit;
|
||||||
|
|
||||||
|
w := TQtWidget(Handle);
|
||||||
|
|
||||||
|
{TODO: find out what to do with TCustomForm descendants }
|
||||||
|
if w is TQtAbstractScrollArea then
|
||||||
|
begin
|
||||||
|
if BarKind = SM_CYVSCROLL then
|
||||||
|
ScrollBar := TQtAbstractScrollArea(w).verticalScrollBar
|
||||||
|
else
|
||||||
|
ScrollBar := TQtAbstractScrollArea(w).horizontalScrollBar;
|
||||||
|
end else
|
||||||
|
if w is TQtScrollBar then
|
||||||
|
ScrollBar := TQtScrollBar(w)
|
||||||
|
else
|
||||||
|
ScrollBar := nil;
|
||||||
|
if ScrollBar <> nil then
|
||||||
|
begin
|
||||||
|
if BarKind = SM_CYVSCROLL then
|
||||||
|
Result := ScrollBar.getWidth
|
||||||
|
else
|
||||||
|
Result := ScrollBar.getHeight;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TQtWidgetSet.GetScrollbarVisible(Handle: HWND; SBStyle: Integer): boolean;
|
function TQtWidgetSet.GetScrollbarVisible(Handle: HWND; SBStyle: Integer): boolean;
|
||||||
|
var
|
||||||
|
w: TQtWidget;
|
||||||
|
ScrollBar: TQtScrollBar;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
{$ifdef VerboseQtWinAPI}
|
||||||
{$ifdef VerboseQtWinAPI_MISSING_IMPLEMENTATION}
|
writeln('Trace:> [WinAPI GetScrollBarVisible] Handle: ' + dbghex(Handle),' SBStyle: ',SBStyle);
|
||||||
WriteLn('***** [WinAPI TQtWidgetSet.GetScrollBarVisible] missing implementation ');
|
|
||||||
{$endif}
|
{$endif}
|
||||||
|
Result := False;
|
||||||
|
if Handle = 0 then exit;
|
||||||
|
|
||||||
|
w := TQtWidget(Handle);
|
||||||
|
|
||||||
|
{TODO: find out what to do with TCustomForm descendants }
|
||||||
|
if w is TQtAbstractScrollArea then
|
||||||
|
begin
|
||||||
|
if SBStyle = SB_VERT then
|
||||||
|
ScrollBar := TQtAbstractScrollArea(w).verticalScrollBar
|
||||||
|
else
|
||||||
|
ScrollBar := TQtAbstractScrollArea(w).horizontalScrollBar;
|
||||||
|
end else
|
||||||
|
if w is TQtScrollBar then
|
||||||
|
ScrollBar := TQtScrollBar(w)
|
||||||
|
else
|
||||||
|
ScrollBar := nil;
|
||||||
|
|
||||||
|
if ScrollBar <> nil then
|
||||||
|
Result := ScrollBar.getVisible;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user