From 6e608f157efe16a94e82e4d13350352c8f14b76c Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Fri, 1 Nov 2013 14:54:13 +0000 Subject: [PATCH] Replace out-dated code which does not compile in 64bit mode in helpers.SetWindowSizeGrip. Use a TForm descendant in the new unit "extra_controls". Code parts taken from http://www.delphigroups.info/2/4/326787.html --- packages/delphiXE5/heidisql.dpr | 3 +- packages/delphiXE5/heidisql.dproj | 3 +- source/bineditor.pas | 5 +- source/column_selection.pas | 5 +- source/connections.pas | 5 +- source/copytable.pas | 5 +- source/editvar.pas | 5 +- source/extra_controls.pas | 61 ++++++++++++ source/grideditlinks.pas | 5 +- source/helpers.pas | 149 +----------------------------- source/insertfiles.pas | 5 +- source/loaddata.pas | 5 +- source/selectdbobject.pas | 5 +- source/sqlhelp.pas | 5 +- source/syncdb.pas | 5 +- source/tabletools.pas | 5 +- source/texteditor.pas | 5 +- source/usermanager.pas | 5 +- 18 files changed, 94 insertions(+), 192 deletions(-) create mode 100644 source/extra_controls.pas diff --git a/packages/delphiXE5/heidisql.dpr b/packages/delphiXE5/heidisql.dpr index 1181b368..c832d6bb 100644 --- a/packages/delphiXE5/heidisql.dpr +++ b/packages/delphiXE5/heidisql.dpr @@ -40,7 +40,8 @@ uses exportgrid in '..\..\source\exportgrid.pas' {frmExportGrid}, syncdb in '..\..\source\syncdb.pas' {frmSyncDB}, gnugettext in '..\..\source\gnugettext.pas', - JumpList in '..\..\source\JumpList.pas'; + JumpList in '..\..\source\JumpList.pas', + extra_controls in '..\..\source\extra_controls.pas'; {$R ..\..\res\icon.RES} {$R ..\..\res\version.RES} diff --git a/packages/delphiXE5/heidisql.dproj b/packages/delphiXE5/heidisql.dproj index 1318e996..4de22aa7 100644 --- a/packages/delphiXE5/heidisql.dproj +++ b/packages/delphiXE5/heidisql.dproj @@ -1,4 +1,4 @@ - + {32493ED6-4F48-45D7-9D50-E4FA13F59063} heidisql.dpr @@ -184,6 +184,7 @@ + Cfg_2 Base diff --git a/source/bineditor.pas b/source/bineditor.pas index 297a52b6..7489d01d 100644 --- a/source/bineditor.pas +++ b/source/bineditor.pas @@ -4,12 +4,12 @@ interface uses Windows, Classes, Graphics, Forms, Controls, StdCtrls, VirtualTrees, - ComCtrls, ToolWin, Dialogs, SysUtils, gnugettext; + ComCtrls, ToolWin, Dialogs, SysUtils, gnugettext, extra_controls; {$I const.inc} type - TfrmBinEditor = class(TForm) + TfrmBinEditor = class(TFormWithSizeGrip) memoText: TMemo; tlbStandard: TToolBar; btnWrap: TToolButton; @@ -101,7 +101,6 @@ begin btnWrap.Click; // Fix label position: lblTextLength.Top := tlbStandard.Top + (tlbStandard.Height-lblTextLength.Height) div 2; - SetWindowSizeGrip(Handle, True); memoText.SelectAll; memoText.SetFocus; memoTextChange(Sender); diff --git a/source/column_selection.pas b/source/column_selection.pas index 5565a434..6a5587bd 100644 --- a/source/column_selection.pas +++ b/source/column_selection.pas @@ -4,10 +4,10 @@ interface uses Windows, Classes, Controls, Forms, StdCtrls, CheckLst, ExtCtrls, - helpers, gnugettext; + helpers, gnugettext, extra_controls; type - TColumnSelectionForm = class(TForm) + TColumnSelectionForm = class(TFormWithSizeGrip) btnCancel: TButton; btnOK: TButton; chkSelectAll: TCheckBox; @@ -45,7 +45,6 @@ procedure TColumnSelectionForm.FormCreate(Sender: TObject); begin InheritFont(Font); TranslateComponent(Self); - SetWindowSizeGrip(Self.Handle, True); Width := AppSettings.ReadInt(asColumnSelectorWidth); Height := AppSettings.ReadInt(asColumnSelectorHeight); end; diff --git a/source/connections.pas b/source/connections.pas index b0cdb216..6cb837c7 100644 --- a/source/connections.pas +++ b/source/connections.pas @@ -10,11 +10,11 @@ interface uses Windows, SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls, - VirtualTrees, Menus, Graphics, Generics.Collections, ActiveX, + VirtualTrees, Menus, Graphics, Generics.Collections, ActiveX, extra_controls, dbconnection, gnugettext; type - Tconnform = class(TForm) + Tconnform = class(TFormWithSizeGrip) btnCancel: TButton; btnOpen: TButton; btnSave: TButton; @@ -178,7 +178,6 @@ begin // Fix GUI stuff TranslateComponent(Self); InheritFont(Font); - SetWindowSizeGrip(Handle, True); Width := AppSettings.ReadInt(asSessionManagerWindowWidth); Height := AppSettings.ReadInt(asSessionManagerWindowHeight); ListSessions.Width := AppSettings.ReadInt(asSessionManagerListWidth); diff --git a/source/copytable.pas b/source/copytable.pas index 55a24786..9277c1eb 100644 --- a/source/copytable.pas +++ b/source/copytable.pas @@ -4,11 +4,11 @@ unit copytable; interface uses - Windows, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + Windows, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, extra_controls, dbconnection, VirtualTrees, SynEdit, SynMemo, Menus, gnugettext; type - TCopyTableForm = class(TForm) + TCopyTableForm = class(TFormWithSizeGrip) editNewTablename: TEdit; lblNewTablename: TLabel; btnCancel: TButton; @@ -71,7 +71,6 @@ begin InheritFont(Font); Width := AppSettings.ReadInt(asCopyTableWindowWidth); Height := AppSettings.ReadInt(asCopyTableWindowHeight); - SetWindowSizeGrip(Handle, True); MainForm.SetupSynEditors; FixVT(TreeElements); FColumns := TTableColumnList.Create; diff --git a/source/editvar.pas b/source/editvar.pas index bf920d57..2c98f582 100644 --- a/source/editvar.pas +++ b/source/editvar.pas @@ -4,13 +4,13 @@ interface uses Windows, SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, - dbconnection, mysql_structures, ComCtrls, gnugettext, SynRegExpr; + dbconnection, mysql_structures, ComCtrls, gnugettext, SynRegExpr, extra_controls; type TVarType = (vtString, vtNumeric, vtBoolean, vtEnum); EVariableError = class(Exception); - TfrmEditVariable = class(TForm) + TfrmEditVariable = class(TFormWithSizeGrip) btnOK: TButton; btnCancel: TButton; grpScope: TGroupBox; @@ -57,7 +57,6 @@ procedure TfrmEditVariable.FormCreate(Sender: TObject); begin InheritFont(Font); TranslateComponent(Self); - SetWindowSizeGrip(Handle, True); Width := AppSettings.ReadInt(asEditVarWindowWidth); Height := AppSettings.ReadInt(asEditVarWindowHeight); end; diff --git a/source/extra_controls.pas b/source/extra_controls.pas new file mode 100644 index 00000000..854c86f5 --- /dev/null +++ b/source/extra_controls.pas @@ -0,0 +1,61 @@ +unit extra_controls; + +interface + +uses + Classes, SysUtils, Forms, Windows, Messages; + +type + // Form with a sizegrip in the lower right corner, without the need for a statusbar + TFormWithSizeGrip = class(TForm) + private + FSizeGripRect: TRect; + FSizeGripWidth: Integer; + FSizeGripHeight: Integer; + procedure WMNCHitTest(var Msg: TWMNCHitTest); message WM_NCHITTEST; + public + constructor Create(AOwner: TComponent); override; + procedure Paint; override; + procedure Resize; override; + end; + + +implementation + + +{ TFormWithSizeGrip } + +constructor TFormWithSizeGrip.Create(AOwner: TComponent); +begin + inherited; + FSizeGripWidth := GetSystemMetrics(SM_CXVSCROLL); + FSizeGripHeight := GetSystemMetrics(SM_CYHSCROLL); +end; + + +procedure TFormWithSizeGrip.WMNCHitTest(var Msg: TWMNCHitTest); +begin + inherited; + if PtInRect(FSizeGripRect, ScreenToClient(SmallPointToPoint(Msg.Pos))) then + Msg.Result := HTBOTTOMRIGHT; +end; + + +procedure TFormWithSizeGrip.Paint; +begin + inherited; + DrawFrameControl(Canvas.Handle, FSizeGripRect, DFC_SCROLL, DFCS_SCROLLSIZEGRIP); +end; + + +procedure TFormWithSizeGrip.Resize; +begin + inherited; + FSizeGripRect := ClientRect; + FSizeGripRect.Left := FSizeGripRect.Right - FSizeGripWidth; + FSizeGripRect.Top := FSizeGripRect.Bottom - FSizeGripHeight; + Refresh; +end; + + +end. diff --git a/source/grideditlinks.pas b/source/grideditlinks.pas index 83c606c1..ec2aa7ac 100644 --- a/source/grideditlinks.pas +++ b/source/grideditlinks.pas @@ -915,9 +915,7 @@ begin FPanel.Hide; FPanel.Parent := FParentForm; FPanel.ParentBackground := False; - FPanel.Width := AppSettings.ReadInt(asSetEditorWidth); - FPanel.Height := AppSettings.ReadInt(asSetEditorHeight); - SetWindowSizeGrip(FPanel.Handle, True); + FPanel.Height := 150; FPanel.OnResize := PanelResize; FPanel.OnExit := DoEndEdit; @@ -1002,6 +1000,7 @@ begin R := GetCellRect(False); FPanel.Top := R.Top; FPanel.Left := R.Left; + FPanel.Width := R.Width; FBtnOk.Width := (FPanel.Width - 3*margin) div 2; FBtnOk.Left := margin; diff --git a/source/helpers.pas b/source/helpers.pas index 0f9d2661..db590030 100644 --- a/source/helpers.pas +++ b/source/helpers.pas @@ -43,14 +43,6 @@ type end; TDBObjectEditorClass = class of TDBObjectEditor; - TWndProc = function (hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall; - PGripInfo = ^TGripInfo; - TGripInfo = record - OldWndProc: TWndProc; - Enabled: boolean; - GripRect: TRect; - end; - TSQLBatch = class; TSQLSentence = class(TObject) private @@ -168,7 +160,7 @@ type asConnectCount, asRefusedCount, asSessionCreated, asDoUsageStatistics, asLastUsageStatisticCall, asDisplayBars, asBarColor, asMySQLBinaries, asCustomSnippetsDirectory, asPromptSaveFileOnTabClose, asCompletionProposal, asTabsToSpaces, asFilterPanel, asAllowMultipleInstances, asFindDialogSearchHistory, - asFindDialogReplaceHistory, asMaxQueryResults, asSetEditorWidth, asSetEditorHeight, asLogErrors, + asFindDialogReplaceHistory, asMaxQueryResults, asLogErrors, asLogUserSQL, asLogSQL, asLogInfos, asLogDebug, asFieldColorNumeric, asFieldColorReal, asFieldColorText, asFieldColorBinary, asFieldColorDatetime, asFieldColorSpatial, asFieldColorOther, asFieldEditorBinary, asFieldEditorDatetime, asFieldEditorDatetimePrefill, asFieldEditorEnum, @@ -276,7 +268,6 @@ type function FormatByteNumber( Bytes: String; Decimals: Byte = 1 ): String; Overload; function FormatTimeNumber(Seconds: Cardinal; DisplaySeconds: Boolean): String; function GetTempDir: String; - procedure SetWindowSizeGrip(hWnd: HWND; Enable: boolean); procedure SaveUnicodeFile(Filename: String; Text: String); procedure OpenTextFile(const Filename: String; out Stream: TFileStream; var Encoding: TEncoding); function DetectEncoding(Stream: TStream): TEncoding; @@ -1054,142 +1045,6 @@ begin end; -{ - Code taken from SizeGripHWND.pas: - Copyright (C) 2005, 2006 Volker Siebert - Alle Rechte vorbehalten. - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. -} -function SizeGripWndProc(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall; -var - Info: PGripInfo; - dc: HDC; - pt: TPoint; - - // Invalidate the current grip rectangle - procedure InvalidateGrip; - begin - with Info^ do - if (GripRect.Right > GripRect.Left) and - (GripRect.Bottom > GripRect.Top) then - InvalidateRect(hWnd, @GripRect, true); - end; - - // Update (and invalidate) the current grip rectangle - procedure UpdateGrip; - begin - with Info^ do - begin - GetClientRect(hWnd, GripRect); - GripRect.Left := GripRect.Right - GetSystemMetrics(SM_CXHSCROLL); - GripRect.Top := GripRect.Bottom - GetSystemMetrics(SM_CYVSCROLL); - end; - - InvalidateGrip; - end; - - function CallOld: LRESULT; - begin - Result := CallWindowProc(@Info^.OldWndProc, hWnd, Msg, wParam, lParam); - end; - -begin - Info := PGripInfo(GetProp(hWnd, SizeGripProp)); - if Info = nil then - Result := DefWindowProc(hWnd, Msg, wParam, lParam) - else if not Info^.Enabled then - Result := CallOld - else - begin - case Msg of - WM_NCDESTROY: begin - Result := CallOld; - - SetWindowLong(hWnd, GWL_WNDPROC, LongInt(@Info^.OldWndProc)); - RemoveProp(hWnd, SizeGripProp); - Dispose(Info); - end; - - WM_PAINT: begin - Result := CallOld; - if wParam = 0 then - begin - dc := GetDC(hWnd); - DrawFrameControl(dc, Info^.GripRect, DFC_SCROLL, DFCS_SCROLLSIZEGRIP); - ReleaseDC(hWnd, dc); - end; - end; - - WM_NCHITTEST: begin - pt.x := TSmallPoint(lParam).x; - pt.y := TSmallPoint(lParam).y; - ScreenToClient(hWnd, pt); - if PtInRect(Info^.GripRect, pt) then - Result := HTBOTTOMRIGHT - else - Result := CallOld; - end; - - WM_SIZE: begin - InvalidateGrip; - Result := CallOld; - UpdateGrip; - end; - - else - Result := CallOld; - end; - end; -end; - -{ Note that SetWindowSizeGrip(..., false) does not really remove the hook - - it just sets "Enabled" to false. The hook plus all data is removed when - the window is destroyed. -} -procedure SetWindowSizeGrip(hWnd: HWND; Enable: boolean); -var - Info: PGripInfo; -begin - Info := PGripInfo(GetProp(hWnd, SizeGripProp)); - if (Info = nil) and Enable then - begin - New(Info); - FillChar(Info^, SizeOf(TGripInfo), 0); - - with Info^ do - begin - Info^.OldWndProc := TWndProc(Pointer(GetWindowLong(hWnd, GWL_WNDPROC))); - - GetClientRect(hWnd, GripRect); - GripRect.Left := GripRect.Right - GetSystemMetrics(SM_CXHSCROLL); - GripRect.Top := GripRect.Bottom - GetSystemMetrics(SM_CYVSCROLL); - end; - - SetProp(hWnd, SizeGripProp, Cardinal(Info)); - SetWindowLong(hWnd, GWL_WNDPROC, LongInt(@SizeGripWndProc)); - end; - - if (Info <> nil) then - if Enable <> Info^.Enabled then - with Info^ do - begin - Enabled := Enable; - if (GripRect.Right > GripRect.Left) and - (GripRect.Bottom > GripRect.Top) then - InvalidateRect(hWnd, @GripRect, true); - end; -end; - - {** Save a textfile with unicode } @@ -3331,8 +3186,6 @@ begin InitSetting(asFindDialogSearchHistory, 'FindDialogSearchHistory', 0, False, ''); InitSetting(asFindDialogReplaceHistory, 'FindDialogReplaceHistory', 0, False, ''); InitSetting(asMaxQueryResults, 'MaxQueryResults', 10); - InitSetting(asSetEditorWidth, 'SetEditorWidth', 100); - InitSetting(asSetEditorHeight, 'SetEditorHeight', 130); InitSetting(asLogErrors, 'LogErrors', 0, True); InitSetting(asLogUserSQL, 'LogUserSQL', 0, True); InitSetting(asLogSQL, 'LogSQL', 0, True); diff --git a/source/insertfiles.pas b/source/insertfiles.pas index 0923341a..e9754091 100644 --- a/source/insertfiles.pas +++ b/source/insertfiles.pas @@ -4,7 +4,7 @@ interface uses Windows, Messages, SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls, - ShellApi, Math, Graphics, ComCtrls, ToolWin, + ShellApi, Math, Graphics, ComCtrls, ToolWin, extra_controls, dbconnection, mysql_structures, VirtualTrees, grideditlinks, SynRegExpr, gnugettext, helpers; type @@ -25,7 +25,7 @@ type end; PFileInfo = ^TFileInfo; - TfrmInsertFiles = class(TForm) + TfrmInsertFiles = class(TFormWithSizeGrip) btnInsert: TButton; btnCancel: TButton; OpenDialog: TOpenDialog; @@ -119,7 +119,6 @@ begin TranslateComponent(Self); ListFiles.Images := GetSystemImageList; DragAcceptFiles(Handle, True); - SetWindowSizeGrip(Self.Handle, True); InheritFont(Font); MainForm.RestoreListSetup(ListColumns); MainForm.RestoreListSetup(ListFiles); diff --git a/source/loaddata.pas b/source/loaddata.pas index 61f2137a..3d3a5867 100644 --- a/source/loaddata.pas +++ b/source/loaddata.pas @@ -10,11 +10,11 @@ interface uses Windows, SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls, ComCtrls, CheckLst, - SynRegExpr, Buttons, ExtCtrls, ToolWin, ExtDlgs, Math, + SynRegExpr, Buttons, ExtCtrls, ToolWin, ExtDlgs, Math, extra_controls, dbconnection, mysql_structures, gnugettext; type - Tloaddataform = class(TForm) + Tloaddataform = class(TFormWithSizeGrip) btnImport: TButton; btnCancel: TButton; lblDatabase: TLabel; @@ -94,7 +94,6 @@ procedure Tloaddataform.FormCreate(Sender: TObject); begin TranslateComponent(Self); InheritFont(Font); - SetWindowSizeGrip(Handle, True); // Restore settings Width := AppSettings.ReadInt(asCSVImportWindowWidth); Height := AppSettings.ReadInt(asCSVImportWindowHeight); diff --git a/source/selectdbobject.pas b/source/selectdbobject.pas index 0d8048c7..cd28cd6b 100644 --- a/source/selectdbobject.pas +++ b/source/selectdbobject.pas @@ -3,11 +3,11 @@ unit selectdbobject; interface uses - Windows, Classes, Controls, Forms, StdCtrls, VirtualTrees, Graphics, + Windows, Classes, Controls, Forms, StdCtrls, VirtualTrees, Graphics, extra_controls, dbconnection, gnugettext; type - TfrmSelectDBObject = class(TForm) + TfrmSelectDBObject = class(TFormWithSizeGrip) TreeDBO: TVirtualStringTree; btnOK: TButton; btnCancel: TButton; @@ -65,7 +65,6 @@ begin TranslateComponent(Self); Width := AppSettings.ReadInt(asSelectDBOWindowWidth); Height := AppSettings.ReadInt(asSelectDBOWindowHeight); - SetWindowSizeGrip( Self.Handle, True ); InheritFont(Font); TreeDBO.TreeOptions := MainForm.DBtree.TreeOptions; FixVT(TreeDBO); diff --git a/source/sqlhelp.pas b/source/sqlhelp.pas index 333cc9e8..8021bb86 100644 --- a/source/sqlhelp.pas +++ b/source/sqlhelp.pas @@ -4,12 +4,12 @@ interface uses Windows, SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls, ComCtrls, ExtCtrls, - Buttons, SynMemo, SynEditHighlighter, SynHighlighterURI, + Buttons, SynMemo, SynEditHighlighter, SynHighlighterURI, extra_controls, SynURIOpener, SynEdit, VirtualTrees, Graphics, dbconnection, gnugettext; type - TfrmSQLhelp = class(TForm) + TfrmSQLhelp = class(TFormWithSizeGrip) URIOpenerDescription: TSynURIOpener; URIHighlighter: TSynURISyn; URIOpenerExample: TSynURIOpener; @@ -81,7 +81,6 @@ procedure TfrmSQLhelp.FormCreate(Sender: TObject); begin // Set window-layout InheritFont(Font); - SetWindowSizeGrip(Handle, True); Top := AppSettings.ReadInt(asSQLHelpWindowTop); Left := AppSettings.ReadInt(asSQLHelpWindowLeft); Width := AppSettings.ReadInt(asSQLHelpWindowWidth); diff --git a/source/syncdb.pas b/source/syncdb.pas index 256bd8c7..bee15991 100644 --- a/source/syncdb.pas +++ b/source/syncdb.pas @@ -4,11 +4,11 @@ interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, - Dialogs, StdCtrls, Generics.Collections, VirtualTrees, + Dialogs, StdCtrls, Generics.Collections, VirtualTrees, extra_controls, dbconnection, gnugettext; type - TfrmSyncDB = class(TForm) + TfrmSyncDB = class(TFormWithSizeGrip) treeSource: TVirtualStringTree; lblSource: TLabel; grpTarget: TGroupBox; @@ -109,7 +109,6 @@ begin Caption := MainForm.actSynchronizeDatabase.Caption; TranslateComponent(Self); InheritFont(Font); - SetWindowSizeGrip(Self.Handle, True); FixVT(treeSource); FixVT(treeDifferences); diff --git a/source/tabletools.pas b/source/tabletools.pas index c1de0d0d..b18f4e76 100644 --- a/source/tabletools.pas +++ b/source/tabletools.pas @@ -10,12 +10,12 @@ interface uses Windows, SysUtils, Classes, Controls, Forms, StdCtrls, ComCtrls, Buttons, Dialogs, StdActns, - VirtualTrees, ExtCtrls, Graphics, SynRegExpr, Math, Generics.Collections, + VirtualTrees, ExtCtrls, Graphics, SynRegExpr, Math, Generics.Collections, extra_controls, dbconnection, helpers, Menus, gnugettext, DateUtils, System.Zip, System.UITypes; type TToolMode = (tmMaintenance, tmFind, tmSQLExport, tmBulkTableEdit); - TfrmTableTools = class(TForm) + TfrmTableTools = class(TFormWithSizeGrip) btnCloseOrCancel: TButton; pnlTop: TPanel; TreeObjects: TVirtualStringTree; @@ -221,7 +221,6 @@ begin comboExportOutputTarget.Text := ''; // Various - SetWindowSizeGrip( Self.Handle, True ); FixVT(TreeObjects); FixVT(ResultGrid); FResults := TObjectList.Create; diff --git a/source/texteditor.pas b/source/texteditor.pas index 0ced4a94..835ef137 100644 --- a/source/texteditor.pas +++ b/source/texteditor.pas @@ -5,12 +5,12 @@ interface uses Windows, Classes, Graphics, Forms, Controls, StdCtrls, VirtualTrees, ComCtrls, ToolWin, Dialogs, SysUtils, Menus, ExtDlgs, - helpers, gnugettext, ActnList, StdActns; + helpers, gnugettext, ActnList, StdActns, extra_controls, System.Actions; {$I const.inc} type - TfrmTextEditor = class(TForm) + TfrmTextEditor = class(TFormWithSizeGrip) memoText: TMemo; tlbStandard: TToolBar; btnWrap: TToolButton; @@ -198,7 +198,6 @@ begin btnWrap.Click; // Fix label position: lblTextLength.Top := tlbStandard.Top + (tlbStandard.Height-lblTextLength.Height) div 2; - SetWindowSizeGrip(Handle, True); memoText.SetFocus; end; diff --git a/source/usermanager.pas b/source/usermanager.pas index 9d404ff3..1318c518 100644 --- a/source/usermanager.pas +++ b/source/usermanager.pas @@ -5,7 +5,7 @@ interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls, StdCtrls, - ExtCtrls, ToolWin, ClipBrd, Generics.Collections, Generics.Defaults, SynRegExpr, + ExtCtrls, ToolWin, ClipBrd, Generics.Collections, Generics.Defaults, SynRegExpr, extra_controls, dbconnection, helpers, VirtualTrees, Menus, gnugettext; {$I const.inc} @@ -40,7 +40,7 @@ type EInputError = class(Exception); - TUserManagerForm = class(TForm) + TUserManagerForm = class(TFormWithSizeGrip) btnCancel: TButton; btnSave: TButton; pnlLeft: TPanel; @@ -211,7 +211,6 @@ begin Width := AppSettings.ReadInt(asUsermanagerWindowWidth); Height := AppSettings.ReadInt(asUsermanagerWindowHeight); pnlLeft.Width := AppSettings.ReadInt(asUsermanagerListWidth); - SetWindowSizeGrip( Self.Handle, True ); FixVT(listUsers); FixVT(treePrivs); Mainform.RestoreListSetup(listUsers);