- cleanup (remove unused variables)
 - implemented AppMinimize, AppRestore, AppBringToFront

git-svn-id: trunk@11454 -
This commit is contained in:
paul 2007-07-10 06:01:58 +00:00
parent fe85f4aebc
commit 05b9d41eaf
12 changed files with 49 additions and 53 deletions

View File

@ -65,6 +65,7 @@ type
procedure AppProcessMessages; override;
procedure AppTerminate; override;
procedure AppMinimize; override;
procedure AppRestore; override;
procedure AppBringToFront; override;
// procedure AppSetTitle(const ATitle: string); override;
public

View File

@ -142,12 +142,20 @@ end;
procedure TQtWidgetSet.AppMinimize;
begin
if (Application.MainForm <> nil) and (Application.MainForm.HandleAllocated) then
TQtMainWindow(Application.MainForm.Handle).ShowMinimized;
end;
procedure TQtWidgetSet.AppRestore;
begin
if (Application.MainForm <> nil) and (Application.MainForm.HandleAllocated) then
TQtMainWindow(Application.MainForm.Handle).ShowNormal;
end;
procedure TQtWidgetSet.AppBringToFront;
begin
if (Application.MainForm <> nil) and (Application.MainForm.HandleAllocated) then
TQtMainWindow(Application.MainForm.Handle).BringToFront;
end;
function TQtWidgetSet.CreateThemeServices: TThemeServices;

View File

@ -714,15 +714,13 @@ end;
Returns: Nothing
------------------------------------------------------------------------------}
constructor TQtPen.Create(CreateHandle: Boolean);
var
MyColor: TQColor;
begin
{$ifdef VerboseQt}
WriteLn('TQtPen.Create CreateHandle: ', dbgs(CreateHandle));
{$endif}
if CreateHandle then Widget := QPen_create;
if CreateHandle then
Widget := QPen_create;
end;
{------------------------------------------------------------------------------
@ -938,7 +936,6 @@ end;
procedure TQtDeviceContext.DebugClipRect(const msg: string);
var
Rgn: QRegionH;
R: TRect;
ok: boolean;
begin
ok := QPainter_hasClipping(Widget);
@ -987,8 +984,6 @@ end;
(x: 0 y: 0 w: 50 h: 50)
------------------------------------------------------------------------------}
procedure TQtDeviceContext.CorrectCoordinates(var ARect: TRect);
var
Buffer: Integer;
begin
if ARect.Left < 0 then ARect.Left := 0;
@ -1487,9 +1482,6 @@ end;
{ TQtButtonGroup }
constructor TQtButtonGroup.Create(AParent: QObjectH);
var
Hook: QObject_hookH;
Method: TMethod;
begin
inherited Create;

View File

@ -193,8 +193,6 @@ end;
Contructor for the class.
------------------------------------------------------------------------------}
constructor TQtListStrings.Create(ListWidgetH: QListWidgetH; TheOwner: TWinControl);
var
i: Integer;
begin
inherited Create;
@ -475,8 +473,8 @@ end;
Clears all.
------------------------------------------------------------------------------}
procedure TQtMemoStrings.Clear;
var
Mess: TLMessage;
{var
Mess: TLMessage;}
begin
FUpdating := True;
FStringList.Clear;
@ -607,8 +605,6 @@ begin
end;
constructor TQtComboStrings.Create(ComboBoxH: QComboBoxH; TheOwner: TWinControl);
var
i: Integer;
begin
inherited Create;

View File

@ -116,7 +116,7 @@ var
opt: QStyleOptionH;
ARect: QRectH;
Element: TQtDrawElement;
QVariant: QVariantH;
//QVariant: QVariantH;
Features: QStyleOptionButtonButtonFeatures;
begin
if (Context <> nil) then

View File

@ -174,6 +174,10 @@ type
function EventFilter(Sender: QObjectH; Event: QEventH): Boolean; cdecl; override;
procedure SlotWindowStateChange; cdecl;
procedure setShowInTaskBar(AValue: Boolean);
public
procedure BringToFront;
procedure ShowMinimized;
procedure ShowNormal;
end;
{ TQtStaticText }
@ -2000,10 +2004,8 @@ end;
function TQtMainWindow.CreateWidget(const AParams: TCreateParams): QWidgetH;
var
w: QWidgetH;
r: TRect;
{$ifdef USE_QT_4_3}
mdihandle: QMdiAreaH;
toolbar: QToolBarH;
{$endif}
begin
// Creates the widget
@ -2258,11 +2260,26 @@ begin
end;
end;
procedure TQtMainWindow.BringToFront;
begin
QWidget_activateWindow(Widget);
QWidget_raise(Widget);
end;
procedure TQtMainWindow.ShowMinimized;
begin
QWidget_showMinimized(Widget);
end;
procedure TQtMainWindow.ShowNormal;
begin
QWidget_showNormal(Widget);
end;
{ TQtStaticText }
function TQtStaticText.CreateWidget(const AParams: TCreateParams): QWidgetH;
var
Str: WideString;
Parent: QWidgetH;
begin
// Creates the widget
@ -2373,7 +2390,6 @@ end;
function TQtCheckBox.CreateWidget(const AParams: TCreateParams): QWidgetH;
var
Str: WideString;
Parent: QWidgetH;
begin
// Creates the widget
@ -2397,7 +2413,6 @@ begin
Parent := TQtWidget(LCLObject.Parent.Handle).GetContainerWidget;
Result := QCheckBox_create(Parent);
end;
end;
procedure TQtCheckBox.SetGeometry;
@ -2474,7 +2489,6 @@ end;
function TQtRadioButton.CreateWidget(const AParams: TCreateParams): QWidgetH;
var
Str: WideString;
Parent: QWidgetH;
begin
// Creates the widget
@ -2551,8 +2565,6 @@ end;
function TQtGroupBox.CreateWidget(const AParams: TCreateParams): QWidgetH;
var
Parent: QWidgetH;
R: TRect;
Method: TMethod;
begin
// Creates the widget
{$ifdef VerboseQt}
@ -3495,8 +3507,7 @@ end;
procedure TQtAbstractSpinBox.SignalEditingFinished; cdecl;
var
Msg: TLMessage;
s: WideString;
Msg: TLMessage;
begin
{$ifdef VerboseQt}
WriteLn('TQtAbstractSpinBox.SignalEditingFinished');
@ -4047,7 +4058,6 @@ var
Msg: TLMNotify;
NMLV: TNMListView;
AParent: QTreeWidgetItemH;
AIndex: Integer;
ASubIndex: Integer;
begin
@ -4278,7 +4288,6 @@ end;
function TQtProgressBar.CreateWidget(const AParams: TCreateParams): QWidgetH;
var
Parent: QWidgetH;
Text: WideString;
begin
// Creates the widget
{$ifdef VerboseQt}

View File

@ -816,7 +816,6 @@ function TQtWidgetSet.ExtTextOut(DC: HDC; X, Y: Integer; Options: Longint;
Rect: PRect; Str: PChar; Count: Longint; Dx: PInteger): Boolean;
var
WideStr: WideString;
Painter: QPainterH;
begin
{$ifdef VerboseQtWinAPI}
WriteLn('[WinAPI ExtTextOut]');
@ -1211,7 +1210,7 @@ end;
function TQtWidgetSet.GetObject(GDIObj: HGDIOBJ; BufSize: Integer; Buf: Pointer): Integer;
var
aObject: TObject;
NumColors, Width, Height: Longint;
Width, Height: Longint;
BitmapSection : TDIBSECTION;
{$ifdef VerboseQtWinAPI}
ObjType: string;
@ -2248,8 +2247,6 @@ end;
------------------------------------------------------------------------------}
function TQtWidgetSet.InvalidateRect(aHandle: HWND; Rect: pRect; bErase: Boolean): Boolean;
var
R: TRect;
begin
{$ifdef VerboseQtWinAPI}
WriteLn('[WinAPI Invalidate Rect]');
@ -2622,8 +2619,6 @@ end;
------------------------------------------------------------------------------}
function TQtWidgetSet.SetBKColor(DC: HDC; Color: TColorRef): TColorRef;
var
Brush: TQtBrush;
begin
{$ifdef VerboseQtWinAPI}
WriteLn('Trace:> [WinAPI SetBkColor]',
@ -2716,8 +2711,6 @@ end;
------------------------------------------------------------------------------}
function TQtWidgetSet.SetFocus(hWnd: HWND): HWND;
var
Widget: QWidgetH;
begin
if hwnd<>0 then
begin

View File

@ -654,7 +654,6 @@ class procedure TQtWSStatusBar.PanelUpdate(const AStatusBar: TStatusBar; PanelIn
var
QtStatusBar: TQtStatusBar;
Str: Widestring;
R: TRect;
i: Integer;
begin
QtStatusBar := TQtStatusBar(AStatusBar.Handle);
@ -946,7 +945,6 @@ class procedure TQtWSCustomListView.ColumnSetAlignment(const ALV: TCustomListVie
var
TW: QTreeWidgetH;
TWI: QTreeWidgetItemH;
TWIChild: QTreeWidgetItemH;
FAlign: QtAlignment;
begin
@ -1075,7 +1073,8 @@ var
TWI: QTreeWidgetItemH;
begin
TW := QTreeWidgetH(TQtTreeWidget(ALV.Handle).Widget);
QTreeWidget_takeTopLevelItem(TW, AIndex);
TWI := QTreeWidget_takeTopLevelItem(TW, AIndex);
{$note implement}
end;
{------------------------------------------------------------------------------
@ -1153,14 +1152,13 @@ class procedure TQtWSCustomListView.ItemSetChecked(const ALV: TCustomListView; c
var
TW: QTreeWidgetH;
TWI: QTreeWidgetItemH;
AState: QtCheckState;
begin
TW := QTreeWidgetH(TQtTreeWidget(ALV.Handle).Widget);
TWI := QTreeWidget_topLevelItem(TW, AIndex);
if AChecked then
QTreeWidgetItem_setCheckState(TWI, 0, QtChecked)
QTreeWidgetItem_setCheckState(TWI, 0, QtChecked)
else
QTreeWidgetItem_setCheckState(TWI, 0, QtUnChecked);
QTreeWidgetItem_setCheckState(TWI, 0, QtUnChecked);
end;
{------------------------------------------------------------------------------
@ -1354,6 +1352,7 @@ begin
TW := QTreeWidgetH(TQtTreeWidget(ALV.Handle).Widget);
if AType <> stNone then
begin
{$note implement}
// QTreeWidget_setSortingEnabled(TW, True);
// QTreeView_sortByColumn(QTreeViewH(TW), AColumn);
end;

View File

@ -132,7 +132,6 @@ class function TQtWSCustomControl.CreateHandle(const AWinControl: TWinControl;
var
QtAbstractScrollArea: TQtAbstractScrollArea;
Method: TMethod;
AHook : QAbstractScrollArea_hookH;
Hook: QObject_hookH;
begin
{$ifdef VerboseQt}

View File

@ -155,7 +155,6 @@ var
Parent: QWidgetH;
ReturnList: QStringListH;
ParserState, Position, i: Integer;
Strings: TStringList;
begin
{------------------------------------------------------------------------------
Initialization of variables

View File

@ -191,12 +191,13 @@ end;
class function TQtWSCustomFloatSpinEdit.GetText(const AWinControl: TWinControl; var AText: String): Boolean;
begin
{$note implement}
end;
class procedure TQtWSCustomFloatSpinEdit.SetText(const AWinControl: TWinControl; const AText: string);
begin
// perhaps QSpinBox_setSuffix() goes here one day (if we get LCL support)
{$note implement}
end;
class procedure TQtWSCustomFloatSpinEdit.SetReadOnly(const ACustomEdit: TCustomEdit; NewReadOnly: boolean);

View File

@ -526,7 +526,10 @@ var
ListWidgetH: QListWidgetH;
begin
if not Assigned(TQtListWidget(ACustomListBox.Handle).FList) then
TQtListWidget(ACustomListBox.Handle).FList := TQtListStrings.Create(ListWidgetH, ACustomListBox);
begin
ListWidgetH := QListWidgetH(TQtListWidget(ACustomListBox.Handle).Widget);
TQtListWidget(ACustomListBox.Handle).FList := TQtListStrings.Create(ListWidgetH, ACustomListBox);
end;
Result := TQtListWidget(ACustomListBox.Handle).FList;
end;
@ -764,8 +767,6 @@ class function TQtWSCustomEdit.CreateHandle(const AWinControl: TWinControl;
const AParams: TCreateParams): HWND;
var
QtLineEdit: TQtLineEdit;
QColor: TQColor;
Color: TColor;
Method: TMethod;
Hook : QLineEdit_hookH;
begin
@ -1428,8 +1429,6 @@ var
QtComboBox: TQtComboBox;
Method: TMethod;
Hook : QObject_hookH;
QColor: TQColor;
Color: TColor;
begin
QtComboBox := TQtComboBox.Create(AWinControl, AParams);
@ -1453,7 +1452,7 @@ begin
QComboBox_currentIndexChanged_Event(Method) := QtComboBox.SlotSelect;
QComboBox_hook_hook_currentIndexChanged(
QComboBox_hook_create(QtComboBox.Widget), Method);
QComboBox_hook_create(QtComboBox.Widget), Method);
Result := THandle(QtComboBox);
end;