Packager: Combine the common and custom options in one page-control

git-svn-id: trunk@59922 -
This commit is contained in:
joost 2018-12-28 16:10:54 +00:00
parent bb22647c7d
commit 9b2dbd5b1f
3 changed files with 187 additions and 158 deletions

View File

@ -4661,6 +4661,7 @@ resourcestring
lisPkgEdMoreFunctionsForThePackage = 'More functions for the package'; lisPkgEdMoreFunctionsForThePackage = 'More functions for the package';
lisPckEditRequiredPackages = 'Required Packages'; lisPckEditRequiredPackages = 'Required Packages';
lisPckEditFileProperties = 'File Properties'; lisPckEditFileProperties = 'File Properties';
lisPckEditCommonOptions = 'Common';
lisPckEditRegisterUnit = 'Register unit'; lisPckEditRegisterUnit = 'Register unit';
lisPckEditCallRegisterProcedureOfSelectedUnit = 'Call %sRegister%s ' lisPckEditCallRegisterProcedureOfSelectedUnit = 'Call %sRegister%s '
+'procedure of selected unit'; +'procedure of selected unit';

View File

@ -24,151 +24,181 @@ object PackageEditorForm: TPackageEditorForm
AutoSize = True AutoSize = True
ButtonHeight = 46 ButtonHeight = 46
ButtonWidth = 23 ButtonWidth = 23
ParentFont = False
ShowCaptions = True ShowCaptions = True
TabOrder = 0 TabOrder = 0
end end
object PropsGroupBox: TGroupBox object PropsGroupBox: TGroupBox
Left = 0 Left = 0
Height = 118 Height = 216
Top = 218 Top = 218
Width = 464 Width = 464
Align = alBottom Align = alBottom
Caption = 'PropsGroupBox' Caption = 'PropsGroupBox'
ClientHeight = 98 ClientHeight = 196
ClientWidth = 462 ClientWidth = 462
ParentFont = False
TabOrder = 3 TabOrder = 3
object CallRegisterProcCheckBox: TCheckBox object PropsPageControl: TPageControl
Left = 0 Left = 0
Height = 23 Height = 196
Top = 0 Top = 0
Width = 202
Caption = 'CallRegisterProcCheckBox'
OnChange = CallRegisterProcCheckBoxChange
ParentShowHint = False
ShowHint = True
TabOrder = 0
end
object AddToUsesPkgSectionCheckBox: TCheckBox
AnchorSideLeft.Control = CallRegisterProcCheckBox
AnchorSideLeft.Side = asrBottom
Left = 212
Height = 23
Top = 0
Width = 239
BorderSpacing.Left = 10
Caption = 'AddToUsesPkgSectionCheckBox'
OnChange = AddToUsesPkgSectionCheckBoxChange
ParentShowHint = False
ShowHint = True
TabOrder = 1
end
object UseMinVersionCheckBox: TCheckBox
AnchorSideLeft.Control = PropsGroupBox
AnchorSideTop.Control = MinVersionEdit
AnchorSideTop.Side = asrCenter
Left = 0
Height = 23
Top = 7
Width = 191
Caption = 'UseMinVersionCheckBox'
OnChange = UseMinVersionCheckBoxChange
TabOrder = 2
end
object MinVersionEdit: TEdit
AnchorSideLeft.Control = UseMinVersionCheckBox
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = PropsGroupBox
Left = 201
Height = 36
Top = 0
Width = 100
BorderSpacing.Left = 10
OnChange = MinVersionEditChange
TabOrder = 3
Text = 'MinVersionEdit'
end
object UseMaxVersionCheckBox: TCheckBox
AnchorSideLeft.Control = PropsGroupBox
AnchorSideTop.Control = MaxVersionEdit
AnchorSideTop.Side = asrCenter
Left = 0
Height = 23
Top = 45
Width = 194
Caption = 'UseMaxVersionCheckBox'
OnChange = UseMaxVersionCheckBoxChange
TabOrder = 4
end
object MaxVersionEdit: TEdit
AnchorSideLeft.Control = UseMaxVersionCheckBox
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = MinVersionEdit
AnchorSideTop.Side = asrBottom
Left = 204
Height = 36
Top = 38
Width = 100
BorderSpacing.Left = 10
BorderSpacing.Top = 2
OnChange = MaxVersionEditChange
TabOrder = 5
Text = 'MaxVersionEdit'
end
object ApplyDependencyButton: TButton
AnchorSideLeft.Control = PropsGroupBox
AnchorSideTop.Control = MaxVersionEdit
AnchorSideTop.Side = asrBottom
Left = 0
Height = 35
Top = 80
Width = 178
AutoSize = True
BorderSpacing.Top = 6
Caption = 'ApplyDependencyButton'
OnClick = ApplyDependencyButtonClick
TabOrder = 6
end
object RegisteredPluginsGroupBox: TGroupBox
Left = 0
Height = 71
Top = 27
Width = 462 Width = 462
Align = alBottom ActivePage = CommonOptionsTabSheet
Anchors = [akTop, akLeft, akRight, akBottom] Align = alClient
BorderSpacing.Top = 6 ParentFont = False
Caption = 'RegisteredPluginsGroupBox' ShowTabs = False
ClientHeight = 51 TabIndex = 0
ClientWidth = 460 TabOrder = 0
TabOrder = 7 object CommonOptionsTabSheet: TTabSheet
object RegisteredListBox: TListBox Caption = 'Common'
Left = 0 ClientHeight = 192
Height = 51 ClientWidth = 452
Top = 0 ParentFont = False
Width = 460 object CallRegisterProcCheckBox: TCheckBox
Align = alClient Left = 0
ItemHeight = 0 Height = 23
OnDrawItem = RegisteredListBoxDrawItem Top = 0
ScrollWidth = 458 Width = 202
Style = lbOwnerDrawFixed Caption = 'CallRegisterProcCheckBox'
TabOrder = 0 OnChange = CallRegisterProcCheckBoxChange
TopIndex = -1 ParentFont = False
ParentShowHint = False
ShowHint = True
TabOrder = 0
end
object AddToUsesPkgSectionCheckBox: TCheckBox
AnchorSideLeft.Control = CallRegisterProcCheckBox
AnchorSideLeft.Side = asrBottom
Left = 212
Height = 23
Top = 0
Width = 239
BorderSpacing.Left = 10
Caption = 'AddToUsesPkgSectionCheckBox'
OnChange = AddToUsesPkgSectionCheckBoxChange
ParentFont = False
ParentShowHint = False
ShowHint = True
TabOrder = 1
end
object UseMinVersionCheckBox: TCheckBox
AnchorSideLeft.Control = PropsGroupBox
AnchorSideTop.Control = MinVersionEdit
AnchorSideTop.Side = asrCenter
Left = 0
Height = 23
Top = 7
Width = 191
Caption = 'UseMinVersionCheckBox'
OnChange = UseMinVersionCheckBoxChange
ParentFont = False
TabOrder = 2
end
object MinVersionEdit: TEdit
AnchorSideLeft.Control = UseMinVersionCheckBox
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = PropsGroupBox
Left = 201
Height = 36
Top = 0
Width = 100
BorderSpacing.Left = 10
OnChange = MinVersionEditChange
ParentFont = False
TabOrder = 3
Text = 'MinVersionEdit'
end
object UseMaxVersionCheckBox: TCheckBox
AnchorSideLeft.Control = PropsGroupBox
AnchorSideTop.Control = MaxVersionEdit
AnchorSideTop.Side = asrCenter
Left = 0
Height = 23
Top = 45
Width = 194
Caption = 'UseMaxVersionCheckBox'
OnChange = UseMaxVersionCheckBoxChange
ParentFont = False
TabOrder = 4
end
object MaxVersionEdit: TEdit
AnchorSideLeft.Control = UseMaxVersionCheckBox
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = MinVersionEdit
AnchorSideTop.Side = asrBottom
Left = 204
Height = 36
Top = 38
Width = 100
BorderSpacing.Left = 10
BorderSpacing.Top = 2
OnChange = MaxVersionEditChange
ParentFont = False
TabOrder = 5
Text = 'MaxVersionEdit'
end
object ApplyDependencyButton: TButton
AnchorSideLeft.Control = PropsGroupBox
AnchorSideTop.Control = MaxVersionEdit
AnchorSideTop.Side = asrBottom
Left = 0
Height = 35
Top = 80
Width = 178
AutoSize = True
BorderSpacing.Top = 6
Caption = 'ApplyDependencyButton'
OnClick = ApplyDependencyButtonClick
ParentFont = False
TabOrder = 6
end
object RegisteredPluginsGroupBox: TGroupBox
Left = 0
Height = 165
Top = 27
Width = 452
Align = alBottom
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Top = 6
Caption = 'RegisteredPluginsGroupBox'
ClientHeight = 145
ClientWidth = 450
ParentFont = False
TabOrder = 7
object RegisteredListBox: TListBox
Left = 0
Height = 145
Top = 0
Width = 450
Align = alClient
ItemHeight = 0
OnDrawItem = RegisteredListBoxDrawItem
ParentFont = False
ScrollWidth = 448
Style = lbOwnerDrawFixed
TabOrder = 0
TopIndex = -1
end
end
object DisableI18NForLFMCheckBox: TCheckBox
AnchorSideLeft.Control = AddToUsesPkgSectionCheckBox
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = AddToUsesPkgSectionCheckBox
Left = 457
Height = 23
Top = 0
Width = 225
BorderSpacing.Left = 6
Caption = 'DisableI18NForLFMCheckBox'
OnChange = DisableI18NForLFMCheckBoxChange
ParentFont = False
ParentShowHint = False
ShowHint = True
TabOrder = 8
end
end end
end end
object DisableI18NForLFMCheckBox: TCheckBox
AnchorSideLeft.Control = AddToUsesPkgSectionCheckBox
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = AddToUsesPkgSectionCheckBox
Left = 457
Height = 23
Top = 0
Width = 225
BorderSpacing.Left = 6
Caption = 'DisableI18NForLFMCheckBox'
OnChange = DisableI18NForLFMCheckBoxChange
ParentShowHint = False
ShowHint = True
TabOrder = 8
end
end end
object StatusBar: TStatusBar object StatusBar: TStatusBar
Left = 0 Left = 0
@ -176,6 +206,7 @@ object PackageEditorForm: TPackageEditorForm
Top = 434 Top = 434
Width = 464 Width = 464
Panels = <> Panels = <>
ParentFont = False
end end
object Splitter1: TSplitter object Splitter1: TSplitter
Cursor = crVSplit Cursor = crVSplit
@ -195,6 +226,7 @@ object PackageEditorForm: TPackageEditorForm
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 28 ClientHeight = 28
ClientWidth = 464 ClientWidth = 464
ParentFont = False
TabOrder = 1 TabOrder = 1
object DirectoryHierarchyButton: TSpeedButton object DirectoryHierarchyButton: TSpeedButton
AnchorSideLeft.Control = OpenButton AnchorSideLeft.Control = OpenButton
@ -215,6 +247,7 @@ object PackageEditorForm: TPackageEditorForm
GroupIndex = 1 GroupIndex = 1
OnClick = DirectoryHierarchyButtonClick OnClick = DirectoryHierarchyButtonClick
ShowHint = True ShowHint = True
ParentFont = False
ParentShowHint = False ParentShowHint = False
end end
object SortAlphabeticallyButton: TSpeedButton object SortAlphabeticallyButton: TSpeedButton
@ -235,6 +268,7 @@ object PackageEditorForm: TPackageEditorForm
GroupIndex = 2 GroupIndex = 2
OnClick = SortAlphabeticallyButtonClick OnClick = SortAlphabeticallyButtonClick
ShowHint = True ShowHint = True
ParentFont = False
ParentShowHint = False ParentShowHint = False
end end
object FilterEdit: TTreeFilterEdit object FilterEdit: TTreeFilterEdit
@ -274,6 +308,7 @@ object PackageEditorForm: TPackageEditorForm
Constraints.MinWidth = 25 Constraints.MinWidth = 25
OnClick = OpenFileMenuItemClick OnClick = OpenFileMenuItemClick
ShowHint = True ShowHint = True
ParentFont = False
ParentShowHint = False ParentShowHint = False
end end
object MoveUpBtn: TSpeedButton object MoveUpBtn: TSpeedButton
@ -291,6 +326,7 @@ object PackageEditorForm: TPackageEditorForm
Enabled = False Enabled = False
OnClick = MoveUpBtnClick OnClick = MoveUpBtnClick
ShowHint = True ShowHint = True
ParentFont = False
ParentShowHint = False ParentShowHint = False
end end
object MoveDownBtn: TSpeedButton object MoveDownBtn: TSpeedButton
@ -308,6 +344,7 @@ object PackageEditorForm: TPackageEditorForm
Enabled = False Enabled = False
OnClick = MoveDownBtnClick OnClick = MoveDownBtnClick
ShowHint = True ShowHint = True
ParentFont = False
ParentShowHint = False ParentShowHint = False
end end
end end
@ -320,6 +357,7 @@ object PackageEditorForm: TPackageEditorForm
BorderSpacing.Top = 1 BorderSpacing.Top = 1
DragMode = dmAutomatic DragMode = dmAutomatic
MultiSelect = True MultiSelect = True
ParentFont = False
PopupMenu = ItemsPopupMenu PopupMenu = ItemsPopupMenu
ReadOnly = True ReadOnly = True
RightClickSelect = True RightClickSelect = True
@ -332,15 +370,6 @@ object PackageEditorForm: TPackageEditorForm
OnSelectionChanged = ItemsTreeViewSelectionChanged OnSelectionChanged = ItemsTreeViewSelectionChanged
Options = [tvoAllowMultiselect, tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoRightClickSelect, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw] Options = [tvoAllowMultiselect, tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoRightClickSelect, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw]
end end
object EditorsGroupsPanel: TPanel
Left = 0
Height = 98
Top = 336
Width = 464
Align = alBottom
BevelOuter = bvNone
TabOrder = 6
end
object ItemsPopupMenu: TPopupMenu object ItemsPopupMenu: TPopupMenu
OnPopup = ItemsPopupMenuPopup OnPopup = ItemsPopupMenuPopup
Left = 180 Left = 180

View File

@ -239,7 +239,8 @@ type
UsePopupMenu: TPopupMenu; UsePopupMenu: TPopupMenu;
ItemsPopupMenu: TPopupMenu; ItemsPopupMenu: TPopupMenu;
MorePopupMenu: TPopupMenu; MorePopupMenu: TPopupMenu;
EditorsGroupsPanel: TPanel; PropsPageControl: TPageControl;
CommonOptionsTabSheet: TTabSheet;
procedure AddToProjectClick(Sender: TObject); procedure AddToProjectClick(Sender: TObject);
procedure AddToUsesPkgSectionCheckBoxChange(Sender: TObject); procedure AddToUsesPkgSectionCheckBoxChange(Sender: TObject);
procedure ApplyDependencyButtonClick(Sender: TObject); procedure ApplyDependencyButtonClick(Sender: TObject);
@ -327,7 +328,6 @@ type
FSingleSelectedNode: TTreeNode; FSingleSelectedNode: TTreeNode;
FSingleSelectedFile: TPkgFile; FSingleSelectedFile: TPkgFile;
FSingleSelectedDep: TPkgDependency; FSingleSelectedDep: TPkgDependency;
FHasEditorsGroups: Boolean;
FOptionsShownOfFile: TPkgFile; FOptionsShownOfFile: TPkgFile;
FFirstNodeData: array[TPENodeType] of TPENodeData; FFirstNodeData: array[TPENodeType] of TPENodeData;
fUpdateLock: integer; fUpdateLock: integer;
@ -2000,6 +2000,7 @@ begin
ItemsTreeView.EndUpdate; ItemsTreeView.EndUpdate;
PropsGroupBox.Caption:=lisPckEditFileProperties; PropsGroupBox.Caption:=lisPckEditFileProperties;
CommonOptionsTabSheet.Caption:=lisPckEditCommonOptions;
CallRegisterProcCheckBox.Caption:=lisPckEditRegisterUnit; CallRegisterProcCheckBox.Caption:=lisPckEditRegisterUnit;
CallRegisterProcCheckBox.Hint:=Format(lisPckEditCallRegisterProcedureOfSelectedUnit, ['"', '"']); CallRegisterProcCheckBox.Hint:=Format(lisPckEditCallRegisterProcedureOfSelectedUnit, ['"', '"']);
@ -2020,7 +2021,7 @@ begin
with FDirSummaryLabel do with FDirSummaryLabel do
begin begin
Name:='DirSummaryLabel'; Name:='DirSummaryLabel';
Parent:=PropsGroupBox; Parent:=CommonOptionsTabSheet;
end; end;
CreatePackageFileEditors; CreatePackageFileEditors;
@ -2805,10 +2806,14 @@ begin
end; end;
if FSingleSelectedFile<>nil then begin if FSingleSelectedFile<>nil then begin
EditorsGroupsPanel.Visible := FHasEditorsGroups; for i := 2 to PropsPageControl.PageCount -1 do
PropsPageControl.pages[i].Visible := True;
FileOptionsToGui; FileOptionsToGui;
PropsPageControl.ShowTabs := PropsPageControl.PageCount > 1;
end else begin end else begin
EditorsGroupsPanel.Visible := False; for i := 2 to PropsPageControl.PageCount -1 do
PropsPageControl.pages[i].Visible := False;
PropsPageControl.ShowTabs := False;
end; end;
finally finally
EnableAlign; EnableAlign;
@ -3350,7 +3355,7 @@ procedure TPackageEditorForm.TraverseSettings(AOptions: TAbstractPackageFileIDEO
end; end;
begin begin
Traverse(EditorsGroupsPanel); Traverse(PropsPageControl);
end; end;
procedure TPackageEditorForm.CreatePackageFileEditors; procedure TPackageEditorForm.CreatePackageFileEditors;
@ -3359,12 +3364,12 @@ var
Instance: TAbstractIDEOptionsEditor; Instance: TAbstractIDEOptionsEditor;
i, j: integer; i, j: integer;
Rec: PIDEOptionsGroupRec; Rec: PIDEOptionsGroupRec;
AGroupCaption: string;
ACaption: string; ACaption: string;
ItemTabSheet: TTabSheet; ItemTabSheet: TTabSheet;
GroupPageControl: TPageControl; GroupPageControl: TPageControl;
GroupGroupBox: TGroupBox; GroupGroupBox: TGroupBox;
begin begin
FHasEditorsGroups := False;
IDEEditorGroups.Resort; IDEEditorGroups.Resort;
for i := 0 to IDEEditorGroups.Count - 1 do for i := 0 to IDEEditorGroups.Count - 1 do
@ -3374,21 +3379,13 @@ begin
if PassesFilter(Rec) then if PassesFilter(Rec) then
begin begin
if Rec^.GroupClass<>nil then if Rec^.GroupClass<>nil then
ACaption := Rec^.GroupClass.GetGroupCaption AGroupCaption := Rec^.GroupClass.GetGroupCaption
else else
ACaption := format('Group<%d>',[i]); AGroupCaption := '';
GroupGroupBox := TGroupBox.Create(Self);
GroupGroupBox.Caption := ACaption;
GroupGroupBox.Align := alClient;
GroupGroupBox.Parent := EditorsGroupsPanel;
GroupPageControl := TPageControl.Create(Self);
GroupPageControl.Parent := GroupGroupBox;
GroupPageControl.Align := alClient;
FHasEditorsGroups := True;
for j := 0 to Rec^.Items.Count - 1 do for j := 0 to Rec^.Items.Count - 1 do
begin begin
ItemTabSheet := GroupPageControl.AddTabSheet; ItemTabSheet := PropsPageControl.AddTabSheet;
ItemTabSheet.Align := alClient; ItemTabSheet.Align := alClient;
Instance := Rec^.Items[j]^.EditorClass.Create(Self); Instance := Rec^.Items[j]^.EditorClass.Create(Self);
@ -3403,11 +3400,13 @@ begin
Instance.Tag := Rec^.Items[j]^.Index; Instance.Tag := Rec^.Items[j]^.Index;
Instance.Parent := ItemTabSheet; Instance.Parent := ItemTabSheet;
Instance.Rec := Rec^.Items[j]; Instance.Rec := Rec^.Items[j];
ItemTabSheet.Caption := Instance.GetTitle; ACaption := Instance.GetTitle;
if AGroupCaption <> ACaption then
ACaption := AGroupCaption + ' - ' + ACaption;
ItemTabSheet.Caption := ACaption;
end; end;
end; end;
end; end;
EditorsGroupsPanel.Visible := FHasEditorsGroups;
end; end;
procedure TPackageEditorForm.FileOptionsToGui; procedure TPackageEditorForm.FileOptionsToGui;