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,19 +24,37 @@ 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 PropsPageControl: TPageControl
Left = 0
Height = 196
Top = 0
Width = 462
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 object CallRegisterProcCheckBox: TCheckBox
Left = 0 Left = 0
Height = 23 Height = 23
@ -44,6 +62,7 @@ object PackageEditorForm: TPackageEditorForm
Width = 202 Width = 202
Caption = 'CallRegisterProcCheckBox' Caption = 'CallRegisterProcCheckBox'
OnChange = CallRegisterProcCheckBoxChange OnChange = CallRegisterProcCheckBoxChange
ParentFont = False
ParentShowHint = False ParentShowHint = False
ShowHint = True ShowHint = True
TabOrder = 0 TabOrder = 0
@ -58,6 +77,7 @@ object PackageEditorForm: TPackageEditorForm
BorderSpacing.Left = 10 BorderSpacing.Left = 10
Caption = 'AddToUsesPkgSectionCheckBox' Caption = 'AddToUsesPkgSectionCheckBox'
OnChange = AddToUsesPkgSectionCheckBoxChange OnChange = AddToUsesPkgSectionCheckBoxChange
ParentFont = False
ParentShowHint = False ParentShowHint = False
ShowHint = True ShowHint = True
TabOrder = 1 TabOrder = 1
@ -72,6 +92,7 @@ object PackageEditorForm: TPackageEditorForm
Width = 191 Width = 191
Caption = 'UseMinVersionCheckBox' Caption = 'UseMinVersionCheckBox'
OnChange = UseMinVersionCheckBoxChange OnChange = UseMinVersionCheckBoxChange
ParentFont = False
TabOrder = 2 TabOrder = 2
end end
object MinVersionEdit: TEdit object MinVersionEdit: TEdit
@ -84,6 +105,7 @@ object PackageEditorForm: TPackageEditorForm
Width = 100 Width = 100
BorderSpacing.Left = 10 BorderSpacing.Left = 10
OnChange = MinVersionEditChange OnChange = MinVersionEditChange
ParentFont = False
TabOrder = 3 TabOrder = 3
Text = 'MinVersionEdit' Text = 'MinVersionEdit'
end end
@ -97,6 +119,7 @@ object PackageEditorForm: TPackageEditorForm
Width = 194 Width = 194
Caption = 'UseMaxVersionCheckBox' Caption = 'UseMaxVersionCheckBox'
OnChange = UseMaxVersionCheckBoxChange OnChange = UseMaxVersionCheckBoxChange
ParentFont = False
TabOrder = 4 TabOrder = 4
end end
object MaxVersionEdit: TEdit object MaxVersionEdit: TEdit
@ -111,6 +134,7 @@ object PackageEditorForm: TPackageEditorForm
BorderSpacing.Left = 10 BorderSpacing.Left = 10
BorderSpacing.Top = 2 BorderSpacing.Top = 2
OnChange = MaxVersionEditChange OnChange = MaxVersionEditChange
ParentFont = False
TabOrder = 5 TabOrder = 5
Text = 'MaxVersionEdit' Text = 'MaxVersionEdit'
end end
@ -126,29 +150,32 @@ object PackageEditorForm: TPackageEditorForm
BorderSpacing.Top = 6 BorderSpacing.Top = 6
Caption = 'ApplyDependencyButton' Caption = 'ApplyDependencyButton'
OnClick = ApplyDependencyButtonClick OnClick = ApplyDependencyButtonClick
ParentFont = False
TabOrder = 6 TabOrder = 6
end end
object RegisteredPluginsGroupBox: TGroupBox object RegisteredPluginsGroupBox: TGroupBox
Left = 0 Left = 0
Height = 71 Height = 165
Top = 27 Top = 27
Width = 462 Width = 452
Align = alBottom Align = alBottom
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Top = 6 BorderSpacing.Top = 6
Caption = 'RegisteredPluginsGroupBox' Caption = 'RegisteredPluginsGroupBox'
ClientHeight = 51 ClientHeight = 145
ClientWidth = 460 ClientWidth = 450
ParentFont = False
TabOrder = 7 TabOrder = 7
object RegisteredListBox: TListBox object RegisteredListBox: TListBox
Left = 0 Left = 0
Height = 51 Height = 145
Top = 0 Top = 0
Width = 460 Width = 450
Align = alClient Align = alClient
ItemHeight = 0 ItemHeight = 0
OnDrawItem = RegisteredListBoxDrawItem OnDrawItem = RegisteredListBoxDrawItem
ScrollWidth = 458 ParentFont = False
ScrollWidth = 448
Style = lbOwnerDrawFixed Style = lbOwnerDrawFixed
TabOrder = 0 TabOrder = 0
TopIndex = -1 TopIndex = -1
@ -165,17 +192,21 @@ object PackageEditorForm: TPackageEditorForm
BorderSpacing.Left = 6 BorderSpacing.Left = 6
Caption = 'DisableI18NForLFMCheckBox' Caption = 'DisableI18NForLFMCheckBox'
OnChange = DisableI18NForLFMCheckBoxChange OnChange = DisableI18NForLFMCheckBoxChange
ParentFont = False
ParentShowHint = False ParentShowHint = False
ShowHint = True ShowHint = True
TabOrder = 8 TabOrder = 8
end end
end end
end
end
object StatusBar: TStatusBar object StatusBar: TStatusBar
Left = 0 Left = 0
Height = 21 Height = 21
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;