Qt: More winapi & TQtWidget routines implemented.

git-svn-id: trunk@12236 -
This commit is contained in:
zeljko 2007-09-29 10:54:55 +00:00
parent 60d708414c
commit 5bdb68667e
2 changed files with 66 additions and 6 deletions

View File

@ -151,6 +151,8 @@ type
function getGeometry: TRect; virtual;
function getVisible: Boolean; virtual;
function getText: WideString; virtual;
function getHeight: Integer;
function getWidth: Integer;
procedure grabMouse; virtual;
function hasFocus: Boolean; virtual;
procedure lowerWidget;
@ -2264,6 +2266,16 @@ begin
Result := FText;
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;
begin
QWidget_contentsRect(Widget, @Result);

View File

@ -2334,19 +2334,67 @@ begin
end;
function TQtWidgetSet.GetScrollBarSize(Handle: HWND; BarKind: Integer): integer;
var
w: TQtWidget;
ScrollBar: TQtScrollBar;
begin
Result := 15;
{$ifdef VerboseQtWinAPI_MISSING_IMPLEMENTATION}
WriteLn('***** [WinAPI TQtWidgetSet.GetScrollBarSize] missing implementation ');
{$ifdef VerboseQtWinAPI}
writeln('Trace:> [WinAPI GetScrollBarSize] Handle: ' + dbghex(Handle),' BarKind: ',BarKind);
{$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;
function TQtWidgetSet.GetScrollbarVisible(Handle: HWND; SBStyle: Integer): boolean;
var
w: TQtWidget;
ScrollBar: TQtScrollBar;
begin
Result := False;
{$ifdef VerboseQtWinAPI_MISSING_IMPLEMENTATION}
WriteLn('***** [WinAPI TQtWidgetSet.GetScrollBarVisible] missing implementation ');
{$ifdef VerboseQtWinAPI}
writeln('Trace:> [WinAPI GetScrollBarVisible] Handle: ' + dbghex(Handle),' SBStyle: ',SBStyle);
{$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;
{------------------------------------------------------------------------------