mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 11:17:57 +08:00
Turn column selection form into a tool window, so I can apply a size-grip at the lower right edge of the form. Remember form dimensions. Fixes issue #3299.
This commit is contained in:
@ -1,11 +1,13 @@
|
||||
object ColumnSelectionForm: TColumnSelectionForm
|
||||
Left = 0
|
||||
Top = 0
|
||||
BorderStyle = bsNone
|
||||
Caption = 'ColumnSelectionForm'
|
||||
ClientHeight = 277
|
||||
ClientWidth = 166
|
||||
BorderStyle = bsSizeToolWin
|
||||
Caption = 'Select columns'
|
||||
ClientHeight = 243
|
||||
ClientWidth = 184
|
||||
Color = clBtnFace
|
||||
Constraints.MinHeight = 150
|
||||
Constraints.MinWidth = 200
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
@ -14,66 +16,66 @@ object ColumnSelectionForm: TColumnSelectionForm
|
||||
OldCreateOrder = False
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnDeactivate = FormDeactivate
|
||||
OnShow = FormShow
|
||||
DesignSize = (
|
||||
184
|
||||
243)
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
object pnlBevel: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 166
|
||||
Height = 277
|
||||
Align = alClient
|
||||
BorderWidth = 3
|
||||
TabOrder = 0
|
||||
object btnCancel: TButton
|
||||
Left = 85
|
||||
Top = 246
|
||||
Left = 101
|
||||
Top = 210
|
||||
Width = 75
|
||||
Height = 25
|
||||
Anchors = [akRight, akBottom]
|
||||
Cancel = True
|
||||
Caption = 'Cancel'
|
||||
ModalResult = 2
|
||||
TabOrder = 3
|
||||
TabOrder = 0
|
||||
OnClick = btnCancelClick
|
||||
end
|
||||
object btnOK: TButton
|
||||
Left = 4
|
||||
Top = 246
|
||||
Left = 20
|
||||
Top = 210
|
||||
Width = 75
|
||||
Height = 25
|
||||
Anchors = [akRight, akBottom]
|
||||
Caption = 'OK'
|
||||
Default = True
|
||||
TabOrder = 2
|
||||
TabOrder = 1
|
||||
OnClick = btnOKClick
|
||||
end
|
||||
object chkSelectAll: TCheckBox
|
||||
Left = 4
|
||||
Top = 207
|
||||
Width = 150
|
||||
object chkSort: TCheckBox
|
||||
Left = 8
|
||||
Top = 187
|
||||
Width = 168
|
||||
Height = 17
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
Caption = 'Sort alphabetically'
|
||||
TabOrder = 2
|
||||
OnClick = chkSortClick
|
||||
end
|
||||
object chkSelectAll: TCheckBox
|
||||
Left = 8
|
||||
Top = 169
|
||||
Width = 168
|
||||
Height = 17
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
Caption = 'Select / Deselect all'
|
||||
TabOrder = 1
|
||||
TabOrder = 3
|
||||
OnClick = chkSelectAllClick
|
||||
end
|
||||
object chklistColumns: TCheckListBox
|
||||
Left = 4
|
||||
Top = 4
|
||||
Width = 158
|
||||
Height = 197
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 184
|
||||
Height = 163
|
||||
OnClickCheck = chklistColumnsClickCheck
|
||||
Align = alTop
|
||||
Anchors = [akLeft, akTop, akRight, akBottom]
|
||||
ItemHeight = 13
|
||||
TabOrder = 0
|
||||
end
|
||||
object chkSort: TCheckBox
|
||||
Left = 4
|
||||
Top = 225
|
||||
Width = 125
|
||||
Height = 17
|
||||
Caption = 'Sort alphabetically'
|
||||
TabOrder = 4
|
||||
OnClick = chkSortClick
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -8,7 +8,6 @@ uses
|
||||
|
||||
type
|
||||
TColumnSelectionForm = class(TForm)
|
||||
pnlBevel: TPanel; // This panel has the only duty to display a normal border at the edges of the form
|
||||
btnCancel: TButton;
|
||||
btnOK: TButton;
|
||||
chkSelectAll: TCheckBox;
|
||||
@ -23,6 +22,7 @@ type
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormDeactivate(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
@ -45,6 +45,16 @@ procedure TColumnSelectionForm.FormCreate(Sender: TObject);
|
||||
begin
|
||||
InheritFont(Font);
|
||||
TranslateComponent(Self);
|
||||
SetWindowSizeGrip(Self.Handle, True);
|
||||
Width := AppSettings.ReadInt(asColumnSelectorWidth);
|
||||
Height := AppSettings.ReadInt(asColumnSelectorHeight);
|
||||
end;
|
||||
|
||||
|
||||
procedure TColumnSelectionForm.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
AppSettings.WriteInt(asColumnSelectorWidth, Width );
|
||||
AppSettings.WriteInt(asColumnSelectorHeight, Height );
|
||||
end;
|
||||
|
||||
|
||||
|
@ -174,6 +174,7 @@ type
|
||||
asActionShortcut1, asActionShortcut2, asHighlighterForeground, asHighlighterBackground, asHighlighterStyle,
|
||||
asListColWidths, asListColsVisible, asListColPositions, asListColSort, asSessionFolder,
|
||||
asRecentFilter, asTimestampColumns, asDateTimeEditorCursorPos, asAppLanguage, asAutoExpand, asForeignDropDown, asQueryHistoryEnabled,
|
||||
asColumnSelectorWidth, asColumnSelectorHeight,
|
||||
asUnused);
|
||||
TAppSetting = record
|
||||
Name: String;
|
||||
@ -3334,6 +3335,8 @@ begin
|
||||
InitSetting(asAutoExpand, 'AutoExpand', 0, False);
|
||||
InitSetting(asForeignDropDown, 'ForeignDropDown', 0, True);
|
||||
InitSetting(asQueryHistoryEnabled, 'QueryHistory', 0, True);
|
||||
InitSetting(asColumnSelectorWidth, 'ColumnSelectorWidth', 200, False, '');
|
||||
InitSetting(asColumnSelectorHeight, 'ColumnSelectorHeight', 270, False, '');
|
||||
end;
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user