Realign most controls on SQL help dialog, sanitize them from weird paddings and margins. Remove statusbar which was just there to display the size grip in the lower right corner.

This commit is contained in:
Ansgar Becker
2010-02-24 22:53:45 +00:00
parent 19fa02b4c6
commit 601edef305
2 changed files with 160 additions and 201 deletions

View File

@ -16,102 +16,133 @@ object frmSQLhelp: TfrmSQLhelp
OnShow = FormShow OnShow = FormShow
PixelsPerInch = 96 PixelsPerInch = 96
TextHeight = 13 TextHeight = 13
object Splitter1: TSplitter object btnSearchOnline: TButton
Left = 153 Left = 363
Top = 0 Top = 322
Width = 8 Width = 103
Height = 336 Height = 25
Cursor = crSizeWE Anchors = [akRight, akBottom]
ResizeStyle = rsUpdate Caption = 'Search online'
end ImageIndex = 69
object pnlLeft: TPanel Images = MainForm.ImageListMain
Left = 0
Top = 0
Width = 153
Height = 336
Align = alLeft
BevelOuter = bvNone
TabOrder = 0 TabOrder = 0
object treeTopics: TTreeView OnClick = ButtonOnlinehelpClick
AlignWithMargins = True
Left = 3
Top = 27
Width = 147
Height = 309
Margins.Bottom = 0
Align = alClient
ChangeDelay = 50
Images = MainForm.ImageListMain
Indent = 19
ReadOnly = True
ShowLines = False
TabOrder = 1
OnChange = treeTopicsChange
OnExpanding = treeTopicsExpanding
end
object editFilter: TButtonedEdit
AlignWithMargins = True
Left = 3
Top = 3
Width = 147
Height = 21
Margins.Bottom = 0
Align = alTop
Images = MainForm.ImageListMain
LeftButton.Hint = 'Search'
LeftButton.ImageIndex = 53
LeftButton.Visible = True
TabOrder = 0
OnChange = editFilterChange
end
end end
object StatusBar1: TStatusBar object ButtonClose: TButton
Left = 0 Left = 472
Top = 336 Top = 322
Width = 582 Width = 102
Height = 19 Height = 25
Panels = <> Anchors = [akRight, akBottom]
Cancel = True
Caption = 'Close'
Default = True
ModalResult = 1
TabOrder = 1
OnClick = ButtonCloseClick
end end
object pnlRight: TPanel object pnlMain: TPanel
Left = 161 AlignWithMargins = True
Top = 0 Left = 8
Width = 421 Top = 8
Height = 336 Width = 566
Height = 307
Margins.Left = 8
Margins.Top = 8
Margins.Right = 8
Margins.Bottom = 40
Align = alClient Align = alClient
BevelOuter = bvNone BevelOuter = bvNone
Padding.Top = 3
Padding.Right = 3
Padding.Bottom = 3
TabOrder = 2 TabOrder = 2
object Splitter2: TSplitter object Splitter1: TSplitter
Left = 0 Left = 153
Top = 171 Top = 0
Width = 418 Width = 8
Height = 8 Height = 307
Cursor = crSizeNS Cursor = crSizeWE
Align = alTop
ResizeStyle = rsUpdate ResizeStyle = rsUpdate
end end
object pnlRightTop: TPanel object pnlLeft: TPanel
Left = 0 Left = 0
Top = 3 Top = 0
Width = 418 Width = 153
Height = 168 Height = 307
Align = alTop Align = alLeft
Anchors = [akLeft, akTop, akRight, akBottom]
BevelOuter = bvNone BevelOuter = bvNone
TabOrder = 0 TabOrder = 0
object lblKeyword: TLabel object treeTopics: TTreeView
AlignWithMargins = True AlignWithMargins = True
Left = 0 Left = 0
Top = 5 Top = 24
Width = 418 Width = 153
Height = 16 Height = 283
Margins.Left = 0
Margins.Right = 0
Margins.Bottom = 0
Align = alClient
ChangeDelay = 50
Images = MainForm.ImageListMain
Indent = 19
ReadOnly = True
ShowLines = False
TabOrder = 1
OnChange = treeTopicsChange
OnExpanding = treeTopicsExpanding
end
object editFilter: TButtonedEdit
AlignWithMargins = True
Left = 0
Top = 0
Width = 153
Height = 21
Margins.Left = 0
Margins.Top = 0
Margins.Right = 0
Margins.Bottom = 0
Align = alTop
Images = MainForm.ImageListMain
LeftButton.Hint = 'Search'
LeftButton.ImageIndex = 53
LeftButton.Visible = True
TabOrder = 0
OnChange = editFilterChange
end
end
object pnlRight: TPanel
Left = 161
Top = 0
Width = 405
Height = 307
Align = alClient
BevelOuter = bvNone
TabOrder = 1
object Splitter2: TSplitter
Left = 0
Top = 182
Width = 405
Height = 8
Cursor = crSizeNS
Align = alTop
ResizeStyle = rsUpdate
end
object lblDescription: TLabel
Left = 0
Top = 16
Width = 405
Height = 13
Margins.Left = 0 Margins.Left = 0
Margins.Top = 5 Margins.Top = 5
Margins.Right = 0 Margins.Right = 0
Margins.Bottom = 0 Margins.Bottom = 0
Align = alTop Align = alTop
Caption = 'Description:'
end
object lblKeyword: TLabel
Left = 0
Top = 0
Width = 405
Height = 16
Align = alTop
Caption = 'lblKeyword' Caption = 'lblKeyword'
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
@ -120,68 +151,10 @@ object frmSQLhelp: TfrmSQLhelp
Font.Style = [fsBold] Font.Style = [fsBold]
ParentFont = False ParentFont = False
end end
object lblDescription: TLabel
AlignWithMargins = True
Left = 0
Top = 26
Width = 418
Height = 13
Margins.Left = 0
Margins.Top = 5
Margins.Right = 0
Margins.Bottom = 0
Align = alTop
Caption = 'Description:'
end
object memoDescription: TSynMemo
AlignWithMargins = True
Left = 0
Top = 44
Width = 418
Height = 124
Margins.Left = 0
Margins.Top = 5
Margins.Right = 0
Margins.Bottom = 0
SingleLineMode = False
Align = alClient
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Courier New'
Font.Style = []
TabOrder = 0
OnKeyDown = memosKeyDown
Gutter.Font.Charset = DEFAULT_CHARSET
Gutter.Font.Color = clWindowText
Gutter.Font.Height = -11
Gutter.Font.Name = 'Courier New'
Gutter.Font.Style = []
Gutter.Visible = False
Gutter.Width = 0
Highlighter = URIHighlighter
Options = [eoAutoIndent, eoDragDropEditing, eoEnhanceEndKey, eoGroupUndo, eoHideShowScrollbars, eoShowScrollHint, eoSmartTabDelete, eoSmartTabs, eoTabsToSpaces]
ReadOnly = True
RightEdge = 0
WordWrap = True
end
end
object pnlRightBottom: TPanel
Left = 0
Top = 179
Width = 418
Height = 154
Align = alClient
BevelOuter = bvNone
TabOrder = 1
DesignSize = (
418
154)
object lblExample: TLabel object lblExample: TLabel
AlignWithMargins = True
Left = 0 Left = 0
Top = 5 Top = 190
Width = 418 Width = 405
Height = 13 Height = 13
Margins.Left = 0 Margins.Left = 0
Margins.Top = 5 Margins.Top = 5
@ -190,31 +163,13 @@ object frmSQLhelp: TfrmSQLhelp
Align = alTop Align = alTop
Caption = 'Example:' Caption = 'Example:'
end end
object btnSearchOnline: TButton object memoDescription: TSynMemo
Left = 207
Top = 128
Width = 103
Height = 25
Anchors = [akRight, akBottom]
Caption = 'Search online'
ImageIndex = 69
Images = MainForm.ImageListMain
TabOrder = 2
OnClick = ButtonOnlinehelpClick
end
object MemoExample: TSynMemo
AlignWithMargins = True
Left = 0 Left = 0
Top = 23 Top = 29
Width = 418 Width = 405
Height = 90 Height = 153
Margins.Left = 0
Margins.Top = 5
Margins.Right = 0
Margins.Bottom = 0
SingleLineMode = False SingleLineMode = False
Align = alTop Align = alTop
Anchors = [akLeft, akTop, akRight, akBottom]
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -13 Font.Height = -13
@ -235,18 +190,32 @@ object frmSQLhelp: TfrmSQLhelp
RightEdge = 0 RightEdge = 0
WordWrap = True WordWrap = True
end end
object ButtonClose: TButton object MemoExample: TSynMemo
Left = 316 Left = 0
Top = 128 Top = 203
Width = 102 Width = 405
Height = 25 Height = 104
Anchors = [akRight, akBottom] SingleLineMode = False
Cancel = True Align = alClient
Caption = 'Close' Font.Charset = DEFAULT_CHARSET
Default = True Font.Color = clWindowText
ModalResult = 1 Font.Height = -13
Font.Name = 'Courier New'
Font.Style = []
TabOrder = 1 TabOrder = 1
OnClick = ButtonCloseClick OnKeyDown = memosKeyDown
Gutter.Font.Charset = DEFAULT_CHARSET
Gutter.Font.Color = clWindowText
Gutter.Font.Height = -11
Gutter.Font.Name = 'Courier New'
Gutter.Font.Style = []
Gutter.Visible = False
Gutter.Width = 0
Highlighter = URIHighlighter
Options = [eoAutoIndent, eoDragDropEditing, eoEnhanceEndKey, eoGroupUndo, eoHideShowScrollbars, eoShowScrollHint, eoSmartTabDelete, eoSmartTabs, eoTabsToSpaces]
ReadOnly = True
RightEdge = 0
WordWrap = True
end end
end end
end end

View File

@ -10,25 +10,23 @@ uses
type type
TfrmSQLhelp = class(TForm) TfrmSQLhelp = class(TForm)
pnlLeft: TPanel;
StatusBar1: TStatusBar;
Splitter1: TSplitter;
treeTopics: TTreeView;
pnlRight: TPanel;
pnlRightTop: TPanel;
lblKeyword: TLabel;
lblDescription: TLabel;
memoDescription: TSynMemo;
Splitter2: TSplitter;
pnlRightBottom: TPanel;
lblExample: TLabel;
MemoExample: TSynMemo;
ButtonClose: TButton;
btnSearchOnline: TButton;
URIOpenerDescription: TSynURIOpener; URIOpenerDescription: TSynURIOpener;
URIHighlighter: TSynURISyn; URIHighlighter: TSynURISyn;
URIOpenerExample: TSynURIOpener; URIOpenerExample: TSynURIOpener;
btnSearchOnline: TButton;
ButtonClose: TButton;
pnlMain: TPanel;
pnlLeft: TPanel;
treeTopics: TTreeView;
editFilter: TButtonedEdit; editFilter: TButtonedEdit;
pnlRight: TPanel;
Splitter2: TSplitter;
Splitter1: TSplitter;
lblDescription: TLabel;
lblKeyword: TLabel;
memoDescription: TSynMemo;
lblExample: TLabel;
MemoExample: TSynMemo;
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure treeTopicsExpanding(Sender: TObject; Node: TTreeNode; procedure treeTopicsExpanding(Sender: TObject; Node: TTreeNode;
var AllowExpansion: Boolean); var AllowExpansion: Boolean);
@ -73,6 +71,7 @@ uses helpers, main;
procedure TfrmSQLhelp.FormCreate(Sender: TObject); procedure TfrmSQLhelp.FormCreate(Sender: TObject);
begin begin
InheritFont(Font); InheritFont(Font);
SetWindowSizeGrip(Handle, True);
end; end;
@ -87,7 +86,7 @@ begin
Width := GetRegValue( REGNAME_SQLHELPWINWIDTH, Width ); Width := GetRegValue( REGNAME_SQLHELPWINWIDTH, Width );
Height := GetRegValue( REGNAME_SQLHELPWINHEIGHT, Height ); Height := GetRegValue( REGNAME_SQLHELPWINHEIGHT, Height );
pnlLeft.Width := GetRegValue( REGNAME_SQLHELPPLWIDTH, pnlLeft.Width ); pnlLeft.Width := GetRegValue( REGNAME_SQLHELPPLWIDTH, pnlLeft.Width );
pnlRightTop.Height := GetRegValue( REGNAME_SQLHELPPRHEIGHT, pnlRightTop.Height ); memoDescription.Height := GetRegValue( REGNAME_SQLHELPPRHEIGHT, memoDescription.Height );
Caption := DEFAULT_WINDOW_CAPTION; Caption := DEFAULT_WINDOW_CAPTION;
MainForm.SetupSynEditors; MainForm.SetupSynEditors;
@ -263,19 +262,10 @@ begin
end; end;
// Show the user if topic is (not) available // Show the user if topic is (not) available
with MemoDescription do if memoDescription.Text = '' then
begin memoDescription.Text := 'No help available for this keyword or no keyword was selected.';
Enabled := Text <> ''; if memoExample.Text = '' then
if not Enabled then memoExample.Text := 'No example available or no keyword was selected.';
Text := 'No help available for this keyword or no keyword was selected.';
end;
with MemoExample do
begin
Enabled := Text <> '';
if not Enabled then
Text := 'No example available or no keyword was selected.';
end;
end; end;
@ -291,7 +281,7 @@ begin
MainReg.WriteInteger( REGNAME_SQLHELPWINWIDTH, Width ); MainReg.WriteInteger( REGNAME_SQLHELPWINWIDTH, Width );
MainReg.WriteInteger( REGNAME_SQLHELPWINHEIGHT, Height ); MainReg.WriteInteger( REGNAME_SQLHELPWINHEIGHT, Height );
MainReg.WriteInteger( REGNAME_SQLHELPPLWIDTH, pnlLeft.Width ); MainReg.WriteInteger( REGNAME_SQLHELPPLWIDTH, pnlLeft.Width );
MainReg.WriteInteger( REGNAME_SQLHELPPRHEIGHT, PnlRightTop.Height ); MainReg.WriteInteger( REGNAME_SQLHELPPRHEIGHT, memoDescription.Height );
Close; Close;
end; end;