diff --git a/packages/Delphi10.3/heidisql.dpr b/packages/Delphi10.3/heidisql.dpr index 5aabf2f6..8ebc79b6 100644 --- a/packages/Delphi10.3/heidisql.dpr +++ b/packages/Delphi10.3/heidisql.dpr @@ -78,7 +78,6 @@ begin Application.Initialize; Application.Title := APPNAME; Application.UpdateFormatSettings := False; - AppHelpers.InheritFont(Application.DefaultFont); TStyleManager.TrySetStyle(AppSettings.ReadString(asTheme)); Application.CreateForm(TMainForm, MainForm); MainForm.AfterFormCreate; diff --git a/res/manifest.xml b/res/manifest.xml index 3be83a62..36996eaa 100644 --- a/res/manifest.xml +++ b/res/manifest.xml @@ -3,8 +3,9 @@ - - True/PM + + true/pm + PerMonitorV2 diff --git a/source/about.dfm b/source/about.dfm index 098e2816..c7325722 100644 --- a/source/about.dfm +++ b/source/about.dfm @@ -6,7 +6,11 @@ object AboutBox: TAboutBox ClientHeight = 315 ClientWidth = 481 Color = clBtnFace - ParentFont = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] FormStyle = fsStayOnTop OldCreateOrder = True Position = poOwnerFormCenter diff --git a/source/about.pas b/source/about.pas index c151bf48..dd36fdb1 100644 --- a/source/about.pas +++ b/source/about.pas @@ -8,10 +8,10 @@ interface uses Windows, Classes, Graphics, Forms, Controls, StdCtrls, ExtCtrls, SysUtils, ComCtrls, pngimage, gnugettext, - Dialogs, SynRegExpr, Vcl.Menus, ClipBrd; + Dialogs, SynRegExpr, Vcl.Menus, ClipBrd, extra_controls; type - TAboutBox = class(TForm) + TAboutBox = class(TExtForm) btnClose: TButton; lblAppName: TLabel; lblAppVersion: TLabel; diff --git a/source/apphelpers.pas b/source/apphelpers.pas index f5a593cd..872418e8 100644 --- a/source/apphelpers.pas +++ b/source/apphelpers.pas @@ -318,7 +318,6 @@ type function GetNextNode(Tree: TVirtualStringTree; CurrentNode: PVirtualNode; Selected: Boolean=False): PVirtualNode; function GetPreviousNode(Tree: TVirtualStringTree; CurrentNode: PVirtualNode; Selected: Boolean=False): PVirtualNode; function DateBackFriendlyCaption(d: TDateTime): String; - procedure InheritFont(AFont: TFont); function GetLightness(AColor: TColor): Byte; function ReformatSQL(SQL: String): String; function ParamBlobToStr(lpData: Pointer): String; @@ -1751,39 +1750,6 @@ begin end; -procedure InheritFont(AFont: TFont); -var - LogFont: TLogFont; - GUIFontName: String; -begin - // Set custom font if set, or default system font. - // In high-dpi mode, the font *size* is increased automatically somewhere in the VCL, - // caused by a form's .Scaled property. So we don't increase it here again. - // To test this, you really need to log off/on Windows! - GUIFontName := AppSettings.ReadString(asGUIFontName); - if not GUIFontName.IsEmpty then begin - // Apply user specified font - AFont.Name := GUIFontName; - // Set size on top of automatic dpi-increased size - AFont.Size := AppSettings.ReadInt(asGUIFontSize); - end else begin - // Apply system font. See issue #3204. - // Code taken from http://www.gerixsoft.com/blog/delphi/system-font - if SystemParametersInfo(SPI_GETICONTITLELOGFONT, SizeOf(TLogFont), @LogFont, 0) then begin - AFont.Height := LogFont.lfHeight; - AFont.Orientation := LogFont.lfOrientation; - AFont.Charset := TFontCharset(LogFont.lfCharSet); - AFont.Name := PChar(@LogFont.lfFaceName); - case LogFont.lfPitchAndFamily and $F of - VARIABLE_PITCH: AFont.Pitch := fpVariable; - FIXED_PITCH: AFont.Pitch := fpFixed; - else AFont.Pitch := fpDefault; - end; - end; - end; -end; - - function GetLightness(AColor: TColor): Byte; var R, G, B: Byte; diff --git a/source/bineditor.pas b/source/bineditor.pas index 30b771d8..c9f74e99 100644 --- a/source/bineditor.pas +++ b/source/bineditor.pas @@ -9,7 +9,7 @@ uses {$I const.inc} type - TfrmBinEditor = class(TFormWithSizeGrip) + TfrmBinEditor = class(TExtForm) memoText: TMemo; tlbStandard: TToolBar; btnWrap: TToolButton; @@ -90,6 +90,7 @@ end; procedure TfrmBinEditor.FormCreate(Sender: TObject); begin TranslateComponent(Self); + AddSizeGrip; end; diff --git a/source/change_password.dfm b/source/change_password.dfm index b8c60eca..a443a12f 100644 --- a/source/change_password.dfm +++ b/source/change_password.dfm @@ -10,7 +10,11 @@ object frmPasswordChange: TfrmPasswordChange Constraints.MaxWidth = 600 Constraints.MinHeight = 185 Constraints.MinWidth = 400 - ParentFont = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] OldCreateOrder = False Position = poMainFormCenter OnCreate = FormCreate diff --git a/source/change_password.pas b/source/change_password.pas index 0b1ea14b..530ecab2 100644 --- a/source/change_password.pas +++ b/source/change_password.pas @@ -8,7 +8,7 @@ uses Vcl.Menus, Clipbrd, Vcl.ComCtrls, System.Math; type - TfrmPasswordChange = class(TFormWithSizeGrip) + TfrmPasswordChange = class(TExtForm) lblHeading: TLabel; lblPassword: TLabel; lblRepeatPassword: TLabel; @@ -58,6 +58,7 @@ uses main, apphelpers; procedure TfrmPasswordChange.FormCreate(Sender: TObject); begin TranslateComponent(Self); + AddSizeGrip; end; diff --git a/source/column_selection.dfm b/source/column_selection.dfm index 6f47dce4..d1a25a18 100644 --- a/source/column_selection.dfm +++ b/source/column_selection.dfm @@ -8,7 +8,11 @@ object ColumnSelectionForm: TColumnSelectionForm Color = clBtnFace Constraints.MinHeight = 150 Constraints.MinWidth = 200 - ParentFont = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] OldCreateOrder = False OnClose = FormClose OnCreate = FormCreate diff --git a/source/column_selection.pas b/source/column_selection.pas index 5b16e50d..6b9f6191 100644 --- a/source/column_selection.pas +++ b/source/column_selection.pas @@ -7,7 +7,7 @@ uses apphelpers, gnugettext, extra_controls; type - TColumnSelectionForm = class(TFormWithSizeGrip) + TColumnSelectionForm = class(TExtForm) btnCancel: TButton; btnOK: TButton; chkSelectAll: TCheckBox; @@ -46,6 +46,7 @@ uses main; procedure TColumnSelectionForm.FormCreate(Sender: TObject); begin TranslateComponent(Self); + AddSizeGrip; Width := AppSettings.ReadInt(asColumnSelectorWidth); Height := AppSettings.ReadInt(asColumnSelectorHeight); FCheckedColumns := TStringList.Create; diff --git a/source/connections.dfm b/source/connections.dfm index f045703f..3a769f85 100644 --- a/source/connections.dfm +++ b/source/connections.dfm @@ -8,7 +8,11 @@ object connform: Tconnform Color = clBtnFace Constraints.MinHeight = 360 Constraints.MinWidth = 640 - ParentFont = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] OldCreateOrder = False ShowHint = True OnClose = FormClose diff --git a/source/connections.pas b/source/connections.pas index 9d447766..143443ad 100644 --- a/source/connections.pas +++ b/source/connections.pas @@ -14,7 +14,7 @@ uses dbconnection, gnugettext, SynRegExpr, System.Types, System.IOUtils, Vcl.GraphUtil; type - Tconnform = class(TFormWithSizeGrip) + Tconnform = class(TExtForm) btnCancel: TButton; btnOpen: TButton; btnSave: TButton; @@ -239,6 +239,7 @@ var begin // Fix GUI stuff TranslateComponent(Self); + AddSizeGrip; FixDropDownButtons(Self); lblDownloadPlink.Font.Style := [fsUnderline]; lblDownloadPlink.Font.Color := clBlue; diff --git a/source/copytable.dfm b/source/copytable.dfm index b8c5a3f5..35df58a0 100644 --- a/source/copytable.dfm +++ b/source/copytable.dfm @@ -7,7 +7,11 @@ object CopyTableForm: TCopyTableForm Color = clBtnFace Constraints.MinHeight = 340 Constraints.MinWidth = 380 - ParentFont = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] OldCreateOrder = False Position = poMainFormCenter OnClose = FormClose diff --git a/source/copytable.pas b/source/copytable.pas index c851e162..95c10780 100644 --- a/source/copytable.pas +++ b/source/copytable.pas @@ -8,7 +8,7 @@ uses dbconnection, dbstructures, VirtualTrees, SynEdit, SynMemo, Menus, gnugettext; type - TCopyTableForm = class(TFormWithSizeGrip) + TCopyTableForm = class(TExtForm) editNewTablename: TEdit; lblNewTablename: TLabel; btnCancel: TButton; @@ -68,6 +68,7 @@ const procedure TCopyTableForm.FormCreate(Sender: TObject); begin TranslateComponent(Self); + AddSizeGrip; FixDropDownButtons(Self); Width := AppSettings.ReadInt(asCopyTableWindowWidth); Height := AppSettings.ReadInt(asCopyTableWindowHeight); diff --git a/source/createdatabase.dfm b/source/createdatabase.dfm index 470b4df0..f67f5cf2 100644 --- a/source/createdatabase.dfm +++ b/source/createdatabase.dfm @@ -6,7 +6,11 @@ object CreateDatabaseForm: TCreateDatabaseForm ClientHeight = 227 ClientWidth = 317 Color = clBtnFace - ParentFont = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] OldCreateOrder = False Position = poOwnerFormCenter OnClose = FormClose diff --git a/source/createdatabase.pas b/source/createdatabase.pas index 995f9fdd..3b98234a 100644 --- a/source/createdatabase.pas +++ b/source/createdatabase.pas @@ -4,10 +4,10 @@ interface uses Windows, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, SynEdit, SynMemo, - dbconnection, dbstructures, gnugettext, SynRegExpr; + dbconnection, dbstructures, gnugettext, SynRegExpr, extra_controls; type - TCreateDatabaseForm = class(TForm) + TCreateDatabaseForm = class(TExtForm) editDBName: TEdit; lblDBName: TLabel; btnOK: TButton; diff --git a/source/data_sorting.dfm b/source/data_sorting.dfm index 3a126de1..30247d85 100644 --- a/source/data_sorting.dfm +++ b/source/data_sorting.dfm @@ -6,7 +6,11 @@ object DataSortingForm: TDataSortingForm ClientHeight = 97 ClientWidth = 204 Color = clBtnFace - ParentFont = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] OldCreateOrder = False OnClose = FormClose OnCreate = FormCreate diff --git a/source/data_sorting.pas b/source/data_sorting.pas index 3afa8973..cf5c1a6e 100644 --- a/source/data_sorting.pas +++ b/source/data_sorting.pas @@ -4,11 +4,11 @@ interface uses Windows, SysUtils, Classes, Controls, Forms, StdCtrls, ExtCtrls, ComCtrls, Buttons, - Vcl.Graphics, apphelpers, gnugettext; + Vcl.Graphics, apphelpers, gnugettext, extra_controls; type - TDataSortingForm = class(TForm) + TDataSortingForm = class(TExtForm) pnlBevel: TPanel; btnOK: TButton; btnCancel: TButton; diff --git a/source/editvar.dfm b/source/editvar.dfm index ec481394..8bae8e42 100644 --- a/source/editvar.dfm +++ b/source/editvar.dfm @@ -7,7 +7,11 @@ object frmEditVariable: TfrmEditVariable Color = clBtnFace Constraints.MinHeight = 260 Constraints.MinWidth = 200 - ParentFont = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] OldCreateOrder = False Position = poMainFormCenter OnCreate = FormCreate diff --git a/source/editvar.pas b/source/editvar.pas index 1548e877..c320c3a5 100644 --- a/source/editvar.pas +++ b/source/editvar.pas @@ -10,7 +10,7 @@ type TVarType = (vtString, vtNumeric, vtBoolean, vtEnum); EVariableError = class(Exception); - TfrmEditVariable = class(TFormWithSizeGrip) + TfrmEditVariable = class(TExtForm) btnOK: TButton; btnCancel: TButton; grpScope: TGroupBox; @@ -56,6 +56,7 @@ uses main, apphelpers; procedure TfrmEditVariable.FormCreate(Sender: TObject); begin TranslateComponent(Self); + AddSizeGrip; Width := AppSettings.ReadInt(asEditVarWindowWidth); Height := AppSettings.ReadInt(asEditVarWindowHeight); end; diff --git a/source/exportgrid.dfm b/source/exportgrid.dfm index 3b161b37..f47f0e54 100644 --- a/source/exportgrid.dfm +++ b/source/exportgrid.dfm @@ -8,7 +8,11 @@ object frmExportGrid: TfrmExportGrid Color = clBtnFace Constraints.MinHeight = 450 Constraints.MinWidth = 350 - ParentFont = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] OldCreateOrder = False Position = poMainFormCenter OnClose = FormClose diff --git a/source/exportgrid.pas b/source/exportgrid.pas index fcc4fbd8..692a9733 100644 --- a/source/exportgrid.pas +++ b/source/exportgrid.pas @@ -10,7 +10,7 @@ uses type TGridExportFormat = (efExcel, efCSV, efHTML, efXML, efSQLInsert, efSQLReplace, efSQLDeleteInsert, efLaTeX, efWiki, efPHPArray, efMarkDown, efJSON); - TfrmExportGrid = class(TFormWithSizeGrip) + TfrmExportGrid = class(TExtForm) btnOK: TButton; btnCancel: TButton; grpFormat: TRadioGroup; @@ -104,6 +104,7 @@ var FormatDesc: String; begin TranslateComponent(Self); + AddSizeGrip; Width := AppSettings.ReadInt(asGridExportWindowWidth); Height := AppSettings.ReadInt(asGridExportWindowHeight); editFilename.Text := AppSettings.ReadString(asGridExportFilename); diff --git a/source/extra_controls.pas b/source/extra_controls.pas index 3b2b1d6b..7f971d3d 100644 --- a/source/extra_controls.pas +++ b/source/extra_controls.pas @@ -4,15 +4,15 @@ interface uses Classes, SysUtils, Forms, Windows, Messages, System.Types, StdCtrls, Clipbrd, - SizeGrip, SizeGripThemed; + SizeGrip, SizeGripThemed, apphelpers, Vcl.Graphics; type // Form with a sizegrip in the lower right corner, without the need for a statusbar - TFormWithSizeGrip = class(TForm) - private - FGripper: TSizeGripThemed; + TExtForm = class(TForm) public constructor Create(AOwner: TComponent); override; + procedure AddSizeGrip; + class procedure InheritFont(AFont: TFont; Form: TForm); end; // Memo replacement which accepts any line break format TLineNormalizingMemo = class(TMemo) @@ -25,11 +25,18 @@ type implementation -{ TFormWithSizeGrip } +{ TExtForm } -constructor TFormWithSizeGrip.Create(AOwner: TComponent); +constructor TExtForm.Create(AOwner: TComponent); begin inherited; + InheritFont(Font, Self); +end; + +procedure TExtForm.AddSizeGrip; +var + FGripper: TSizeGripThemed; +begin FGripper := TSizeGripThemed.Create(Self); FGripper.Themed := True; FGripper.Enabled := True; @@ -37,6 +44,41 @@ begin end; +class procedure TExtForm.InheritFont(AFont: TFont; Form: TForm); +var + LogFont: TLogFont; + GUIFontName: String; +begin + // Set custom font if set, or default system font. + // In high-dpi mode, the font *size* is increased automatically somewhere in the VCL, + // caused by a form's .Scaled property. So we don't increase it here again. + // To test this, you really need to log off/on Windows! + GUIFontName := AppSettings.ReadString(asGUIFontName); + if not GUIFontName.IsEmpty then begin + // Apply user specified font + AFont.Name := GUIFontName; + // Set size on top of automatic dpi-increased size + AFont.Size := Round(AppSettings.ReadInt(asGUIFontSize) * DpiScaleFactor(Form)); + end else begin + // Apply system font. See issue #3204. + // Code taken from http://www.gerixsoft.com/blog/delphi/system-font + if SystemParametersInfo(SPI_GETICONTITLELOGFONT, SizeOf(TLogFont), @LogFont, 0) then begin + AFont.Height := Round(LogFont.lfHeight * DpiScaleFactor(Form)); + AFont.Orientation := LogFont.lfOrientation; + AFont.Charset := TFontCharset(LogFont.lfCharSet); + AFont.Name := PChar(@LogFont.lfFaceName); + case LogFont.lfPitchAndFamily and $F of + VARIABLE_PITCH: AFont.Pitch := fpVariable; + FIXED_PITCH: AFont.Pitch := fpFixed; + else AFont.Pitch := fpDefault; + end; + end else begin + ErrorDialog('Could not detect system font, using SystemParametersInfo.'); + end; + end; +end; + + { TLineNormalizingMemo } diff --git a/source/insertfiles.dfm b/source/insertfiles.dfm index a3e9c541..67cf56af 100644 --- a/source/insertfiles.dfm +++ b/source/insertfiles.dfm @@ -8,7 +8,11 @@ object frmInsertFiles: TfrmInsertFiles Color = clBtnFace Constraints.MinHeight = 353 Constraints.MinWidth = 475 - ParentFont = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] OldCreateOrder = False Position = poOwnerFormCenter OnClose = FormClose diff --git a/source/insertfiles.pas b/source/insertfiles.pas index 251eb536..9e9bbd9e 100644 --- a/source/insertfiles.pas +++ b/source/insertfiles.pas @@ -25,7 +25,7 @@ type end; PFileInfo = ^TFileInfo; - TfrmInsertFiles = class(TFormWithSizeGrip) + TfrmInsertFiles = class(TExtForm) btnInsert: TButton; btnCancel: TButton; OpenDialog: TOpenDialog; @@ -117,6 +117,7 @@ const procedure TfrmInsertFiles.FormCreate(Sender: TObject); begin TranslateComponent(Self); + AddSizeGrip; ListFiles.Images := GetSystemImageList; DragAcceptFiles(Handle, True); MainForm.RestoreListSetup(ListColumns); diff --git a/source/loaddata.dfm b/source/loaddata.dfm index 51769eca..b65991ad 100644 --- a/source/loaddata.dfm +++ b/source/loaddata.dfm @@ -7,7 +7,11 @@ object loaddataform: Tloaddataform Color = clBtnFace Constraints.MinHeight = 530 Constraints.MinWidth = 525 - ParentFont = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] OldCreateOrder = False Position = poMainFormCenter OnClose = FormClose diff --git a/source/loaddata.pas b/source/loaddata.pas index 1f586fb6..ef15b30d 100644 --- a/source/loaddata.pas +++ b/source/loaddata.pas @@ -14,7 +14,7 @@ uses dbconnection, dbstructures, gnugettext; type - Tloaddataform = class(TFormWithSizeGrip) + Tloaddataform = class(TExtForm) btnImport: TButton; btnCancel: TButton; lblDatabase: TLabel; @@ -94,6 +94,7 @@ const procedure Tloaddataform.FormCreate(Sender: TObject); begin TranslateComponent(Self); + AddSizeGrip; // Restore settings Width := AppSettings.ReadInt(asCSVImportWindowWidth); Height := AppSettings.ReadInt(asCSVImportWindowHeight); diff --git a/source/loginform.dfm b/source/loginform.dfm index 46efff8c..69c69238 100644 --- a/source/loginform.dfm +++ b/source/loginform.dfm @@ -6,7 +6,11 @@ object frmLogin: TfrmLogin ClientHeight = 176 ClientWidth = 270 Color = clBtnFace - ParentFont = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] OldCreateOrder = False Position = poScreenCenter OnCreate = FormCreate @@ -26,8 +30,6 @@ object frmLogin: TfrmLogin Default = True ModalResult = 1 TabOrder = 1 - ExplicitLeft = 160 - ExplicitTop = 104 end object pnlBackground: TPanel Left = 0 @@ -42,8 +44,6 @@ object frmLogin: TfrmLogin ParentBackground = False ShowCaption = False TabOrder = 0 - ExplicitWidth = 266 - ExplicitHeight = 98 DesignSize = ( 270 137) @@ -96,7 +96,6 @@ object frmLogin: TfrmLogin Anchors = [akLeft, akRight, akBottom] TabOrder = 0 Text = 'editUsername' - ExplicitWidth = 268 end end end diff --git a/source/main.dfm b/source/main.dfm index 688f8011..e5588764 100644 --- a/source/main.dfm +++ b/source/main.dfm @@ -4,7 +4,11 @@ object MainForm: TMainForm ClientHeight = 466 ClientWidth = 977 Color = clBtnFace - ParentFont = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] Menu = MainMenu1 OldCreateOrder = True Position = poDesigned diff --git a/source/main.pas b/source/main.pas index 7a55e79d..4dd73e56 100644 --- a/source/main.pas +++ b/source/main.pas @@ -19,7 +19,7 @@ uses insertfiles, searchreplace, loaddata, copytable, VirtualTrees.HeaderPopup, Cromis.DirectoryWatch, SyncDB, gnugettext, JumpList, System.Actions, System.UITypes, pngimage, System.ImageList, Vcl.Styles.UxTheme, Vcl.Styles.Utils.Menus, Vcl.Styles.Utils.Forms, - Vcl.VirtualImageList, Vcl.BaseImageCollection, Vcl.ImageCollection, System.IniFiles; + Vcl.VirtualImageList, Vcl.BaseImageCollection, Vcl.ImageCollection, System.IniFiles, extra_controls; type @@ -154,7 +154,7 @@ type function SetThumbnailClip(hwnd: HWND; var prcClip: TRect): HRESULT; stdcall; end; - TMainForm = class(TForm) + TMainForm = class(TExtForm) MainMenu1: TMainMenu; MainMenuFile: TMenuItem; FileNewItem: TMenuItem; @@ -1830,7 +1830,7 @@ begin Delimiter := AppSettings.ReadString(asDelimiter); - InheritFont(SynCompletionProposal.Font); + InheritFont(SynCompletionProposal.Font, Self); // Simulated link label, has non inherited blue font color lblExplainProcess.Font.Color := clBlue; lblExplainProcessAnalyzer.Font.Color := clBlue; @@ -1849,7 +1849,7 @@ begin QueryTab.spltHelpers := spltQueryHelpers; QueryTab.spltQuery := spltQuery; QueryTab.tabsetQuery := tabsetQuery; - InheritFont(QueryTab.tabsetQuery.Font); + InheritFont(QueryTab.tabsetQuery.Font, Self); QueryTab.ResultTabs := TResultTabs.Create(True); QueryTabs := TObjectList.Create(True); @@ -2041,6 +2041,7 @@ begin LogSQL(f_('Theme: "%s"', [TStyleManager.ActiveStyle.Name]), lcDebug); LogSQL(f_('Pixels per inch on current monitor: %d', [Monitor.PixelsPerInch]), lcDebug); + // Now we are free to use certain methods, which are otherwise fired too early MainFormCreated := True; end; @@ -5005,6 +5006,8 @@ var Sess, OldSettingsPath: String; LogIt: Boolean; begin + if not MainFormCreated then + Exit; if csDestroying in ComponentState then Exit; @@ -10749,7 +10752,7 @@ begin // Prevent various problems with alignment of controls. See http://www.heidisql.com/forum.php?t=18924 QueryTab.tabsetQuery.Top := QueryTab.spltQuery.Top + QueryTab.spltQuery.Height; QueryTab.tabsetQuery.Align := tabsetQuery.Align; - InheritFont(QueryTab.tabsetQuery.Font); + InheritFont(QueryTab.tabsetQuery.Font, Self); QueryTab.tabsetQuery.Images := tabsetQuery.Images; QueryTab.tabsetQuery.Style := tabsetQuery.Style; QueryTab.tabsetQuery.TabHeight := tabsetQuery.TabHeight; diff --git a/source/options.dfm b/source/options.dfm index 3cbc2b6d..a07a4266 100644 --- a/source/options.dfm +++ b/source/options.dfm @@ -8,7 +8,11 @@ object optionsform: Toptionsform Color = clBtnFace Constraints.MinHeight = 480 Constraints.MinWidth = 600 - ParentFont = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] OldCreateOrder = False Position = poMainFormCenter OnClose = FormClose diff --git a/source/options.pas b/source/options.pas index af793e38..7fdb9c4c 100644 --- a/source/options.pas +++ b/source/options.pas @@ -31,7 +31,7 @@ type end; TGridColorsPresetList = TObjectList; - Toptionsform = class(TFormWithSizeGrip) + Toptionsform = class(TExtForm) pagecontrolMain: TPageControl; tabMisc: TTabSheet; btnCancel: TButton; @@ -484,6 +484,7 @@ var IconPack: String; begin TranslateComponent(Self); + AddSizeGrip; Width := AppSettings.ReadInt(asPreferencesWindowWidth); Height := AppSettings.ReadInt(asPreferencesWindowHeight); diff --git a/source/printlist.dfm b/source/printlist.dfm index 2571a6b3..10640804 100644 --- a/source/printlist.dfm +++ b/source/printlist.dfm @@ -6,7 +6,11 @@ object printlistForm: TprintlistForm ClientHeight = 92 ClientWidth = 377 Color = clBtnFace - ParentFont = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] OldCreateOrder = False Position = poMainFormCenter OnCreate = FormCreate diff --git a/source/searchreplace.dfm b/source/searchreplace.dfm index 1c12c9ea..408befd6 100644 --- a/source/searchreplace.dfm +++ b/source/searchreplace.dfm @@ -8,7 +8,11 @@ object frmSearchReplace: TfrmSearchReplace Color = clBtnFace Constraints.MinHeight = 320 Constraints.MinWidth = 400 - ParentFont = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] OldCreateOrder = False Position = poOwnerFormCenter OnCreate = FormCreate diff --git a/source/searchreplace.pas b/source/searchreplace.pas index f6813c71..170de7ca 100644 --- a/source/searchreplace.pas +++ b/source/searchreplace.pas @@ -8,7 +8,7 @@ uses SynEditRegexSearch, SynEditMiscClasses, SynEditSearch, extra_controls; type - TfrmSearchReplace = class(TFormWithSizeGrip) + TfrmSearchReplace = class(TExtForm) btnCancel: TButton; btnReplaceAll: TButton; lblSearch: TLabel; @@ -60,6 +60,7 @@ uses apphelpers, main; procedure TfrmSearchReplace.FormCreate(Sender: TObject); begin TranslateComponent(Self); + AddSizeGrip; comboSearch.Items.Text := AppSettings.ReadString(asFindDialogSearchHistory); comboReplace.Items.Text := AppSettings.ReadString(asFindDialogReplaceHistory); comboSearch.Text := ''; diff --git a/source/selectdbobject.dfm b/source/selectdbobject.dfm index 94f62ec7..58eb81ab 100644 --- a/source/selectdbobject.dfm +++ b/source/selectdbobject.dfm @@ -7,7 +7,11 @@ object frmSelectDBObject: TfrmSelectDBObject Color = clBtnFace Constraints.MinHeight = 250 Constraints.MinWidth = 200 - ParentFont = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] OldCreateOrder = False Position = poOwnerFormCenter OnCreate = FormCreate diff --git a/source/selectdbobject.pas b/source/selectdbobject.pas index 5934f63f..1cf355ab 100644 --- a/source/selectdbobject.pas +++ b/source/selectdbobject.pas @@ -7,7 +7,7 @@ uses dbconnection, gnugettext; type - TfrmSelectDBObject = class(TFormWithSizeGrip) + TfrmSelectDBObject = class(TExtForm) TreeDBO: TVirtualStringTree; btnOK: TButton; btnCancel: TButton; @@ -63,6 +63,7 @@ end; procedure TfrmSelectDBObject.FormCreate(Sender: TObject); begin TranslateComponent(Self); + AddSizeGrip; Width := AppSettings.ReadInt(asSelectDBOWindowWidth); Height := AppSettings.ReadInt(asSelectDBOWindowHeight); TreeDBO.TreeOptions := MainForm.DBtree.TreeOptions; diff --git a/source/sqlhelp.dfm b/source/sqlhelp.dfm index 7fde2009..2dff90a0 100644 --- a/source/sqlhelp.dfm +++ b/source/sqlhelp.dfm @@ -5,7 +5,11 @@ object frmSQLhelp: TfrmSQLhelp ClientHeight = 355 ClientWidth = 582 Color = clBtnFace - ParentFont = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] FormStyle = fsStayOnTop OldCreateOrder = False OnClose = FormClose diff --git a/source/sqlhelp.pas b/source/sqlhelp.pas index e21018c8..077f22fd 100644 --- a/source/sqlhelp.pas +++ b/source/sqlhelp.pas @@ -9,7 +9,7 @@ uses dbconnection, gnugettext; type - TfrmSQLhelp = class(TFormWithSizeGrip) + TfrmSQLhelp = class(TExtForm) URIOpenerDescription: TSynURIOpener; URIHighlighter: TSynURISyn; URIOpenerExample: TSynURIOpener; @@ -94,6 +94,7 @@ begin Caption := DEFAULT_WINDOW_CAPTION; FixVT(treeTopics); TranslateComponent(Self); + AddSizeGrip; treeTopics.Clear; FreeAndNil(FRootTopics); diff --git a/source/syncdb.dfm b/source/syncdb.dfm index 7b695690..8989d296 100644 --- a/source/syncdb.dfm +++ b/source/syncdb.dfm @@ -7,7 +7,11 @@ object frmSyncDB: TfrmSyncDB Color = clBtnFace Constraints.MinHeight = 400 Constraints.MinWidth = 550 - ParentFont = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] OldCreateOrder = False Position = poMainFormCenter OnClose = FormClose diff --git a/source/syncdb.pas b/source/syncdb.pas index f225b3d3..83b6ff56 100644 --- a/source/syncdb.pas +++ b/source/syncdb.pas @@ -8,7 +8,7 @@ uses dbconnection, gnugettext; type - TfrmSyncDB = class(TFormWithSizeGrip) + TfrmSyncDB = class(TExtForm) treeSource: TVirtualStringTree; lblSource: TLabel; grpTarget: TGroupBox; @@ -108,6 +108,7 @@ var begin Caption := MainForm.actSynchronizeDatabase.Caption; TranslateComponent(Self); + AddSizeGrip; FixVT(treeSource); FixVT(treeDifferences); diff --git a/source/tabletools.dfm b/source/tabletools.dfm index 65dec7bb..178b95a3 100644 --- a/source/tabletools.dfm +++ b/source/tabletools.dfm @@ -6,7 +6,11 @@ object frmTableTools: TfrmTableTools ClientHeight = 383 ClientWidth = 764 Color = clBtnFace - ParentFont = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] OldCreateOrder = False Position = poMainFormCenter OnClose = FormClose diff --git a/source/tabletools.pas b/source/tabletools.pas index 54f194b5..fb363a9e 100644 --- a/source/tabletools.pas +++ b/source/tabletools.pas @@ -15,7 +15,7 @@ uses type TToolMode = (tmMaintenance, tmFind, tmSQLExport, tmBulkTableEdit); - TfrmTableTools = class(TFormWithSizeGrip) + TfrmTableTools = class(TExtForm) btnCloseOrCancel: TButton; pnlTop: TPanel; TreeObjects: TVirtualStringTree; @@ -226,6 +226,7 @@ var Obj: TDBObject; begin TranslateComponent(Self); + AddSizeGrip; FixDropDownButtons(Self); OUTPUT_FILE := _('Single .sql file'); OUTPUT_FILE_COMPRESSED := _('ZIP compressed .sql file'); diff --git a/source/texteditor.dfm b/source/texteditor.dfm index f6733bbe..8b49b0bb 100644 --- a/source/texteditor.dfm +++ b/source/texteditor.dfm @@ -7,7 +7,11 @@ object frmTextEditor: TfrmTextEditor Color = clBtnFace Constraints.MinHeight = 100 Constraints.MinWidth = 130 - ParentFont = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] OldCreateOrder = False Position = poMainFormCenter OnClose = FormClose diff --git a/source/texteditor.pas b/source/texteditor.pas index 5085ddb1..80eedc47 100644 --- a/source/texteditor.pas +++ b/source/texteditor.pas @@ -11,7 +11,7 @@ uses {$I const.inc} type - TfrmTextEditor = class(TFormWithSizeGrip) + TfrmTextEditor = class(TExtForm) Panel1: TPanel; tlbStandard: TToolBar; btnWrap: TToolButton; @@ -185,6 +185,7 @@ end; procedure TfrmTextEditor.FormCreate(Sender: TObject); begin + AddSizeGrip; FmemoText := TLineNormalizingMemo.Create(Self); FmemoText.Parent := Self; FmemoText.Align := alClient; diff --git a/source/theme_preview.pas b/source/theme_preview.pas index 23195f5f..083e5dab 100644 --- a/source/theme_preview.pas +++ b/source/theme_preview.pas @@ -5,10 +5,10 @@ interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.StdCtrls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, apphelpers, - Vcl.ComCtrls, Vcl.GraphUtil, Vcl.Imaging.pngimage; + Vcl.ComCtrls, Vcl.GraphUtil, Vcl.Imaging.pngimage, extra_controls; type - TfrmThemePreview = class(TForm) + TfrmThemePreview = class(TExtForm) StatusBarMain: TStatusBar; ScrollBoxImage: TScrollBox; imagePreview: TImage; diff --git a/source/updatecheck.dfm b/source/updatecheck.dfm index d2afdd61..6cca87ba 100644 --- a/source/updatecheck.dfm +++ b/source/updatecheck.dfm @@ -6,7 +6,11 @@ object frmUpdateCheck: TfrmUpdateCheck ClientHeight = 425 ClientWidth = 384 Color = clBtnFace - ParentFont = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] OldCreateOrder = False Position = poMainFormCenter OnCreate = FormCreate diff --git a/source/updatecheck.pas b/source/updatecheck.pas index a4e85e58..e486549a 100644 --- a/source/updatecheck.pas +++ b/source/updatecheck.pas @@ -4,10 +4,10 @@ interface uses Windows, Messages, SysUtils, Classes, Forms, StdCtrls, IniFiles, Controls, Graphics, - apphelpers, gnugettext, ExtCtrls; + apphelpers, gnugettext, ExtCtrls, extra_controls; type - TfrmUpdateCheck = class(TForm) + TfrmUpdateCheck = class(TExtForm) btnCancel: TButton; groupBuild: TGroupBox; btnBuild: TButton; diff --git a/source/usermanager.dfm b/source/usermanager.dfm index 5238449f..73169baf 100644 --- a/source/usermanager.dfm +++ b/source/usermanager.dfm @@ -8,7 +8,11 @@ object UserManagerForm: TUserManagerForm Color = clBtnFace Constraints.MinHeight = 350 Constraints.MinWidth = 450 - ParentFont = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] OldCreateOrder = False Position = poMainFormCenter OnClose = FormClose diff --git a/source/usermanager.pas b/source/usermanager.pas index 8a573cf4..1fcb87d7 100644 --- a/source/usermanager.pas +++ b/source/usermanager.pas @@ -40,7 +40,7 @@ type EInputError = class(Exception); - TUserManagerForm = class(TFormWithSizeGrip) + TUserManagerForm = class(TExtForm) btnCancel: TButton; btnSave: TButton; pnlLeft: TPanel; @@ -215,6 +215,7 @@ begin FixVT(treePrivs); Mainform.RestoreListSetup(listUsers); TranslateComponent(Self); + AddSizeGrip; PrivsRead := Explode(',', 'SELECT,SHOW VIEW,SHOW DATABASES,PROCESS,EXECUTE'); PrivsWrite := Explode(',', 'ALTER,CREATE,DROP,DELETE,UPDATE,INSERT,ALTER ROUTINE,CREATE ROUTINE,CREATE TEMPORARY TABLES,CREATE VIEW,INDEX,TRIGGER,EVENT,REFERENCES,CREATE TABLESPACE'); PrivsAdmin := Explode(',', 'RELOAD,SHUTDOWN,REPLICATION CLIENT,REPLICATION SLAVE,SUPER,LOCK TABLES,GRANT,FILE,CREATE USER');