ADD: Button Help for Options (#835)

* ADD: Button Help for Options

1. Added HelpKeywords for remaining pages.
2. Added Help button to show that you open Help. Button will be invisible when no HelpKeyword.
3. Some small changes: Default and Cancel for TAttributesEdit and change owner for calling from Option page (because when Position=poOwnerFormCenter the owner have to be properly set to avoid showing not at the center as it was before).
This commit is contained in:
Andrey 2023-02-27 22:13:30 +03:00 committed by GitHub
commit 4d07f5a03c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 51 additions and 27 deletions

View file

@ -540,6 +540,7 @@ object frmAttributesEdit: TfrmAttributesEdit
Width = 94
Caption = '&OK'
Constraints.MinHeight = 30
Default = True
Kind = bkOK
ModalResult = 1
OnClick = btnOkClick
@ -550,6 +551,7 @@ object frmAttributesEdit: TfrmAttributesEdit
Height = 32
Top = 0
Width = 118
Cancel = True
Caption = '&Cancel'
Constraints.MinHeight = 30
Kind = bkCancel

View file

@ -25,10 +25,11 @@ object frmOptions: TfrmOptions
AutoExpand = True
Images = OptionsEditorsImageList
ReadOnly = True
RowSelect = True
ScrollBars = ssAutoBoth
TabOrder = 0
OnChange = tvTreeViewChange
Options = [tvoAutoExpand, tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips]
Options = [tvoAutoExpand, tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoRowSelect, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips]
end
object Panel3: TPanel
Left = 196
@ -105,6 +106,24 @@ object frmOptions: TfrmOptions
ClientWidth = 640
FullRepaint = False
TabOrder = 2
object btnHelp: TBitBtn
AnchorSideLeft.Side = asrCenter
AnchorSideLeft.Control = TreeFilterEdit
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = btnOK
Left = 201
Height = 30
Top = 5
Width = 75
AutoSize = True
BorderSpacing.Left = 8
BorderSpacing.Right = 16
BorderSpacing.InnerBorder = 2
Caption = '&Help'
Kind = bkHelp
OnClick = btnHelpClick
TabOrder = 4
end
object btnOK: TBitBtn
AnchorSideRight.Control = btnCancel
Left = 321

View file

@ -50,6 +50,7 @@ type
{ TfrmOptions }
TfrmOptions = class(TForm, IOptionsDialog)
btnHelp: TBitBtn;
lblEmptyEditor: TLabel;
OptionsEditorsImageList: TImageList;
pnlButtons: TKASButtonPanel;
@ -65,6 +66,7 @@ type
alOptionsActionList: TActionList;
actCloseWithEscape: TAction;
procedure btnCancelClick(Sender: TObject);
procedure btnHelpClick(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
procedure FormCreate(Sender: TObject);
@ -106,7 +108,7 @@ implementation
{$R *.lfm}
uses
LCLProc, LCLVersion, LazUTF8, LResources, Menus, Translations, Graphics,
HelpIntfs, LCLProc, LCLVersion, LazUTF8, LResources, Menus, Translations, Graphics,
DCStrUtils, uTranslator, uLng, uGlobsPaths, fMain;
var
@ -229,6 +231,11 @@ begin
Close;
end;
procedure TfrmOptions.btnHelpClick(Sender: TObject);
begin
ShowHelpOrErrorForKeyword('', HelpKeyword);
end;
procedure TfrmOptions.btnOKClick(Sender: TObject);
begin
// save all configuration
@ -469,7 +476,10 @@ begin
if Assigned(SelectedEditorView.Instance) then
begin
HelpKeyword:= SelectedEditorView.Instance.HelpKeyword;
end;
btnHelp.Visible := HelpKeyword <> '';
end
else
btnHelp.Visible:= False;
end;
end;

View file

@ -171,7 +171,7 @@ inherited frmOptionsDirectoryHotlist: TfrmOptionsDirectoryHotlist
Tag = 7
AnchorSideTop.Control = btnSort
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = btnHelp
AnchorSideRight.Control = btnBackup
Left = 8
Height = 25
Top = 124
@ -215,20 +215,6 @@ inherited frmOptionsDirectoryHotlist: TfrmOptionsDirectoryHotlist
OnClick = btnActionClick
TabOrder = 3
end
object btnHelp: TBitBtn
AnchorSideTop.Control = btnMiscellaneous
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = pnlButtons
AnchorSideRight.Side = asrBottom
Left = 164
Height = 25
Top = 124
Width = 150
Anchors = [akTop, akRight]
Caption = '&Help'
OnClick = btnHelpClick
TabOrder = 8
end
end
object rgWhereToAdd: TRadioGroup
AnchorSideLeft.Control = gbHotlistOtherOptions

View file

@ -173,7 +173,6 @@ type
btnExport: TBitBtn;
btnImport: TBitBtn;
btnBackup: TBitBtn;
btnHelp: TBitBtn;
pnlBottom: TPanel;
rgWhereToAdd: TRadioGroup;
gbHotlistOtherOptions: TGroupBox;
@ -216,7 +215,6 @@ type
procedure miImportFromAnythingClick(Sender: TObject);
procedure miGotoConfigureTCInfoClick(Sender: TObject);
procedure btnActionClick(Sender: TObject);
procedure btnHelpClick(Sender: TObject);
procedure cbFullExpandTreeChange(Sender: TObject);
procedure lbleditHotDirNameChange(Sender: TObject);
procedure anyRelativeAbsolutePathClick(Sender: TObject);
@ -1326,12 +1324,6 @@ begin
end;
end;
{ TfrmOptionsDirectoryHotlist.btnHelpClick }
procedure TfrmOptionsDirectoryHotlist.btnHelpClick(Sender: TObject);
begin
ShowHelpOrErrorForKeyword('', '/directoryhotlist.html');
end;
{ TfrmOptionsDirectoryHotlist.cbFullExpandTreeChange }
procedure TfrmOptionsDirectoryHotlist.cbFullExpandTreeChange(Sender: TObject);
begin

View file

@ -171,6 +171,8 @@ inherited frmOptionsFilesViewsComplement: TfrmOptionsFilesViewsComplement
Height = 27
Top = 0
Width = 304
HelpType = htKeyword
HelpKeyword = '/findfiles.html#attributes'
Anchors = [akTop, akLeft, akRight]
TabOrder = 0
end

View file

@ -129,7 +129,7 @@ procedure TfrmOptionsFilesViewsComplement.btnAddAttributeClick(Sender: TObject);
var
FFrmAttributesEdit: TfrmAttributesEdit;
begin
FFrmAttributesEdit := TfrmAttributesEdit.Create(Self);
FFrmAttributesEdit := TfrmAttributesEdit.Create(Owner);
try
FFrmAttributesEdit.OnOk := @OnAddAttribute;
FFrmAttributesEdit.Reset;

View file

@ -1,6 +1,7 @@
inherited frmOptionsQuickSearchFilter: TfrmOptionsQuickSearchFilter
Height = 354
Width = 702
HelpKeyword = '/configuration.html#ConfigQuick'
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
ClientHeight = 354

View file

@ -1,6 +1,7 @@
inherited frmOptionsTabs: TfrmOptionsTabs
Height = 492
Width = 731
HelpKeyword = '/configuration.html#ConfigTabs'
ClientHeight = 492
ClientWidth = 731
DesignLeft = 147

View file

@ -1,6 +1,7 @@
inherited frmOptionsTabsExtra: TfrmOptionsTabsExtra
Height = 418
Width = 720
HelpKeyword = '/configuration.html#ConfigTabsEx'
AutoSize = True
ClientHeight = 418
ClientWidth = 720

View file

@ -1,6 +1,7 @@
inherited frmOptionsTerminal: TfrmOptionsTerminal
Height = 324
Width = 519
HelpKeyword = '/configuration.html#ConfigToolsTerminal'
AutoSize = True
ClientHeight = 324
ClientWidth = 519

View file

@ -1,2 +1,3 @@
inherited frmOptionsToolbar: TfrmOptionsToolbar
HelpKeyword = '/configuration.html#ConfigToolbar'
end

View file

@ -1,6 +1,7 @@
inherited frmOptionsToolbarExtra: TfrmOptionsToolbarExtra
Height = 573
Width = 850
HelpKeyword = '/configuration.html#ConfigToolbarEx'
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
ClientHeight = 573

View file

@ -1,2 +1,3 @@
inherited frmOptionsToolbarMiddle: TfrmOptionsToolbarMiddle
HelpKeyword = '/configuration.html#ConfigToolbar'
end

View file

@ -1,6 +1,7 @@
inherited frmOptionsViewer: TfrmOptionsViewer
Height = 513
Width = 586
HelpKeyword = '/configuration.html#ConfigToolsViewer'
ClientHeight = 513
ClientWidth = 586
DesignLeft = 384

View file

@ -1,6 +1,7 @@
inherited frmOptionsDiffer: TfrmOptionsDiffer
Height = 478
Width = 586
HelpKeyword = '/configuration.html#ConfigToolsDiffer'
ClientHeight = 478
ClientWidth = 586
DesignLeft = 377

View file

@ -1,6 +1,7 @@
inherited frmOptionsEditor: TfrmOptionsEditor
Height = 513
Width = 601
HelpKeyword = '/configuration.html#ConfigToolsEditor'
ClientHeight = 513
ClientWidth = 601
ParentShowHint = False

View file

@ -1,6 +1,7 @@
inherited frmOptionsToolTips: TfrmOptionsToolTips
Height = 480
Width = 826
HelpKeyword = '/configuration.html#ConfigTooltips'
AutoSize = True
ClientHeight = 480
ClientWidth = 826

View file

@ -1,6 +1,7 @@
inherited frmOptionsTreeViewMenu: TfrmOptionsTreeViewMenu
Height = 415
Width = 590
HelpKeyword = '/configuration.html#ConfigTreeMenu'
AutoSize = True
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6

View file

@ -1,6 +1,7 @@
inherited frmOptionsTreeViewMenuColor: TfrmOptionsTreeViewMenuColor
Height = 478
Width = 600
HelpKeyword = '/configuration.html#ConfigTreeMenuColor'
AutoSize = True
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6