Use Vista's Segeo font for all forms by using the SetVistaFonts() in mainform plus the new routine InheritFont() which simply overtakes fontname and size from the mainform to all other forms.

This commit is contained in:
Ansgar Becker
2008-08-29 18:20:14 +00:00
parent 084914b077
commit 9a52593dc2
42 changed files with 147 additions and 34 deletions

View File

@ -91,6 +91,10 @@ begin
// Define the current cursor like a clock
Screen.Cursor := crHourGlass;
InheritFont(Font);
InheritFont(ProductName.Font);
InheritFont(LabelWebpage.Font);
// Avoid scroll by removing blank line outside visible area in Authors text box
MemoAuthors.Text := TrimRight(MemoAuthors.Text);

View File

@ -105,15 +105,9 @@ object MDIChild: TMDIChild
Height = 336
ActivePage = tabHost
Align = alClient
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
HotTrack = True
Images = MainForm.PngImageListMain
MultiLine = True
ParentFont = False
TabHeight = 22
TabOrder = 1
OnChange = pcChange
@ -768,12 +762,6 @@ object MDIChild: TMDIChild
Anchors = [akLeft, akTop, akRight, akBottom]
AutoSize = False
Caption = 'Data'
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
Layout = tlCenter
WordWrap = True
end

View File

@ -848,6 +848,17 @@ var
fontname, datafontname : String;
fontsize, datafontsize : Integer;
begin
InheritFont(Font);
InheritFont(ListVariables.Header.Font);
InheritFont(ListStatus.Header.Font);
InheritFont(ListProcesses.Header.Font);
InheritFont(ListCommandstats.Header.Font);
InheritFont(ListTables.Header.Font);
InheritFont(ListColumns.Header.Font);
InheritFont(DataGrid.Header.Font);
InheritFont(QueryGrid.Header.Font);
InheritFont(tabsetQueryHelpers.Font);
InheritFont(SynCompletionProposal1.Font);
// Other values:
pnlQueryMemo.Height := Mainform.GetRegValue(REGNAME_QUERYMEMOHEIGHT, pnlQueryMemo.Height);
pnlQueryHelpers.Width := Mainform.GetRegValue(REGNAME_QUERYHELPERSWIDTH, pnlQueryHelpers.Width);

View File

@ -13,6 +13,7 @@ object ColumnSelectionForm: TColumnSelectionForm
Font.Style = []
OldCreateOrder = False
OnClose = FormClose
OnCreate = FormCreate
OnDeactivate = FormDeactivate
OnShow = FormShow
PixelsPerInch = 96

View File

@ -22,6 +22,7 @@ type
procedure chkSortClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormDeactivate(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
@ -39,6 +40,13 @@ uses MAIN, helpers;
{$R *.dfm}
procedure TColumnSelectionForm.FormCreate(Sender: TObject);
begin
InheritFont(Font);
end;
{**
FormShow
}

View File

@ -7,7 +7,7 @@ object connform: Tconnform
ClientHeight = 326
ClientWidth = 462
Color = clBtnFace
Constraints.MaxHeight = 360
Constraints.MaxHeight = 362
Constraints.MinHeight = 360
Constraints.MinWidth = 470
Font.Charset = DEFAULT_CHARSET
@ -100,9 +100,9 @@ object connform: Tconnform
Tag = 13
Left = 152
Top = 234
Width = 66
Height = 39
Caption = 'Data&base(s): (separated by semicolon)'
Width = 63
Height = 13
Caption = 'Data&base(s):'
FocusControl = EditOnlyDBs
WordWrap = True
end
@ -3045,7 +3045,7 @@ object connform: Tconnform
AutoCompleteDelay = 5000
Style = csDropDownList
Anchors = [akLeft, akTop, akRight]
ItemHeight = 13
ItemHeight = 0
TabOrder = 0
OnClick = ComboBoxDescriptionClick
end
@ -3090,7 +3090,10 @@ object connform: Tconnform
Top = 233
Width = 220
Height = 21
Hint = 'A list of wanted databases, separated by semicolon'
Anchors = [akLeft, akTop, akRight]
ParentShowHint = False
ShowHint = True
TabOrder = 7
OnChange = Modified
end

View File

@ -92,6 +92,7 @@ begin
btnSave.PngImage := Mainform.PngImageListMain.PngImages[10].PngImage;
btnDelete.PngImage := Mainform.PngImageListMain.PngImages[26].PngImage;
btnEditDesc.PngImage := Mainform.PngImageListMain.PngImages[33].PngImage;
InheritFont(Font);
end;

View File

@ -13,6 +13,7 @@ object CopyTableForm: TCopyTableForm
Font.Style = []
OldCreateOrder = False
Position = poMainFormCenter
OnCreate = FormCreate
OnShow = FormShow
DesignSize = (
302

View File

@ -32,6 +32,7 @@ type
procedure editNewTablenameChange(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure ButtonOKClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
oldTableName : WideString;
@ -103,6 +104,12 @@ begin
end;
procedure TCopyTableForm.FormCreate(Sender: TObject);
begin
InheritFont(Font);
end;
procedure TCopyTableForm.FormShow(Sender: TObject);
var
i : Integer;

View File

@ -52,6 +52,8 @@ procedure TCreateDatabaseForm.FormCreate(Sender: TObject);
var
charset: String;
begin
InheritFont(Font);
try
dsCollations := Mainform.Childwin.GetResults('SHOW COLLATION');
// Detect servers default charset

View File

@ -116,6 +116,8 @@ begin
ButtonMoveUp.PngImage := Mainform.PngImageListMain.PngImages[74].PngImage;
ButtonMoveDown.PngImage := Mainform.PngImageListMain.PngImages[75].PngImage;
InheritFont(Font);
try
dsCollations := Mainform.Childwin.GetResults('SHOW COLLATION');
// Detect servers default charset

View File

@ -13,6 +13,7 @@ object DataSortingForm: TDataSortingForm
Font.Style = []
OldCreateOrder = False
OnClose = FormClose
OnCreate = FormCreate
OnDeactivate = FormDeactivate
OnShow = FormShow
PixelsPerInch = 96

View File

@ -20,6 +20,7 @@ type
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormDeactivate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
ColumnNames : TWideStringList;
@ -47,6 +48,12 @@ uses main, helpers;
{$R *.dfm}
procedure TDataSortingForm.FormCreate(Sender: TObject);
begin
InheritFont(Font);
end;
{**
Initialization
}

View File

@ -13,6 +13,7 @@ object frmEditVariable: TfrmEditVariable
Font.Style = []
OldCreateOrder = False
Position = poMainFormCenter
OnCreate = FormCreate
OnShow = FormShow
DesignSize = (
301

View File

@ -16,6 +16,7 @@ type
procedure btnOKClick(Sender: TObject);
procedure editValueChange(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
@ -30,6 +31,12 @@ uses main, helpers;
{$R *.dfm}
procedure TfrmEditVariable.FormCreate(Sender: TObject);
begin
InheritFont(Font);
end;
procedure TfrmEditVariable.FormShow(Sender: TObject);
begin
lblValue.Caption := 'New value for "'+VarName+'":';

View File

@ -168,6 +168,7 @@ begin
btnFileBrowse.PngImage := Mainform.PngImageListMain.PngImages[10].PngImage;
btnDirectoryBrowse.PngImage := Mainform.PngImageListMain.PngImages[51].PngImage;
SetWindowSizeGrip( Self.Handle, True );
InheritFont(Font);
end;

View File

@ -256,9 +256,9 @@ object FieldEditForm: TFieldEditForm
OnClick = btnDeleteAllColumnsFromIndexClick
end
object ComboBoxKeys: TComboBoxEx
Left = 72
Left = 82
Top = 8
Width = 209
Width = 199
Height = 22
ItemsEx = <>
Style = csExDropDownList
@ -277,18 +277,18 @@ object FieldEditForm: TFieldEditForm
OnClick = CheckBoxUniqueClick
end
object ButtonAdd: TButton
Left = 144
Left = 175
Top = 32
Width = 65
Width = 50
Height = 25
Caption = 'Add'
TabOrder = 2
OnClick = ButtonAddClick
end
object ButtonDelete: TButton
Left = 216
Left = 231
Top = 32
Width = 65
Width = 50
Height = 25
Caption = 'Delete'
Enabled = False
@ -318,9 +318,9 @@ object FieldEditForm: TFieldEditForm
OnDblClick = AddField
end
object ButtonAddPrimary: TButton
Left = 72
Left = 82
Top = 32
Width = 67
Width = 87
Height = 25
Caption = 'Add Primary'
Enabled = False

View File

@ -145,6 +145,7 @@ begin
btnAddColumnToIndex.PngImage := Mainform.PngImageListMain.PngImages[76].PngImage;
btnDeleteAllColumnsFromIndex.PngImage := Mainform.PngImageListMain.PngImages[79].PngImage;
btnDeleteColumnFromIndex.PngImage := Mainform.PngImageListMain.PngImages[77].PngImage;
InheritFont(Font);
end;

View File

@ -290,6 +290,7 @@ begin
ListViewFiles.SmallImages:=SmallImages;
DragAcceptFiles( Handle , True );
SetWindowSizeGrip( Self.Handle, True );
InheritFont(Font);
end;

View File

@ -14,6 +14,7 @@ object frmInsertFilesProgress: TfrmInsertFilesProgress
OldCreateOrder = False
Position = poOwnerFormCenter
OnClose = FormClose
OnCreate = FormCreate
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13

View File

@ -21,6 +21,7 @@ type
procedure Button1Click(Sender: TObject);
procedure ProcessFiles(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
FInsertFilesForm : Pointer;
canceled : Boolean;
@ -150,6 +151,11 @@ begin
Action := caFree;
end;
procedure TfrmInsertFilesProgress.FormCreate(Sender: TObject);
begin
InheritFont(Font);
end;
procedure TfrmInsertFilesProgress.FormShow(Sender: TObject);
begin
ProgressBar1.Position := 0;

View File

@ -102,6 +102,7 @@ begin
btnOpenFile.PngImage := Mainform.PngImageListMain.PngImages[52].PngImage;
btnColUp.PngImage := Mainform.PngImageListMain.PngImages[74].PngImage;
btnColDown.PngImage := Mainform.PngImageListMain.PngImages[75].PngImage;
InheritFont(Font);
end;
procedure Tloaddataform.FormShow(Sender: TObject);

View File

@ -331,6 +331,9 @@ type
end;
procedure InheritFont(AFont: TFont);
var
MainForm : TMainForm;
appstarted : Boolean = false; // see connections.pas
@ -378,11 +381,18 @@ uses
UpdateCheck,
fieldeditor,
createdatabase,
createtable;
createtable,
uVistaFuncs;
{$R *.DFM}
procedure InheritFont(AFont: TFont);
begin
AFont.Name := Mainform.Font.Name;
AFont.Size := Mainform.Font.Size;
end;
procedure TMainForm.HandleWMComplete(var msg: TMessage);
begin
HandleWMCompleteMessage(msg);
@ -630,6 +640,9 @@ begin
// Use new Vista dialogs per default.
//UseLatestCommonDialogs := True;
// Delphi work around to force usage of Vista's default font (other OSes will be unaffected)
SetVistaFonts(Font);
refreshMonitorConfig;
loadWindowConfig;

View File

@ -16,6 +16,7 @@ object frmMemoEditor: TfrmMemoEditor
OldCreateOrder = False
Position = poMainFormCenter
OnCloseQuery = FormCloseQuery
OnCreate = FormCreate
OnDestroy = FormDestroy
OnShow = FormShow
DesignSize = (

View File

@ -26,6 +26,7 @@ type
procedure memoTextChange(Sender: TObject);
procedure memoTextKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
FModified: Boolean;
@ -43,6 +44,12 @@ uses main, helpers;
{$R *.dfm}
procedure TfrmMemoEditor.FormCreate(Sender: TObject);
begin
InheritFont(Font);
end;
procedure TfrmMemoEditor.FormDestroy(Sender: TObject);
var
reg: TRegistry;

View File

@ -70,6 +70,7 @@ begin
Width := Mainform.GetRegValue(REGNAME_MAINTWINWIDTH, Width);
Height := Mainform.GetRegValue(REGNAME_MAINTWINHEIGHT, Height);
SetWindowSizeGrip( Self.Handle, True );
InheritFont(Font);
end;

View File

@ -14,6 +14,7 @@ object optionsform: Toptionsform
Font.Style = []
OldCreateOrder = False
Position = poMainFormCenter
OnCreate = FormCreate
OnShow = FormShow
DesignSize = (
421

View File

@ -104,6 +104,7 @@ type
var AllowChange: Boolean);
procedure btnOpenLogFolderClick(Sender: TObject);
procedure chkUpdatecheckClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
@ -241,6 +242,11 @@ end;
procedure Toptionsform.FormCreate(Sender: TObject);
begin
InheritFont(Font);
end;
procedure Toptionsform.FormShow(Sender: TObject);
// ----------- Callback.Funktion for Fixed_Pitch -----------------//

View File

@ -13,6 +13,7 @@ object printlistForm: TprintlistForm
Font.Style = []
OldCreateOrder = False
Position = poMainFormCenter
OnCreate = FormCreate
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13

View File

@ -27,6 +27,7 @@ type
procedure btnPrintClick(Sender: TObject);
procedure chkAllColumnsClick(Sender: TObject);
procedure comboPrintersChange(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
list : TVirtualStringTree;
title : String;
@ -58,6 +59,11 @@ begin
end;
procedure TprintlistForm.FormCreate(Sender: TObject);
begin
InheritFont(Font);
end;
procedure TprintlistForm.FormShow(Sender: TObject);
var
i, chkTop, chkCount : Integer;

View File

@ -15,6 +15,7 @@ object frmQueryProgress: TfrmQueryProgress
OldCreateOrder = False
Position = poScreenCenter
OnClose = FormClose
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object lblStatusMsg: TLabel

View File

@ -12,6 +12,7 @@ type
lblStatusMsg: TLabel;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure btnAbortClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
procedure HandleQueryNotificationMsg(var AMessage : TMessage); message WM_MYSQL_THREAD_NOTIFY;
public
@ -25,7 +26,8 @@ implementation
uses
ChildWin,
helpers;
helpers,
main;
{$R *.dfm}
@ -42,6 +44,11 @@ begin
Action := caFree;
end;
procedure TfrmQueryProgress.FormCreate(Sender: TObject);
begin
InheritFont(Font);
end;
{***
Handles the TMysqlQueryThread notification messages.

View File

@ -14,6 +14,7 @@ object RunSQLFileForm: TRunSQLFileForm
OldCreateOrder = False
Position = poMainFormCenter
OnActivate = FormActivate
OnCreate = FormCreate
DesignSize = (
394
254)

View File

@ -23,6 +23,7 @@ type
lblAffectedRowsName: TLabel;
lblAffectedRowsValue: TLabel;
procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
SQLFileName : String;
@ -164,4 +165,9 @@ begin
end;
procedure TRunSQLFileForm.FormCreate(Sender: TObject);
begin
InheritFont(Font);
end;
end.

View File

@ -73,6 +73,7 @@ begin
Width := Mainform.GetRegValue(REGNAME_SELECTDBO_WINWIDTH, Width);
Height := Mainform.GetRegValue(REGNAME_SELECTDBO_WINHEIGHT, Height);
SetWindowSizeGrip( Self.Handle, True );
InheritFont(Font);
end;
procedure TfrmSelectDBObject.FormDestroy(Sender: TObject);

View File

@ -35,9 +35,9 @@ object frmSQLhelp: TfrmSQLhelp
object lblTopics: TLabel
AlignWithMargins = True
Left = 3
Top = 7
Top = 8
Width = 147
Height = 14
Height = 13
Align = alBottom
Caption = 'Topics:'
end

View File

@ -68,6 +68,7 @@ procedure TfrmSQLhelp.FormCreate(Sender: TObject);
begin
// Assign images from main imagelist to speedbuttons
btnSearchOnline.PngImage := Mainform.PngImageListMain.PngImages[69].PngImage;
InheritFont(Font);
end;

View File

@ -70,6 +70,8 @@ procedure Ttbl_properties_form.FormCreate(Sender: TObject);
var
charset : String;
begin
InheritFont(Font);
try
dsCollations := Mainform.Childwin.GetResults('SHOW COLLATION');
except

View File

@ -5,7 +5,7 @@ interface
uses Forms, Windows, Graphics;
function IsWindowsVista: Boolean;
procedure SetVistaFonts(const AForm: TCustomForm);
procedure SetVistaFonts(const AFont: TFont);
procedure SetVistaContentFonts(const AFont: TFont);
procedure SetDesktopIconFonts(const AFont: TFont);
procedure ExtendGlass(const AHandle: THandle; const AMargins: TRect);
@ -57,14 +57,14 @@ begin
SetWindowTheme(AHandle, 'explorer', nil);
end;
procedure SetVistaFonts(const AForm: TCustomForm);
procedure SetVistaFonts(const AFont: TFont);
begin
if (IsWindowsVista or not CheckOSVerForFonts)
and not SameText(AForm.Font.Name, VistaFont)
and not SameText(AFont.Name, VistaFont)
and (Screen.Fonts.IndexOf(VistaFont) >= 0) then
begin
AForm.Font.Size := AForm.Font.Size + 1;
AForm.Font.Name := VistaFont;
AFont.Size := AFont.Size + 1;
AFont.Name := VistaFont;
end;
end;

View File

@ -51,6 +51,7 @@ procedure TfrmUpdateCheck.FormCreate(Sender: TObject);
begin
// Should be false by default. Callers can set this to True after Create()
AutoClose := False;
InheritFont(Font);
end;
{**

View File

@ -232,6 +232,7 @@ begin
Height := Mainform.GetRegValue(REGNAME_USERMNGR_WINHEIGHT, Height);
db := Mainform.Mask(DBNAME_MYSQL);
SetWindowSizeGrip( Self.Handle, True );
InheritFont(Font);
end;

View File

@ -48,6 +48,7 @@ begin
SynMemoSelect.Highlighter := Mainform.ChildWin.SynSQLSyn1;
SynMemoSelect.Font := Mainform.ChildWin.SynMemoQuery.Font;
SetWindowSizeGrip( Self.Handle, True );
InheritFont(Font);
end;