Try to fix most DPI related glitches. Especially TFrames need a ScaleBy() call, which is done automatically on TForms. Fixes issue #1656.

This commit is contained in:
Ansgar Becker
2010-02-04 23:50:47 +00:00
parent 7629b132cf
commit fc6d4c2a48
12 changed files with 146 additions and 181 deletions

View File

@ -316,3 +316,6 @@ const
SizeGripProp = 'SizeGrip'; SizeGripProp = 'SizeGrip';
// Forms are designed at 96 dpi. Use that to scale TFrames, which obviously do not auto-scale.
FORMS_DPI = 96;

View File

@ -223,6 +223,7 @@ type
function BinToWideHex(bin: AnsiString): String; function BinToWideHex(bin: AnsiString): String;
procedure CheckHex(text: String; errorMessage: string); procedure CheckHex(text: String; errorMessage: string);
procedure FixVT(VT: TVirtualStringTree); procedure FixVT(VT: TVirtualStringTree);
function GetTextHeight(Font: TFont): Integer;
function ColorAdjustBrightness(Col: TColor; Shift: SmallInt): TColor; function ColorAdjustBrightness(Col: TColor; Shift: SmallInt): TColor;
function ComposeOrderClause(Cols: TOrderColArray): String; function ComposeOrderClause(Cols: TOrderColArray): String;
procedure OpenRegistry(Session: String = ''); procedure OpenRegistry(Session: String = '');
@ -2515,29 +2516,17 @@ end;
procedure FixVT(VT: TVirtualStringTree); procedure FixVT(VT: TVirtualStringTree);
var var
ReadOnlyNodeHeight: Integer; ReadOnlyNodeHeight: Integer;
DC: HDC;
SaveFont: HFont;
I: Integer;
SysMetrics, Metrics: TTextMetric;
begin begin
// Resize hardcoded node height to work with different DPI settings // Resize hardcoded node height to work with different DPI settings
ReadOnlyNodeHeight := VT.Canvas.TextHeight('A') + 6; ReadOnlyNodeHeight := VT.Canvas.TextHeight('A') + 6;
if toEditable in VT.TreeOptions.MiscOptions then begin if toEditable in VT.TreeOptions.MiscOptions then begin
// Editable nodes must have enough height for a TEdit, including its cursor // Editable nodes must have enough height for a TEdit, including its cursor
// Code taken from StdCtrls.TCustomEdit.AdjustHeight VT.DefaultNodeHeight := GetTextHeight(VT.Font) + GetSystemMetrics(SM_CYBORDER) * 6;
DC := GetDC(0);
GetTextMetrics(DC, SysMetrics);
SaveFont := SelectObject(DC, VT.Font.Handle);
GetTextMetrics(DC, Metrics);
SelectObject(DC, SaveFont);
ReleaseDC(0, DC);
I := GetSystemMetrics(SM_CYBORDER) * 6;
VT.DefaultNodeHeight := Metrics.tmHeight + I;
end else end else
VT.DefaultNodeHeight := ReadOnlyNodeHeight; VT.DefaultNodeHeight := ReadOnlyNodeHeight;
// The header needs slightly more height than the normal nodes // The header needs slightly more height than the normal nodes
VT.Header.Height := Trunc(ReadOnlyNodeHeight * 1.2); VT.Header.Height := Trunc(ReadOnlyNodeHeight * 1.2);
// Disable hottracking in non-Vista mode, looks ugly in XP, but nice in Vista // Disable hottracking in non-Vista mode, looks ugly in XP, but nice in Vista
if (toUseExplorerTheme in VT.TreeOptions.PaintOptions) and IsWindowsVista then if (toUseExplorerTheme in VT.TreeOptions.PaintOptions) and IsWindowsVista then
VT.TreeOptions.PaintOptions := VT.TreeOptions.PaintOptions + [toHotTrack] VT.TreeOptions.PaintOptions := VT.TreeOptions.PaintOptions + [toHotTrack]
else else
@ -2551,6 +2540,23 @@ begin
end; end;
function GetTextHeight(Font: TFont): Integer;
var
DC: HDC;
SaveFont: HFont;
SysMetrics, Metrics: TTextMetric;
begin
// Code taken from StdCtrls.TCustomEdit.AdjustHeight
DC := GetDC(0);
GetTextMetrics(DC, SysMetrics);
SaveFont := SelectObject(DC, Font.Handle);
GetTextMetrics(DC, Metrics);
SelectObject(DC, SaveFont);
ReleaseDC(0, DC);
Result := Metrics.tmHeight;
end;
function ColorAdjustBrightness(Col: TColor; Shift: SmallInt): TColor; function ColorAdjustBrightness(Col: TColor; Shift: SmallInt): TColor;
var var
Lightness: Byte; Lightness: Byte;

View File

@ -487,7 +487,6 @@ object MainForm: TMainForm
Images = PngImageListMain Images = PngImageListMain
MultiLine = True MultiLine = True
PopupMenu = popupMainTabs PopupMenu = popupMainTabs
TabHeight = 22
TabOrder = 1 TabOrder = 1
OnChange = PageControlMainChange OnChange = PageControlMainChange
OnContextPopup = PageControlMainContextPopup OnContextPopup = PageControlMainContextPopup
@ -499,7 +498,7 @@ object MainForm: TMainForm
Left = 0 Left = 0
Top = 0 Top = 0
Width = 575 Width = 575
Height = 299 Height = 302
ActivePage = tabVariables ActivePage = tabVariables
Align = alClient Align = alClient
HotTrack = True HotTrack = True
@ -511,7 +510,7 @@ object MainForm: TMainForm
Left = 0 Left = 0
Top = 0 Top = 0
Width = 567 Width = 567
Height = 271 Height = 274
Align = alClient Align = alClient
DragOperations = [] DragOperations = []
Header.AutoSizeIndex = 1 Header.AutoSizeIndex = 1
@ -561,7 +560,7 @@ object MainForm: TMainForm
Left = 0 Left = 0
Top = 0 Top = 0
Width = 567 Width = 567
Height = 271 Height = 274
Align = alClient Align = alClient
DragOperations = [] DragOperations = []
Header.AutoSizeIndex = 1 Header.AutoSizeIndex = 1
@ -622,7 +621,7 @@ object MainForm: TMainForm
ImageIndex = 1 ImageIndex = 1
object Splitter3: TSplitter object Splitter3: TSplitter
Left = 0 Left = 0
Top = 198 Top = 201
Width = 567 Width = 567
Height = 4 Height = 4
Cursor = crSizeNS Cursor = crSizeNS
@ -633,7 +632,7 @@ object MainForm: TMainForm
Left = 0 Left = 0
Top = 0 Top = 0
Width = 567 Width = 567
Height = 198 Height = 201
Align = alClient Align = alClient
Header.AutoSizeIndex = 7 Header.AutoSizeIndex = 7
Header.DefaultHeight = 17 Header.DefaultHeight = 17
@ -707,7 +706,7 @@ object MainForm: TMainForm
end end
object pnlProcessViewBox: TPanel object pnlProcessViewBox: TPanel
Left = 0 Left = 0
Top = 202 Top = 205
Width = 567 Width = 567
Height = 69 Height = 69
Align = alBottom Align = alBottom
@ -761,7 +760,7 @@ object MainForm: TMainForm
Left = 0 Left = 0
Top = 0 Top = 0
Width = 567 Width = 567
Height = 271 Height = 274
Align = alClient Align = alClient
Header.AutoSizeIndex = 4 Header.AutoSizeIndex = 4
Header.DefaultHeight = 17 Header.DefaultHeight = 17
@ -832,7 +831,7 @@ object MainForm: TMainForm
Left = 0 Left = 0
Top = 0 Top = 0
Width = 575 Width = 575
Height = 299 Height = 302
Align = alClient Align = alClient
EditDelay = 500 EditDelay = 500
Header.AutoSizeIndex = -1 Header.AutoSizeIndex = -1
@ -992,7 +991,7 @@ object MainForm: TMainForm
Left = 0 Left = 0
Top = 91 Top = 91
Width = 575 Width = 575
Height = 208 Height = 211
Align = alClient Align = alClient
Alignment = taCenter Alignment = taCenter
Caption = 'Stored routines don'#39't provide any data you could edit here.' Caption = 'Stored routines don'#39't provide any data you could edit here.'
@ -1176,7 +1175,7 @@ object MainForm: TMainForm
Left = 0 Left = 0
Top = 91 Top = 91
Width = 575 Width = 575
Height = 208 Height = 211
Align = alClient Align = alClient
AutoScrollDelay = 50 AutoScrollDelay = 50
EditDelay = 0 EditDelay = 0
@ -1386,7 +1385,7 @@ object MainForm: TMainForm
Left = 0 Left = 0
Top = 113 Top = 113
Width = 575 Width = 575
Height = 186 Height = 189
Align = alClient Align = alClient
AutoScrollDelay = 50 AutoScrollDelay = 50
EditDelay = 0 EditDelay = 0

View File

@ -1240,6 +1240,7 @@ begin
InheritFont(Font); InheritFont(Font);
InheritFont(tabsetQueryHelpers.Font); InheritFont(tabsetQueryHelpers.Font);
InheritFont(SynCompletionProposal.Font); InheritFont(SynCompletionProposal.Font);
StatusBar.Height := GetTextHeight(StatusBar.Font)+4;
// Enable auto completion in data tab, filter editor // Enable auto completion in data tab, filter editor
SynCompletionProposal.AddEditor(SynMemoFilter); SynCompletionProposal.AddEditor(SynMemoFilter);

View File

@ -3,12 +3,6 @@ object frmRoutineEditor: TfrmRoutineEditor
Top = 0 Top = 0
Width = 475 Width = 475
Height = 484 Height = 484
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
TabOrder = 0 TabOrder = 0
DesignSize = ( DesignSize = (
475 475

View File

@ -92,6 +92,7 @@ var
i: Integer; i: Integer;
begin begin
inherited; inherited;
ScaleControls(Screen.PixelsPerInch, FORMS_DPI);
// Combo items in a .dfm are sporadically lost after an IDE restart, // Combo items in a .dfm are sporadically lost after an IDE restart,
// so we set them here to avoid developer annoyance // so we set them here to avoid developer annoyance
comboType.Items.Add('Procedure (doesn''t return a result)'); comboType.Items.Add('Procedure (doesn''t return a result)');

View File

@ -3,12 +3,6 @@ object frmTableEditor: TfrmTableEditor
Top = 0 Top = 0
Width = 607 Width = 607
Height = 391 Height = 391
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
TabOrder = 0 TabOrder = 0
DesignSize = ( DesignSize = (
607 607
@ -68,12 +62,8 @@ object frmTableEditor: TfrmTableEditor
EditDelay = 0 EditDelay = 0
Header.AutoSizeIndex = -1 Header.AutoSizeIndex = -1
Header.DefaultHeight = 17 Header.DefaultHeight = 17
Header.Font.Charset = DEFAULT_CHARSET
Header.Font.Color = clWindowText
Header.Font.Height = -11
Header.Font.Name = 'Tahoma'
Header.Font.Style = []
Header.Options = [hoColumnResize, hoDblClickResize, hoDrag, hoVisible] Header.Options = [hoColumnResize, hoDblClickResize, hoDrag, hoVisible]
Header.ParentFont = True
Images = MainForm.PngImageListMain Images = MainForm.PngImageListMain
IncrementalSearch = isAll IncrementalSearch = isAll
PopupMenu = popupColumns PopupMenu = popupColumns
@ -379,25 +369,21 @@ object frmTableEditor: TfrmTableEditor
object tabIndexes: TTabSheet object tabIndexes: TTabSheet
Caption = 'Indexes' Caption = 'Indexes'
ImageIndex = 13 ImageIndex = 13
DesignSize = (
593
121)
object treeIndexes: TVirtualStringTree object treeIndexes: TVirtualStringTree
Left = 75 AlignWithMargins = True
Top = 3 Left = 69
Width = 300 Top = 0
Height = 113 Width = 521
Anchors = [akLeft, akTop, akRight, akBottom] Height = 121
Margins.Top = 0
Margins.Bottom = 0
Align = alClient
DragMode = dmAutomatic DragMode = dmAutomatic
EditDelay = 0 EditDelay = 0
Header.AutoSizeIndex = 0 Header.AutoSizeIndex = 0
Header.DefaultHeight = 17 Header.DefaultHeight = 17
Header.Font.Charset = DEFAULT_CHARSET
Header.Font.Color = clWindowText
Header.Font.Height = -11
Header.Font.Name = 'Tahoma'
Header.Font.Style = []
Header.Options = [hoAutoResize, hoColumnResize, hoDrag, hoShowSortGlyphs, hoVisible] Header.Options = [hoAutoResize, hoColumnResize, hoDrag, hoShowSortGlyphs, hoVisible]
Header.ParentFont = True
Images = MainForm.PngImageListMain Images = MainForm.PngImageListMain
PopupMenu = popupIndexes PopupMenu = popupIndexes
TabOrder = 1 TabOrder = 1
@ -421,7 +407,7 @@ object frmTableEditor: TfrmTableEditor
item item
Options = [coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible, coAllowFocus] Options = [coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible, coAllowFocus]
Position = 0 Position = 0
Width = 116 Width = 341
WideText = 'Name' WideText = 'Name'
end end
item item
@ -437,11 +423,11 @@ object frmTableEditor: TfrmTableEditor
end> end>
end end
object tlbIndexes: TToolBar object tlbIndexes: TToolBar
Left = 3 Left = 0
Top = 3 Top = 0
Width = 66 Width = 66
Height = 110 Height = 121
Align = alNone Align = alLeft
AutoSize = True AutoSize = True
ButtonWidth = 66 ButtonWidth = 66
Caption = 'tlbIndexes' Caption = 'tlbIndexes'
@ -494,46 +480,16 @@ object frmTableEditor: TfrmTableEditor
OnClick = btnMoveDownIndexClick OnClick = btnMoveDownIndexClick
end end
end end
object StaticText1: TStaticText
Left = 381
Top = 25
Width = 188
Height = 66
Anchors = [akTop, akRight]
AutoSize = False
Caption =
'To add a column, drag it from the column list below into the ind' +
'ex tree.'
TabOrder = 2
end
end end
object tabForeignKeys: TTabSheet object tabForeignKeys: TTabSheet
Caption = 'Foreign keys' Caption = 'Foreign keys'
ImageIndex = 136 ImageIndex = 136
DesignSize = (
593
121)
object lblNoForeignKeys: TLabel
Left = 75
Top = 105
Width = 515
Height = 13
Anchors = [akLeft, akRight, akBottom]
AutoSize = False
Caption = 'lblNoForeignKeys'
Font.Charset = DEFAULT_CHARSET
Font.Color = clRed
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
end
object tlbForeignKeys: TToolBar object tlbForeignKeys: TToolBar
Left = 3 Left = 0
Top = 3 Top = 0
Width = 66 Width = 66
Height = 66 Height = 121
Align = alNone Align = alLeft
AutoSize = True AutoSize = True
ButtonWidth = 66 ButtonWidth = 66
Caption = 'tlbForeignKeys' Caption = 'tlbForeignKeys'
@ -567,71 +523,81 @@ object frmTableEditor: TfrmTableEditor
OnClick = btnClearForeignKeysClick OnClick = btnClearForeignKeysClick
end end
end end
object listForeignKeys: TVirtualStringTree object pnlNoForeignKeys: TPanel
Left = 75 Left = 66
Top = 3 Top = 0
Width = 515 Width = 527
Height = 103 Height = 121
Anchors = [akLeft, akTop, akRight, akBottom] Align = alClient
EditDelay = 0 BevelOuter = bvNone
Header.AutoSizeIndex = 0 Caption = 'pnlNoForeignKeys'
Header.DefaultHeight = 17
Header.Font.Charset = DEFAULT_CHARSET
Header.Font.Color = clWindowText
Header.Font.Height = -11
Header.Font.Name = 'Tahoma'
Header.Font.Style = []
Header.Options = [hoAutoResize, hoColumnResize, hoDrag, hoShowSortGlyphs, hoVisible]
Images = MainForm.PngImageListMain
TabOrder = 1 TabOrder = 1
TreeOptions.MiscOptions = [toAcceptOLEDrop, toEditable, toFullRepaintOnResize, toGridExtensions, toInitOnSave, toToggleOnDblClick, toWheelPanning, toEditOnClick] VerticalAlignment = taAlignBottom
TreeOptions.PaintOptions = [toShowButtons, toShowDropmark, toShowHorzGridLines, toShowTreeLines, toShowVertGridLines, toThemeAware, toUseBlendedImages, toUseExplorerTheme, toHideTreeLinesIfThemed] object listForeignKeys: TVirtualStringTree
TreeOptions.SelectionOptions = [toExtendedFocus] AlignWithMargins = True
OnBeforePaint = listForeignKeysBeforePaint Left = 3
OnClick = treeIndexesClick Top = 0
OnCreateEditor = listForeignKeysCreateEditor Width = 521
OnEditing = listForeignKeysEditing Height = 121
OnFocusChanged = listForeignKeysFocusChanged Margins.Top = 0
OnGetText = listForeignKeysGetText Margins.Bottom = 0
OnGetImageIndex = listForeignKeysGetImageIndex Align = alClient
OnNewText = listForeignKeysNewText EditDelay = 0
Columns = < Header.AutoSizeIndex = 0
item Header.DefaultHeight = 17
Options = [coDraggable, coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible, coAllowFocus] Header.Options = [hoAutoResize, hoColumnResize, hoDrag, hoShowSortGlyphs, hoVisible]
Position = 0 Header.ParentFont = True
Width = 91 Images = MainForm.PngImageListMain
WideText = 'Key name' TabOrder = 0
end TreeOptions.MiscOptions = [toAcceptOLEDrop, toEditable, toFullRepaintOnResize, toGridExtensions, toInitOnSave, toToggleOnDblClick, toWheelPanning, toEditOnClick]
item TreeOptions.PaintOptions = [toShowButtons, toShowDropmark, toShowHorzGridLines, toShowTreeLines, toShowVertGridLines, toThemeAware, toUseBlendedImages, toUseExplorerTheme, toHideTreeLinesIfThemed]
Options = [coDraggable, coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible, coAllowFocus] TreeOptions.SelectionOptions = [toExtendedFocus]
Position = 1 OnBeforePaint = listForeignKeysBeforePaint
Width = 80 OnClick = treeIndexesClick
WideText = 'Columns' OnCreateEditor = listForeignKeysCreateEditor
end OnEditing = listForeignKeysEditing
item OnFocusChanged = listForeignKeysFocusChanged
Options = [coDraggable, coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible, coAllowFocus] OnGetText = listForeignKeysGetText
Position = 2 OnGetImageIndex = listForeignKeysGetImageIndex
Width = 100 OnNewText = listForeignKeysNewText
WideText = 'Reference table' Columns = <
end item
item Options = [coDraggable, coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible, coAllowFocus]
Options = [coDraggable, coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible, coAllowFocus] Position = 0
Position = 3 Width = 101
Width = 80 WideText = 'Key name'
WideText = 'Foreign columns' end
end item
item Options = [coDraggable, coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible, coAllowFocus]
Options = [coDraggable, coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible, coAllowFocus] Position = 1
Position = 4 Width = 80
Width = 80 WideText = 'Columns'
WideText = 'On UPDATE' end
end item
item Options = [coDraggable, coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible, coAllowFocus]
Options = [coDraggable, coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible, coAllowFocus] Position = 2
Position = 5 Width = 100
Width = 80 WideText = 'Reference table'
WideText = 'On DELETE' end
end> item
Options = [coDraggable, coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible, coAllowFocus]
Position = 3
Width = 80
WideText = 'Foreign columns'
end
item
Options = [coDraggable, coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible, coAllowFocus]
Position = 4
Width = 80
WideText = 'On UPDATE'
end
item
Options = [coDraggable, coEnabled, coParentBidiMode, coParentColor, coResizable, coShowDropMark, coVisible, coAllowFocus]
Position = 5
Width = 80
WideText = 'On DELETE'
end>
end
end end
end end
object tabCREATEcode: TTabSheet object tabCREATEcode: TTabSheet
@ -716,11 +682,16 @@ object frmTableEditor: TfrmTableEditor
Caption = 'Columns:' Caption = 'Columns:'
TabOrder = 1 TabOrder = 1
object tlbColumns: TToolBar object tlbColumns: TToolBar
Left = 61 AlignWithMargins = True
Left = 0
Top = 0 Top = 0
Width = 473 Width = 501
Height = 22 Height = 22
Align = alNone Margins.Left = 100
Margins.Top = 0
Margins.Right = 0
Margins.Bottom = 0
Align = alClient
ButtonWidth = 66 ButtonWidth = 66
Caption = 'Columns:' Caption = 'Columns:'
Images = MainForm.PngImageListMain Images = MainForm.PngImageListMain

View File

@ -47,7 +47,6 @@ type
btnClearIndexes: TToolButton; btnClearIndexes: TToolButton;
btnMoveUpIndex: TToolButton; btnMoveUpIndex: TToolButton;
btnMoveDownIndex: TToolButton; btnMoveDownIndex: TToolButton;
StaticText1: TStaticText;
pnlColumnsTop: TPanel; pnlColumnsTop: TPanel;
tlbColumns: TToolBar; tlbColumns: TToolBar;
btnAddColumn: TToolButton; btnAddColumn: TToolButton;
@ -80,13 +79,13 @@ type
btnAddForeignKey: TToolButton; btnAddForeignKey: TToolButton;
btnRemoveForeignKey: TToolButton; btnRemoveForeignKey: TToolButton;
btnClearForeignKeys: TToolButton; btnClearForeignKeys: TToolButton;
listForeignKeys: TVirtualStringTree;
lblNoForeignKeys: TLabel;
menuCopyColumnCell: TMenuItem; menuCopyColumnCell: TMenuItem;
N2: TMenuItem; N2: TMenuItem;
popupSQLmemo: TPopupMenu; popupSQLmemo: TPopupMenu;
menuSQLCopy: TMenuItem; menuSQLCopy: TMenuItem;
menuSQLSelectAll: TMenuItem; menuSQLSelectAll: TMenuItem;
pnlNoForeignKeys: TPanel;
listForeignKeys: TVirtualStringTree;
procedure editNameChange(Sender: TObject); procedure editNameChange(Sender: TObject);
procedure Modification(Sender: TObject); procedure Modification(Sender: TObject);
procedure btnAddColumnClick(Sender: TObject); procedure btnAddColumnClick(Sender: TObject);
@ -219,6 +218,7 @@ const
constructor TfrmTableEditor.Create(AOwner: TComponent); constructor TfrmTableEditor.Create(AOwner: TComponent);
begin begin
inherited; inherited;
ScaleControls(Screen.PixelsPerInch, FORMS_DPI);
PageControlMain.Height := GetRegValue(REGNAME_TABLEEDITOR_TABSHEIGHT, PageControlMain.Height); PageControlMain.Height := GetRegValue(REGNAME_TABLEEDITOR_TABSHEIGHT, PageControlMain.Height);
FixVT(listColumns); FixVT(listColumns);
FixVT(treeIndexes); FixVT(treeIndexes);
@ -1753,13 +1753,11 @@ begin
SupportsForeignKeys := LowerCase(comboEngine.Text) = 'innodb'; SupportsForeignKeys := LowerCase(comboEngine.Text) = 'innodb';
ListForeignKeys.Enabled := SupportsForeignKeys; ListForeignKeys.Enabled := SupportsForeignKeys;
tlbForeignKeys.Enabled := SupportsForeignKeys; tlbForeignKeys.Enabled := SupportsForeignKeys;
lblNoForeignKeys.Caption := 'The selected table engine ('+comboEngine.Text+') does not support foreign keys. '+ pnlNoForeignKeys.Caption := 'The selected table engine ('+comboEngine.Text+') does not support foreign keys.';
'To enable foreign keys you have to change the table engine in the "Options" tab to "InnoDB".';
if SupportsForeignKeys then if SupportsForeignKeys then
ListForeignKeys.Height := lblNoForeignKeys.Top - ListForeignKeys.Top + lblNoForeignKeys.Height ListForeignKeys.Margins.Bottom := 0
else else
ListForeignKeys.Height := lblNoForeignKeys.Top - ListForeignKeys.Top - 4; ListForeignKeys.Margins.Bottom := GetTextHeight(pnlNoForeignKeys.Font)+4;
lblNoForeignKeys.Visible := not SupportsForeignKeys;
end; end;
UpdateSQLcode; UpdateSQLcode;
end; end;

View File

@ -126,14 +126,10 @@ object frmTableTools: TfrmTableTools
Align = alClient Align = alClient
Header.AutoSizeIndex = -1 Header.AutoSizeIndex = -1
Header.DefaultHeight = 17 Header.DefaultHeight = 17
Header.Font.Charset = DEFAULT_CHARSET
Header.Font.Color = clWindowText
Header.Font.Height = -11
Header.Font.Name = 'Tahoma'
Header.Font.Style = []
Header.Images = MainForm.PngImageListMain Header.Images = MainForm.PngImageListMain
Header.MainColumn = -1 Header.MainColumn = -1
Header.Options = [hoColumnResize, hoDblClickResize, hoDrag, hoHotTrack, hoShowSortGlyphs, hoVisible] Header.Options = [hoColumnResize, hoDblClickResize, hoDrag, hoHotTrack, hoShowSortGlyphs, hoVisible]
Header.ParentFont = True
TabOrder = 0 TabOrder = 0
TreeOptions.AutoOptions = [toAutoDropExpand, toAutoScrollOnExpand, toAutoSort, toAutoTristateTracking, toAutoDeleteMovedNodes] TreeOptions.AutoOptions = [toAutoDropExpand, toAutoScrollOnExpand, toAutoSort, toAutoTristateTracking, toAutoDeleteMovedNodes]
TreeOptions.MiscOptions = [toAcceptOLEDrop, toFullRepaintOnResize, toGridExtensions, toInitOnSave, toToggleOnDblClick, toWheelPanning, toEditOnClick] TreeOptions.MiscOptions = [toAcceptOLEDrop, toFullRepaintOnResize, toGridExtensions, toInitOnSave, toToggleOnDblClick, toWheelPanning, toEditOnClick]

View File

@ -54,6 +54,7 @@ var
i: Integer; i: Integer;
begin begin
inherited; inherited;
ScaleControls(Screen.PixelsPerInch, FORMS_DPI);
SynMemoStatement.Highlighter := Mainform.SynSQLSyn1; SynMemoStatement.Highlighter := Mainform.SynSQLSyn1;
editName.MaxLength := NAME_LEN; editName.MaxLength := NAME_LEN;
comboTiming.Items.Text := 'BEFORE'+CRLF+'AFTER'; comboTiming.Items.Text := 'BEFORE'+CRLF+'AFTER';

View File

@ -3,12 +3,6 @@ object frmView: TfrmView
Top = 0 Top = 0
Width = 451 Width = 451
Height = 304 Height = 304
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
TabOrder = 0 TabOrder = 0
DesignSize = ( DesignSize = (
451 451

View File

@ -47,6 +47,7 @@ uses main;
constructor TfrmView.Create(AOwner: TComponent); constructor TfrmView.Create(AOwner: TComponent);
begin begin
inherited; inherited;
ScaleControls(Screen.PixelsPerInch, FORMS_DPI);
SynMemoSelect.Highlighter := Mainform.SynSQLSyn1; SynMemoSelect.Highlighter := Mainform.SynSQLSyn1;
Mainform.SynCompletionProposal.AddEditor(SynMemoSelect); Mainform.SynCompletionProposal.AddEditor(SynMemoSelect);
editName.MaxLength := NAME_LEN; editName.MaxLength := NAME_LEN;