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';
lisPckEditRequiredPackages = 'Required Packages';
lisPckEditFileProperties = 'File Properties';
lisPckEditCommonOptions = 'Common';
lisPckEditRegisterUnit = 'Register unit';
lisPckEditCallRegisterProcedureOfSelectedUnit = 'Call %sRegister%s '
+'procedure of selected unit';

View File

@ -24,151 +24,181 @@ object PackageEditorForm: TPackageEditorForm
AutoSize = True
ButtonHeight = 46
ButtonWidth = 23
ParentFont = False
ShowCaptions = True
TabOrder = 0
end
object PropsGroupBox: TGroupBox
Left = 0
Height = 118
Height = 216
Top = 218
Width = 464
Align = alBottom
Caption = 'PropsGroupBox'
ClientHeight = 98
ClientHeight = 196
ClientWidth = 462
ParentFont = False
TabOrder = 3
object CallRegisterProcCheckBox: TCheckBox
object PropsPageControl: TPageControl
Left = 0
Height = 23
Height = 196
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
Align = alBottom
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Top = 6
Caption = 'RegisteredPluginsGroupBox'
ClientHeight = 51
ClientWidth = 460
TabOrder = 7
object RegisteredListBox: TListBox
Left = 0
Height = 51
Top = 0
Width = 460
Align = alClient
ItemHeight = 0
OnDrawItem = RegisteredListBoxDrawItem
ScrollWidth = 458
Style = lbOwnerDrawFixed
TabOrder = 0
TopIndex = -1
ActivePage = CommonOptionsTabSheet
Align = alClient
ParentFont = False
ShowTabs = False
TabIndex = 0
TabOrder = 0
object CommonOptionsTabSheet: TTabSheet
Caption = 'Common'
ClientHeight = 192
ClientWidth = 452
ParentFont = False
object CallRegisterProcCheckBox: TCheckBox
Left = 0
Height = 23
Top = 0
Width = 202
Caption = 'CallRegisterProcCheckBox'
OnChange = CallRegisterProcCheckBoxChange
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
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
object StatusBar: TStatusBar
Left = 0
@ -176,6 +206,7 @@ object PackageEditorForm: TPackageEditorForm
Top = 434
Width = 464
Panels = <>
ParentFont = False
end
object Splitter1: TSplitter
Cursor = crVSplit
@ -195,6 +226,7 @@ object PackageEditorForm: TPackageEditorForm
BevelOuter = bvNone
ClientHeight = 28
ClientWidth = 464
ParentFont = False
TabOrder = 1
object DirectoryHierarchyButton: TSpeedButton
AnchorSideLeft.Control = OpenButton
@ -215,6 +247,7 @@ object PackageEditorForm: TPackageEditorForm
GroupIndex = 1
OnClick = DirectoryHierarchyButtonClick
ShowHint = True
ParentFont = False
ParentShowHint = False
end
object SortAlphabeticallyButton: TSpeedButton
@ -235,6 +268,7 @@ object PackageEditorForm: TPackageEditorForm
GroupIndex = 2
OnClick = SortAlphabeticallyButtonClick
ShowHint = True
ParentFont = False
ParentShowHint = False
end
object FilterEdit: TTreeFilterEdit
@ -274,6 +308,7 @@ object PackageEditorForm: TPackageEditorForm
Constraints.MinWidth = 25
OnClick = OpenFileMenuItemClick
ShowHint = True
ParentFont = False
ParentShowHint = False
end
object MoveUpBtn: TSpeedButton
@ -291,6 +326,7 @@ object PackageEditorForm: TPackageEditorForm
Enabled = False
OnClick = MoveUpBtnClick
ShowHint = True
ParentFont = False
ParentShowHint = False
end
object MoveDownBtn: TSpeedButton
@ -308,6 +344,7 @@ object PackageEditorForm: TPackageEditorForm
Enabled = False
OnClick = MoveDownBtnClick
ShowHint = True
ParentFont = False
ParentShowHint = False
end
end
@ -320,6 +357,7 @@ object PackageEditorForm: TPackageEditorForm
BorderSpacing.Top = 1
DragMode = dmAutomatic
MultiSelect = True
ParentFont = False
PopupMenu = ItemsPopupMenu
ReadOnly = True
RightClickSelect = True
@ -332,15 +370,6 @@ object PackageEditorForm: TPackageEditorForm
OnSelectionChanged = ItemsTreeViewSelectionChanged
Options = [tvoAllowMultiselect, tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoRightClickSelect, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw]
end
object EditorsGroupsPanel: TPanel
Left = 0
Height = 98
Top = 336
Width = 464
Align = alBottom
BevelOuter = bvNone
TabOrder = 6
end
object ItemsPopupMenu: TPopupMenu
OnPopup = ItemsPopupMenuPopup
Left = 180

View File

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