mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-27 09:21:34 +01:00
IDE: Improve adding a new file to package, reuse the "New..." dialog. Issue #28097, patch from Alexey Torgashin.
git-svn-id: trunk@49096 -
This commit is contained in:
parent
33cd7f6258
commit
4be547210a
@ -8,23 +8,23 @@ object NewOtherDialog: TNewOtherDialog
|
|||||||
ClientHeight = 421
|
ClientHeight = 421
|
||||||
ClientWidth = 561
|
ClientWidth = 561
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
LCLVersion = '1.1'
|
LCLVersion = '1.5'
|
||||||
object Panel1: TPanel
|
object Panel1: TPanel
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 370
|
Height = 374
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 549
|
Width = 549
|
||||||
Align = alClient
|
Align = alClient
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
ClientHeight = 370
|
ClientHeight = 374
|
||||||
ClientWidth = 549
|
ClientWidth = 549
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object ItemsTreeView: TTreeView
|
object ItemsTreeView: TTreeView
|
||||||
AnchorSideLeft.Control = Owner
|
AnchorSideLeft.Control = Owner
|
||||||
AnchorSideTop.Control = Owner
|
AnchorSideTop.Control = Owner
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 370
|
Height = 374
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 263
|
Width = 263
|
||||||
Align = alClient
|
Align = alClient
|
||||||
@ -41,19 +41,19 @@ object NewOtherDialog: TNewOtherDialog
|
|||||||
AnchorSideTop.Control = Owner
|
AnchorSideTop.Control = Owner
|
||||||
AnchorSideRight.Control = Owner
|
AnchorSideRight.Control = Owner
|
||||||
Left = 268
|
Left = 268
|
||||||
Height = 370
|
Height = 374
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 281
|
Width = 281
|
||||||
Align = alRight
|
Align = alRight
|
||||||
Caption = 'DescriptionGroupBox'
|
Caption = 'DescriptionGroupBox'
|
||||||
ClientHeight = 349
|
ClientHeight = 353
|
||||||
ClientWidth = 273
|
ClientWidth = 277
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
object DescriptionLabel: TLabel
|
object DescriptionLabel: TLabel
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 17
|
Height = 17
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 261
|
Width = 265
|
||||||
Align = alTop
|
Align = alTop
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
Caption = 'DescriptionLabel'
|
Caption = 'DescriptionLabel'
|
||||||
@ -62,9 +62,9 @@ object NewOtherDialog: TNewOtherDialog
|
|||||||
end
|
end
|
||||||
object InheritableComponentsListView: TListView
|
object InheritableComponentsListView: TListView
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 320
|
Height = 324
|
||||||
Top = 29
|
Top = 29
|
||||||
Width = 273
|
Width = 277
|
||||||
Align = alClient
|
Align = alClient
|
||||||
Columns = <
|
Columns = <
|
||||||
item
|
item
|
||||||
@ -86,7 +86,7 @@ object NewOtherDialog: TNewOtherDialog
|
|||||||
end
|
end
|
||||||
object Splitter1: TSplitter
|
object Splitter1: TSplitter
|
||||||
Left = 263
|
Left = 263
|
||||||
Height = 370
|
Height = 374
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 5
|
Width = 5
|
||||||
Align = alRight
|
Align = alRight
|
||||||
@ -95,8 +95,8 @@ object NewOtherDialog: TNewOtherDialog
|
|||||||
end
|
end
|
||||||
object ButtonPanel: TButtonPanel
|
object ButtonPanel: TButtonPanel
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 33
|
Height = 29
|
||||||
Top = 382
|
Top = 386
|
||||||
Width = 549
|
Width = 549
|
||||||
OKButton.Name = 'OKButton'
|
OKButton.Name = 'OKButton'
|
||||||
OKButton.DefaultCaption = True
|
OKButton.DefaultCaption = True
|
||||||
|
|||||||
@ -133,31 +133,34 @@ type
|
|||||||
ImageIndexTemplate: integer;
|
ImageIndexTemplate: integer;
|
||||||
FNewItem: TNewIDEItemTemplate;
|
FNewItem: TNewIDEItemTemplate;
|
||||||
procedure FillProjectInheritableItemsList;
|
procedure FillProjectInheritableItemsList;
|
||||||
procedure FillItemsTree;
|
procedure FillItemsTree(AOnlyModules: boolean);
|
||||||
procedure SetupComponents;
|
procedure SetupComponents;
|
||||||
procedure UpdateDescription;
|
procedure UpdateDescription;
|
||||||
function FindItem(const aName: string): TTreeNode;
|
function FindItem(const aName: string): TTreeNode;
|
||||||
public
|
public
|
||||||
constructor Create(TheOwner: TComponent); override;
|
constructor Create(TheOwner: TComponent; AOnlyModules: boolean);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
public
|
public
|
||||||
property NewItem: TNewIDEItemTemplate Read FNewItem;
|
property NewItem: TNewIDEItemTemplate Read FNewItem;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ShowNewIDEItemDialog(out NewItem: TNewIDEItemTemplate): TModalResult;
|
function ShowNewIDEItemDialog(out NewItem: TNewIDEItemTemplate;
|
||||||
|
AOnlyModules: boolean = false): TModalResult;
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
uses Math;
|
||||||
|
|
||||||
{$R *.lfm}
|
{$R *.lfm}
|
||||||
|
|
||||||
function ShowNewIDEItemDialog(out NewItem: TNewIDEItemTemplate): TModalResult;
|
function ShowNewIDEItemDialog(out NewItem: TNewIDEItemTemplate;
|
||||||
|
AOnlyModules: boolean): TModalResult;
|
||||||
var
|
var
|
||||||
NewOtherDialog: TNewOtherDialog;
|
NewOtherDialog: TNewOtherDialog;
|
||||||
begin
|
begin
|
||||||
NewItem := nil;
|
NewItem := nil;
|
||||||
NewOtherDialog := TNewOtherDialog.Create(nil);
|
NewOtherDialog := TNewOtherDialog.Create(nil, AOnlyModules);
|
||||||
Result := NewOtherDialog.ShowModal;
|
Result := NewOtherDialog.ShowModal;
|
||||||
if Result = mrOk then
|
if Result = mrOk then
|
||||||
NewItem := NewOtherDialog.NewItem;
|
NewItem := NewOtherDialog.NewItem;
|
||||||
@ -278,36 +281,34 @@ Begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TNewOtherDialog.FillItemsTree;
|
procedure TNewOtherDialog.FillItemsTree(AOnlyModules: boolean);
|
||||||
var
|
var
|
||||||
NewParentNode: TTreeNode;
|
NewParentNode, ChildNode: TTreeNode;
|
||||||
CategoryID: integer;
|
CategoryID, TemplateID, CategoryCount: integer;
|
||||||
Category: TNewIDEItemCategory;
|
Category: TNewIDEItemCategory;
|
||||||
TemplateID: integer;
|
|
||||||
Template: TNewIDEItemTemplate;
|
Template: TNewIDEItemTemplate;
|
||||||
begin
|
begin
|
||||||
ItemsTreeView.BeginUpdate;
|
ItemsTreeView.BeginUpdate;
|
||||||
ItemsTreeView.Items.Clear;
|
ItemsTreeView.Items.Clear;
|
||||||
for CategoryID := 0 to NewIDEItems.Count - 1 do
|
CategoryCount := NewIDEItems.Count;
|
||||||
|
if AOnlyModules and (CategoryCount > 1) then
|
||||||
|
CategoryCount := 1;
|
||||||
|
for CategoryID := 0 to CategoryCount-1 do
|
||||||
begin
|
begin
|
||||||
Category := NewIDEItems[CategoryID];
|
Category := NewIDEItems[CategoryID];
|
||||||
if not Category.VisibleInNewDialog then continue;
|
if not Category.VisibleInNewDialog then continue;
|
||||||
NewParentNode := ItemsTreeView.Items.AddObject(nil,
|
NewParentNode := ItemsTreeView.Items.AddObject(nil,Category.LocalizedName, Category);
|
||||||
Category.LocalizedName, Category);
|
|
||||||
|
|
||||||
NewParentNode.ImageIndex := ImageIndexFolder;
|
NewParentNode.ImageIndex := ImageIndexFolder;
|
||||||
NewParentNode.SelectedIndex := ImageIndexFolder;
|
NewParentNode.SelectedIndex := ImageIndexFolder;
|
||||||
|
|
||||||
for TemplateID := 0 to Category.Count - 1 do
|
for TemplateID := 0 to Category.Count - 1 do
|
||||||
begin
|
begin
|
||||||
Template := Category[TemplateID];
|
Template := Category[TemplateID];
|
||||||
//DebugLn('TNewOtherDialog.FillItemsTree ',Template.Name,' ',dbgs(Template.VisibleInNewDialog));
|
//DebugLn('TNewOtherDialog.FillItemsTree ',Template.Name,' ',dbgs(Template.VisibleInNewDialog));
|
||||||
if Template.VisibleInNewDialog then
|
if Template.VisibleInNewDialog then
|
||||||
with ItemsTreeView.Items.AddChildObject(NewParentNode,
|
begin
|
||||||
Template.LocalizedName, Template)
|
ChildNode := ItemsTreeView.Items.AddChildObject(NewParentNode, Template.LocalizedName, Template);
|
||||||
do begin
|
ChildNode.ImageIndex := ImageIndexTemplate;
|
||||||
ImageIndex := ImageIndexTemplate;
|
ChildNode.SelectedIndex := ImageIndexTemplate;
|
||||||
SelectedIndex := ImageIndexTemplate;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
NewParentNode.Expand(True);
|
NewParentNode.Expand(True);
|
||||||
@ -388,14 +389,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TNewOtherDialog.Create(TheOwner: TComponent);
|
constructor TNewOtherDialog.Create(TheOwner: TComponent; AOnlyModules: boolean);
|
||||||
var
|
var
|
||||||
Node: TTreeNode;
|
Node: TTreeNode;
|
||||||
begin
|
begin
|
||||||
inherited Create(TheOwner);
|
inherited Create(TheOwner);
|
||||||
Caption := lisMenuNewOther;
|
Caption := lisMenuNewOther;
|
||||||
SetupComponents;
|
SetupComponents;
|
||||||
FillItemsTree;
|
FillItemsTree(AOnlyModules);
|
||||||
FillProjectInheritableItemsList;
|
FillProjectInheritableItemsList;
|
||||||
InheritableComponentsListView.Visible := false;
|
InheritableComponentsListView.Visible := false;
|
||||||
IDEDialogLayoutList.ApplyLayout(Self, 570, 400);
|
IDEDialogLayoutList.ApplyLayout(Self, 570, 400);
|
||||||
|
|||||||
@ -3,7 +3,6 @@ object AddToPackageDlg: TAddToPackageDlg
|
|||||||
Height = 357
|
Height = 357
|
||||||
Top = 535
|
Top = 535
|
||||||
Width = 658
|
Width = 658
|
||||||
ActiveControl = PageControl1
|
|
||||||
BorderIcons = [biSystemMenu, biMaximize]
|
BorderIcons = [biSystemMenu, biMaximize]
|
||||||
Caption = 'Add to package'
|
Caption = 'Add to package'
|
||||||
ClientHeight = 357
|
ClientHeight = 357
|
||||||
@ -15,450 +14,22 @@ object AddToPackageDlg: TAddToPackageDlg
|
|||||||
OnKeyDown = AddToPackageDlgKeyDown
|
OnKeyDown = AddToPackageDlgKeyDown
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
LCLVersion = '1.5'
|
LCLVersion = '1.5'
|
||||||
object PageControl1: TPageControl
|
object AddToPackageBtnPanel: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 319
|
Height = 41
|
||||||
Top = 0
|
Top = 316
|
||||||
Width = 658
|
|
||||||
ActivePage = NewFilePage
|
|
||||||
Align = alClient
|
|
||||||
TabIndex = 0
|
|
||||||
TabOrder = 0
|
|
||||||
OnChange = PageControl1Change
|
|
||||||
object NewFilePage: TTabSheet
|
|
||||||
Caption = 'New File'
|
|
||||||
ClientHeight = 291
|
|
||||||
ClientWidth = 650
|
|
||||||
OnResize = NewFilePageResize
|
|
||||||
object NewFileTreeView: TTreeView
|
|
||||||
Left = 6
|
|
||||||
Height = 279
|
|
||||||
Top = 6
|
|
||||||
Width = 249
|
|
||||||
Align = alLeft
|
|
||||||
BorderSpacing.Around = 6
|
|
||||||
DefaultItemHeight = 18
|
|
||||||
ReadOnly = True
|
|
||||||
RightClickSelect = True
|
|
||||||
TabOrder = 0
|
|
||||||
OnClick = NewFileTreeViewClick
|
|
||||||
OnDblClick = NewFileTreeViewDblClick
|
|
||||||
OnSelectionChanged = NewFileTreeViewSelectionChanged
|
|
||||||
Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoRightClickSelect, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips]
|
|
||||||
end
|
|
||||||
object NewFileDescriptionGroupBox: TGroupBox
|
|
||||||
AnchorSideLeft.Control = NewFileTreeView
|
|
||||||
Left = 261
|
|
||||||
Height = 279
|
|
||||||
Top = 6
|
|
||||||
Width = 383
|
|
||||||
Align = alClient
|
|
||||||
BorderSpacing.Around = 6
|
|
||||||
Caption = 'NewFileDescriptionGroupBox'
|
|
||||||
ClientHeight = 259
|
|
||||||
ClientWidth = 379
|
|
||||||
TabOrder = 1
|
|
||||||
object NewFileHelpLabel: TLabel
|
|
||||||
Left = 4
|
|
||||||
Height = 251
|
|
||||||
Top = 4
|
|
||||||
Width = 371
|
|
||||||
Align = alClient
|
|
||||||
Anchors = []
|
|
||||||
BorderSpacing.Around = 4
|
|
||||||
Caption = 'NewFileHelpLabel'
|
|
||||||
ParentColor = False
|
|
||||||
WordWrap = True
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
object NewComponentPage: TTabSheet
|
|
||||||
Caption = 'New Component'
|
|
||||||
ClientHeight = 291
|
|
||||||
ClientWidth = 650
|
|
||||||
OnResize = NewComponentPageResize
|
|
||||||
object AncestorTypeLabel: TLabel
|
|
||||||
AnchorSideTop.Control = AncestorComboBox
|
|
||||||
AnchorSideTop.Side = asrCenter
|
|
||||||
Left = 5
|
|
||||||
Height = 15
|
|
||||||
Top = 10
|
|
||||||
Width = 101
|
|
||||||
Caption = 'AncestorTypeLabel'
|
|
||||||
ParentColor = False
|
|
||||||
end
|
|
||||||
object ClassNameLabel: TLabel
|
|
||||||
AnchorSideTop.Control = ClassNameEdit
|
|
||||||
AnchorSideTop.Side = asrCenter
|
|
||||||
Left = 5
|
|
||||||
Height = 15
|
|
||||||
Top = 39
|
|
||||||
Width = 87
|
|
||||||
Caption = 'ClassNameLabel'
|
|
||||||
ParentColor = False
|
|
||||||
end
|
|
||||||
object PalettePageLabel: TLabel
|
|
||||||
AnchorSideTop.Control = PalettePageCombobox
|
|
||||||
AnchorSideTop.Side = asrCenter
|
|
||||||
Left = 5
|
|
||||||
Height = 15
|
|
||||||
Top = 68
|
|
||||||
Width = 90
|
|
||||||
Caption = 'PalettePageLabel'
|
|
||||||
ParentColor = False
|
|
||||||
end
|
|
||||||
object ComponentUnitFileLabel: TLabel
|
|
||||||
AnchorSideTop.Control = ComponentUnitFileEdit
|
|
||||||
AnchorSideTop.Side = asrCenter
|
|
||||||
Left = 5
|
|
||||||
Height = 15
|
|
||||||
Top = 97
|
|
||||||
Width = 132
|
|
||||||
Caption = 'ComponentUnitFileLabel'
|
|
||||||
ParentColor = False
|
|
||||||
end
|
|
||||||
object ComponentUnitNameLabel: TLabel
|
|
||||||
AnchorSideTop.Control = ComponentUnitNameEdit
|
|
||||||
AnchorSideTop.Side = asrCenter
|
|
||||||
Left = 5
|
|
||||||
Height = 15
|
|
||||||
Top = 126
|
|
||||||
Width = 146
|
|
||||||
Caption = 'ComponentUnitNameLabel'
|
|
||||||
ParentColor = False
|
|
||||||
end
|
|
||||||
object AncestorComboBox: TComboBox
|
|
||||||
AnchorSideLeft.Side = asrBottom
|
|
||||||
AnchorSideTop.Control = NewComponentPage
|
|
||||||
Left = 184
|
|
||||||
Height = 23
|
|
||||||
Top = 6
|
|
||||||
Width = 200
|
|
||||||
BorderSpacing.Top = 6
|
|
||||||
ItemHeight = 15
|
|
||||||
OnChange = AncestorComboBoxChange
|
|
||||||
OnCloseUp = AncestorComboBoxCloseUp
|
|
||||||
TabOrder = 0
|
|
||||||
Text = 'AncestorComboBox'
|
|
||||||
end
|
|
||||||
object AncestorShowAllCheckBox: TCheckBox
|
|
||||||
AnchorSideLeft.Control = AncestorComboBox
|
|
||||||
AnchorSideLeft.Side = asrBottom
|
|
||||||
AnchorSideTop.Control = AncestorComboBox
|
|
||||||
AnchorSideTop.Side = asrCenter
|
|
||||||
Left = 390
|
|
||||||
Height = 19
|
|
||||||
Top = 8
|
|
||||||
Width = 162
|
|
||||||
BorderSpacing.Left = 6
|
|
||||||
Caption = 'AncestorShowAllCheckBox'
|
|
||||||
Checked = True
|
|
||||||
OnClick = AncestorShowAllCheckBoxClick
|
|
||||||
State = cbChecked
|
|
||||||
TabOrder = 1
|
|
||||||
end
|
|
||||||
object ClassNameEdit: TEdit
|
|
||||||
AnchorSideLeft.Control = AncestorComboBox
|
|
||||||
AnchorSideTop.Control = AncestorComboBox
|
|
||||||
AnchorSideTop.Side = asrBottom
|
|
||||||
AnchorSideRight.Control = AncestorComboBox
|
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
Left = 184
|
|
||||||
Height = 23
|
|
||||||
Top = 35
|
|
||||||
Width = 200
|
|
||||||
Anchors = [akTop, akLeft, akRight]
|
|
||||||
BorderSpacing.Top = 6
|
|
||||||
OnChange = ClassNameEditChange
|
|
||||||
TabOrder = 2
|
|
||||||
Text = 'ClassNameEdit'
|
|
||||||
end
|
|
||||||
object PalettePageCombobox: TComboBox
|
|
||||||
AnchorSideLeft.Control = AncestorComboBox
|
|
||||||
AnchorSideTop.Control = ClassNameEdit
|
|
||||||
AnchorSideTop.Side = asrBottom
|
|
||||||
AnchorSideRight.Control = AncestorComboBox
|
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
Left = 184
|
|
||||||
Height = 23
|
|
||||||
Top = 64
|
|
||||||
Width = 200
|
|
||||||
BorderSpacing.Top = 6
|
|
||||||
ItemHeight = 15
|
|
||||||
TabOrder = 3
|
|
||||||
Text = 'PalettePageCombobox'
|
|
||||||
end
|
|
||||||
object ComponentUnitFileEdit: TEdit
|
|
||||||
AnchorSideLeft.Control = AncestorComboBox
|
|
||||||
AnchorSideTop.Control = PalettePageCombobox
|
|
||||||
AnchorSideTop.Side = asrBottom
|
|
||||||
AnchorSideRight.Control = ComponentUnitFileBrowseButton
|
|
||||||
Left = 184
|
|
||||||
Height = 23
|
|
||||||
Top = 93
|
|
||||||
Width = 383
|
|
||||||
Anchors = [akTop, akLeft, akRight]
|
|
||||||
BorderSpacing.Top = 6
|
|
||||||
TabOrder = 4
|
|
||||||
Text = 'ComponentUnitFileEdit'
|
|
||||||
end
|
|
||||||
object ComponentUnitFileBrowseButton: TButton
|
|
||||||
AnchorSideLeft.Side = asrBottom
|
|
||||||
AnchorSideTop.Control = ComponentUnitFileEdit
|
|
||||||
AnchorSideTop.Side = asrCenter
|
|
||||||
AnchorSideRight.Control = ComponentUnitFileShortenButton
|
|
||||||
Left = 567
|
|
||||||
Height = 25
|
|
||||||
Hint = 'Save file dialog'
|
|
||||||
Top = 92
|
|
||||||
Width = 35
|
|
||||||
Anchors = [akTop, akRight]
|
|
||||||
AutoSize = True
|
|
||||||
Caption = '...'
|
|
||||||
OnClick = ComponentUnitFileBrowseButtonClick
|
|
||||||
ParentShowHint = False
|
|
||||||
ShowHint = True
|
|
||||||
TabOrder = 5
|
|
||||||
end
|
|
||||||
object ComponentUnitFileShortenButton: TButton
|
|
||||||
AnchorSideLeft.Side = asrBottom
|
|
||||||
AnchorSideTop.Control = ComponentUnitFileEdit
|
|
||||||
AnchorSideTop.Side = asrCenter
|
|
||||||
AnchorSideRight.Control = NewComponentPage
|
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
Left = 602
|
|
||||||
Height = 25
|
|
||||||
Hint = 'Shorten or expand filename'
|
|
||||||
Top = 92
|
|
||||||
Width = 42
|
|
||||||
Anchors = [akTop, akRight]
|
|
||||||
AutoSize = True
|
|
||||||
BorderSpacing.Right = 6
|
|
||||||
Caption = '<>'
|
|
||||||
OnClick = ComponentUnitFileShortenButtonClick
|
|
||||||
ParentShowHint = False
|
|
||||||
ShowHint = True
|
|
||||||
TabOrder = 6
|
|
||||||
end
|
|
||||||
object ComponentUnitNameEdit: TEdit
|
|
||||||
AnchorSideLeft.Control = AncestorComboBox
|
|
||||||
AnchorSideTop.Control = ComponentUnitFileEdit
|
|
||||||
AnchorSideTop.Side = asrBottom
|
|
||||||
AnchorSideRight.Control = AncestorComboBox
|
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
Left = 184
|
|
||||||
Height = 23
|
|
||||||
Top = 122
|
|
||||||
Width = 200
|
|
||||||
Anchors = [akTop, akLeft, akRight]
|
|
||||||
BorderSpacing.Top = 6
|
|
||||||
OnChange = ComponentUnitNameEditChange
|
|
||||||
TabOrder = 7
|
|
||||||
Text = 'ComponentUnitNameEdit'
|
|
||||||
end
|
|
||||||
object ComponentIconLabel: TLabel
|
|
||||||
AnchorSideLeft.Control = ComponentUnitNameLabel
|
|
||||||
AnchorSideTop.Control = ComponentIconSpeedButton
|
|
||||||
AnchorSideTop.Side = asrCenter
|
|
||||||
Left = 5
|
|
||||||
Height = 15
|
|
||||||
Top = 157
|
|
||||||
Width = 115
|
|
||||||
Caption = 'ComponentIconLabel'
|
|
||||||
ParentColor = False
|
|
||||||
end
|
|
||||||
object ComponentIconSpeedButton: TSpeedButton
|
|
||||||
AnchorSideLeft.Control = ComponentUnitNameEdit
|
|
||||||
AnchorSideTop.Control = ComponentUnitNameEdit
|
|
||||||
AnchorSideTop.Side = asrBottom
|
|
||||||
Left = 184
|
|
||||||
Height = 26
|
|
||||||
Top = 151
|
|
||||||
Width = 28
|
|
||||||
BorderSpacing.Top = 6
|
|
||||||
OnClick = ComponentIconSpeedButtonClick
|
|
||||||
ShowHint = True
|
|
||||||
ParentShowHint = False
|
|
||||||
end
|
|
||||||
end
|
|
||||||
object NewRequirementPage: TTabSheet
|
|
||||||
Caption = 'New Requirement'
|
|
||||||
ClientHeight = 291
|
|
||||||
ClientWidth = 650
|
|
||||||
object NewDepPanel: TPanel
|
|
||||||
Left = 0
|
|
||||||
Height = 291
|
|
||||||
Top = 0
|
|
||||||
Width = 650
|
|
||||||
Align = alClient
|
|
||||||
BevelOuter = bvNone
|
|
||||||
ChildSizing.LeftRightSpacing = 6
|
|
||||||
ChildSizing.TopBottomSpacing = 6
|
|
||||||
ChildSizing.HorizontalSpacing = 6
|
|
||||||
ChildSizing.VerticalSpacing = 6
|
|
||||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
|
||||||
ChildSizing.ControlsPerLine = 2
|
|
||||||
ClientHeight = 291
|
|
||||||
ClientWidth = 650
|
|
||||||
TabOrder = 0
|
|
||||||
object DependPkgNameLabel: TLabel
|
|
||||||
Left = 6
|
|
||||||
Height = 15
|
|
||||||
Top = 10
|
|
||||||
Width = 121
|
|
||||||
BorderSpacing.CellAlignHorizontal = ccaLeftTop
|
|
||||||
BorderSpacing.CellAlignVertical = ccaCenter
|
|
||||||
Caption = 'DependPkgNameLabel'
|
|
||||||
ParentColor = False
|
|
||||||
end
|
|
||||||
object DependPkgNameComboBox: TComboBox
|
|
||||||
AnchorSideLeft.Side = asrBottom
|
|
||||||
Left = 142
|
|
||||||
Height = 23
|
|
||||||
Top = 6
|
|
||||||
Width = 200
|
|
||||||
AutoComplete = True
|
|
||||||
AutoCompleteText = [cbactEnabled, cbactEndOfLineComplete, cbactSearchAscending]
|
|
||||||
Constraints.MinWidth = 200
|
|
||||||
ItemHeight = 15
|
|
||||||
OnChange = DependPkgNameComboBoxChange
|
|
||||||
TabOrder = 0
|
|
||||||
Text = 'DependPkgNameComboBox'
|
|
||||||
end
|
|
||||||
object DependMinVersionLabel: TLabel
|
|
||||||
Left = 6
|
|
||||||
Height = 15
|
|
||||||
Top = 39
|
|
||||||
Width = 129
|
|
||||||
BorderSpacing.CellAlignHorizontal = ccaLeftTop
|
|
||||||
BorderSpacing.CellAlignVertical = ccaCenter
|
|
||||||
Caption = 'DependMinVersionLabel'
|
|
||||||
ParentColor = False
|
|
||||||
end
|
|
||||||
object DependMinVersionEdit: TEdit
|
|
||||||
AnchorSideLeft.Side = asrBottom
|
|
||||||
Left = 142
|
|
||||||
Height = 23
|
|
||||||
Top = 35
|
|
||||||
Width = 200
|
|
||||||
BorderSpacing.Top = 6
|
|
||||||
TabOrder = 1
|
|
||||||
Text = 'DependMinVersionEdit'
|
|
||||||
end
|
|
||||||
object DependMaxVersionLabel: TLabel
|
|
||||||
Left = 6
|
|
||||||
Height = 15
|
|
||||||
Top = 68
|
|
||||||
Width = 130
|
|
||||||
BorderSpacing.CellAlignHorizontal = ccaLeftTop
|
|
||||||
BorderSpacing.CellAlignVertical = ccaCenter
|
|
||||||
Caption = 'DependMaxVersionLabel'
|
|
||||||
ParentColor = False
|
|
||||||
end
|
|
||||||
object DependMaxVersionEdit: TEdit
|
|
||||||
AnchorSideLeft.Side = asrBottom
|
|
||||||
Left = 142
|
|
||||||
Height = 23
|
|
||||||
Top = 64
|
|
||||||
Width = 200
|
|
||||||
BorderSpacing.Top = 6
|
|
||||||
TabOrder = 2
|
|
||||||
Text = 'DependMaxVersionEdit'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
object AddFilesPage: TTabSheet
|
|
||||||
Caption = 'Add Files'
|
|
||||||
ClientHeight = 291
|
|
||||||
ClientWidth = 650
|
|
||||||
object FilesListView: TListView
|
|
||||||
Left = 6
|
|
||||||
Height = 242
|
|
||||||
Top = 6
|
|
||||||
Width = 638
|
|
||||||
Align = alClient
|
|
||||||
BorderSpacing.Around = 6
|
|
||||||
Columns = <
|
|
||||||
item
|
|
||||||
Caption = 'Filename'
|
|
||||||
Width = 200
|
|
||||||
end
|
|
||||||
item
|
|
||||||
Caption = 'Type'
|
|
||||||
Width = 436
|
|
||||||
end>
|
|
||||||
MultiSelect = True
|
|
||||||
SortType = stText
|
|
||||||
TabOrder = 0
|
|
||||||
ViewStyle = vsReport
|
|
||||||
OnSelectItem = FilesListViewSelectItem
|
|
||||||
end
|
|
||||||
object AddFilesBtnPanel: TPanel
|
|
||||||
Left = 0
|
|
||||||
Height = 37
|
|
||||||
Top = 254
|
|
||||||
Width = 650
|
|
||||||
Align = alBottom
|
|
||||||
AutoSize = True
|
|
||||||
BevelOuter = bvNone
|
|
||||||
ClientHeight = 37
|
|
||||||
ClientWidth = 650
|
|
||||||
TabOrder = 1
|
|
||||||
object FilesShortenButton: TBitBtn
|
|
||||||
Left = 112
|
|
||||||
Height = 25
|
|
||||||
Top = 6
|
|
||||||
Width = 126
|
|
||||||
Align = alLeft
|
|
||||||
AutoSize = True
|
|
||||||
BorderSpacing.Around = 6
|
|
||||||
Caption = 'FilesShortenButton'
|
|
||||||
OnClick = FilesShortenButtonClick
|
|
||||||
TabOrder = 0
|
|
||||||
end
|
|
||||||
object FilesDeleteButton: TBitBtn
|
|
||||||
Left = 244
|
|
||||||
Height = 25
|
|
||||||
Top = 6
|
|
||||||
Width = 118
|
|
||||||
Align = alLeft
|
|
||||||
AutoSize = True
|
|
||||||
BorderSpacing.Around = 6
|
|
||||||
Caption = 'FilesDeleteButton'
|
|
||||||
OnClick = FilesDeleteButtonClick
|
|
||||||
TabOrder = 1
|
|
||||||
end
|
|
||||||
object FilesDirButton: TBitBtn
|
|
||||||
Left = 6
|
|
||||||
Height = 25
|
|
||||||
Top = 6
|
|
||||||
Width = 100
|
|
||||||
Align = alLeft
|
|
||||||
AutoSize = True
|
|
||||||
BorderSpacing.Around = 6
|
|
||||||
Caption = 'FilesDirButton'
|
|
||||||
OnClick = FilesDirButtonClick
|
|
||||||
TabOrder = 2
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
object NewFileBtnPanel: TPanel
|
|
||||||
Left = 0
|
|
||||||
Height = 38
|
|
||||||
Top = 319
|
|
||||||
Width = 658
|
Width = 658
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
ClientHeight = 38
|
ClientHeight = 41
|
||||||
ClientWidth = 658
|
ClientWidth = 658
|
||||||
TabOrder = 1
|
TabOrder = 0
|
||||||
object OkButton: TBitBtn
|
object OkButton: TBitBtn
|
||||||
Left = 431
|
Left = 437
|
||||||
Height = 26
|
Height = 29
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 97
|
Width = 94
|
||||||
Align = alRight
|
Align = alRight
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
@ -505,10 +76,10 @@ object AddToPackageDlg: TAddToPackageDlg
|
|||||||
end
|
end
|
||||||
object CancelButton: TBitBtn
|
object CancelButton: TBitBtn
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
Left = 534
|
Left = 537
|
||||||
Height = 26
|
Height = 29
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 118
|
Width = 115
|
||||||
Align = alRight
|
Align = alRight
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
@ -554,4 +125,385 @@ object AddToPackageDlg: TAddToPackageDlg
|
|||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
object PageControl1: TPageControl
|
||||||
|
Left = 0
|
||||||
|
Height = 316
|
||||||
|
Top = 0
|
||||||
|
Width = 658
|
||||||
|
ActivePage = NewComponentPage
|
||||||
|
Align = alClient
|
||||||
|
TabIndex = 0
|
||||||
|
TabOrder = 1
|
||||||
|
OnChange = PageControl1Change
|
||||||
|
object NewComponentPage: TTabSheet
|
||||||
|
Caption = 'New Component'
|
||||||
|
ClientHeight = 289
|
||||||
|
ClientWidth = 654
|
||||||
|
OnResize = NewComponentPageResize
|
||||||
|
object AncestorTypeLabel: TLabel
|
||||||
|
AnchorSideTop.Control = AncestorComboBox
|
||||||
|
AnchorSideTop.Side = asrCenter
|
||||||
|
Left = 5
|
||||||
|
Height = 17
|
||||||
|
Top = 9
|
||||||
|
Width = 108
|
||||||
|
Caption = 'AncestorTypeLabel'
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object ClassNameLabel: TLabel
|
||||||
|
AnchorSideTop.Control = ClassNameEdit
|
||||||
|
AnchorSideTop.Side = asrCenter
|
||||||
|
Left = 5
|
||||||
|
Height = 17
|
||||||
|
Top = 38
|
||||||
|
Width = 94
|
||||||
|
Caption = 'ClassNameLabel'
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object PalettePageLabel: TLabel
|
||||||
|
AnchorSideTop.Control = PalettePageCombobox
|
||||||
|
AnchorSideTop.Side = asrCenter
|
||||||
|
Left = 5
|
||||||
|
Height = 17
|
||||||
|
Top = 67
|
||||||
|
Width = 99
|
||||||
|
Caption = 'PalettePageLabel'
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object ComponentUnitFileLabel: TLabel
|
||||||
|
AnchorSideTop.Control = ComponentUnitFileEdit
|
||||||
|
AnchorSideTop.Side = asrCenter
|
||||||
|
Left = 5
|
||||||
|
Height = 17
|
||||||
|
Top = 96
|
||||||
|
Width = 141
|
||||||
|
Caption = 'ComponentUnitFileLabel'
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object ComponentUnitNameLabel: TLabel
|
||||||
|
AnchorSideTop.Control = ComponentUnitNameEdit
|
||||||
|
AnchorSideTop.Side = asrCenter
|
||||||
|
Left = 5
|
||||||
|
Height = 17
|
||||||
|
Top = 125
|
||||||
|
Width = 156
|
||||||
|
Caption = 'ComponentUnitNameLabel'
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object AncestorComboBox: TComboBox
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
|
AnchorSideTop.Control = NewComponentPage
|
||||||
|
Left = 184
|
||||||
|
Height = 23
|
||||||
|
Top = 6
|
||||||
|
Width = 200
|
||||||
|
BorderSpacing.Top = 6
|
||||||
|
ItemHeight = 17
|
||||||
|
OnChange = AncestorComboBoxChange
|
||||||
|
OnCloseUp = AncestorComboBoxCloseUp
|
||||||
|
TabOrder = 0
|
||||||
|
Text = 'AncestorComboBox'
|
||||||
|
end
|
||||||
|
object AncestorShowAllCheckBox: TCheckBox
|
||||||
|
AnchorSideLeft.Control = AncestorComboBox
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
|
AnchorSideTop.Control = AncestorComboBox
|
||||||
|
AnchorSideTop.Side = asrCenter
|
||||||
|
Left = 390
|
||||||
|
Height = 22
|
||||||
|
Top = 6
|
||||||
|
Width = 176
|
||||||
|
BorderSpacing.Left = 6
|
||||||
|
Caption = 'AncestorShowAllCheckBox'
|
||||||
|
Checked = True
|
||||||
|
OnClick = AncestorShowAllCheckBoxClick
|
||||||
|
State = cbChecked
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object ClassNameEdit: TEdit
|
||||||
|
AnchorSideLeft.Control = AncestorComboBox
|
||||||
|
AnchorSideTop.Control = AncestorComboBox
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
AnchorSideRight.Control = AncestorComboBox
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
|
Left = 184
|
||||||
|
Height = 23
|
||||||
|
Top = 35
|
||||||
|
Width = 200
|
||||||
|
Anchors = [akTop, akLeft, akRight]
|
||||||
|
BorderSpacing.Top = 6
|
||||||
|
OnChange = ClassNameEditChange
|
||||||
|
TabOrder = 2
|
||||||
|
Text = 'ClassNameEdit'
|
||||||
|
end
|
||||||
|
object PalettePageCombobox: TComboBox
|
||||||
|
AnchorSideLeft.Control = AncestorComboBox
|
||||||
|
AnchorSideTop.Control = ClassNameEdit
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
AnchorSideRight.Control = AncestorComboBox
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
|
Left = 184
|
||||||
|
Height = 23
|
||||||
|
Top = 64
|
||||||
|
Width = 200
|
||||||
|
BorderSpacing.Top = 6
|
||||||
|
ItemHeight = 17
|
||||||
|
TabOrder = 3
|
||||||
|
Text = 'PalettePageCombobox'
|
||||||
|
end
|
||||||
|
object ComponentUnitFileEdit: TEdit
|
||||||
|
AnchorSideLeft.Control = AncestorComboBox
|
||||||
|
AnchorSideTop.Control = PalettePageCombobox
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
AnchorSideRight.Control = ComponentUnitFileBrowseButton
|
||||||
|
Left = 184
|
||||||
|
Height = 23
|
||||||
|
Top = 93
|
||||||
|
Width = 416
|
||||||
|
Anchors = [akTop, akLeft, akRight]
|
||||||
|
BorderSpacing.Top = 6
|
||||||
|
TabOrder = 4
|
||||||
|
Text = 'ComponentUnitFileEdit'
|
||||||
|
end
|
||||||
|
object ComponentUnitFileBrowseButton: TButton
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
|
AnchorSideTop.Control = ComponentUnitFileEdit
|
||||||
|
AnchorSideTop.Side = asrCenter
|
||||||
|
AnchorSideRight.Control = ComponentUnitFileShortenButton
|
||||||
|
Left = 600
|
||||||
|
Height = 29
|
||||||
|
Hint = 'Save file dialog'
|
||||||
|
Top = 90
|
||||||
|
Width = 22
|
||||||
|
Anchors = [akTop, akRight]
|
||||||
|
AutoSize = True
|
||||||
|
Caption = '...'
|
||||||
|
OnClick = ComponentUnitFileBrowseButtonClick
|
||||||
|
ParentShowHint = False
|
||||||
|
ShowHint = True
|
||||||
|
TabOrder = 5
|
||||||
|
end
|
||||||
|
object ComponentUnitFileShortenButton: TButton
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
|
AnchorSideTop.Control = ComponentUnitFileEdit
|
||||||
|
AnchorSideTop.Side = asrCenter
|
||||||
|
AnchorSideRight.Control = NewComponentPage
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
|
Left = 622
|
||||||
|
Height = 29
|
||||||
|
Hint = 'Shorten or expand filename'
|
||||||
|
Top = 90
|
||||||
|
Width = 26
|
||||||
|
Anchors = [akTop, akRight]
|
||||||
|
AutoSize = True
|
||||||
|
BorderSpacing.Right = 6
|
||||||
|
Caption = '<>'
|
||||||
|
OnClick = ComponentUnitFileShortenButtonClick
|
||||||
|
ParentShowHint = False
|
||||||
|
ShowHint = True
|
||||||
|
TabOrder = 6
|
||||||
|
end
|
||||||
|
object ComponentUnitNameEdit: TEdit
|
||||||
|
AnchorSideLeft.Control = AncestorComboBox
|
||||||
|
AnchorSideTop.Control = ComponentUnitFileEdit
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
AnchorSideRight.Control = AncestorComboBox
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
|
Left = 184
|
||||||
|
Height = 23
|
||||||
|
Top = 122
|
||||||
|
Width = 200
|
||||||
|
Anchors = [akTop, akLeft, akRight]
|
||||||
|
BorderSpacing.Top = 6
|
||||||
|
OnChange = ComponentUnitNameEditChange
|
||||||
|
TabOrder = 7
|
||||||
|
Text = 'ComponentUnitNameEdit'
|
||||||
|
end
|
||||||
|
object ComponentIconLabel: TLabel
|
||||||
|
AnchorSideLeft.Control = ComponentUnitNameLabel
|
||||||
|
AnchorSideTop.Control = ComponentIconSpeedButton
|
||||||
|
AnchorSideTop.Side = asrCenter
|
||||||
|
Left = 5
|
||||||
|
Height = 17
|
||||||
|
Top = 156
|
||||||
|
Width = 123
|
||||||
|
Caption = 'ComponentIconLabel'
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object ComponentIconSpeedButton: TSpeedButton
|
||||||
|
AnchorSideLeft.Control = ComponentUnitNameEdit
|
||||||
|
AnchorSideTop.Control = ComponentUnitNameEdit
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
Left = 184
|
||||||
|
Height = 26
|
||||||
|
Top = 151
|
||||||
|
Width = 28
|
||||||
|
BorderSpacing.Top = 6
|
||||||
|
OnClick = ComponentIconSpeedButtonClick
|
||||||
|
ShowHint = True
|
||||||
|
ParentShowHint = False
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object NewRequirementPage: TTabSheet
|
||||||
|
Caption = 'New Requirement'
|
||||||
|
ClientHeight = 289
|
||||||
|
ClientWidth = 654
|
||||||
|
object NewDepPanel: TPanel
|
||||||
|
Left = 0
|
||||||
|
Height = 289
|
||||||
|
Top = 0
|
||||||
|
Width = 654
|
||||||
|
Align = alClient
|
||||||
|
BevelOuter = bvNone
|
||||||
|
ChildSizing.LeftRightSpacing = 6
|
||||||
|
ChildSizing.TopBottomSpacing = 6
|
||||||
|
ChildSizing.HorizontalSpacing = 6
|
||||||
|
ChildSizing.VerticalSpacing = 6
|
||||||
|
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||||
|
ChildSizing.ControlsPerLine = 2
|
||||||
|
ClientHeight = 289
|
||||||
|
ClientWidth = 654
|
||||||
|
TabOrder = 0
|
||||||
|
object DependPkgNameLabel: TLabel
|
||||||
|
Left = 6
|
||||||
|
Height = 17
|
||||||
|
Top = 9
|
||||||
|
Width = 131
|
||||||
|
BorderSpacing.CellAlignHorizontal = ccaLeftTop
|
||||||
|
BorderSpacing.CellAlignVertical = ccaCenter
|
||||||
|
Caption = 'DependPkgNameLabel'
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object DependPkgNameComboBox: TComboBox
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
|
Left = 154
|
||||||
|
Height = 23
|
||||||
|
Top = 6
|
||||||
|
Width = 200
|
||||||
|
AutoComplete = True
|
||||||
|
AutoCompleteText = [cbactEnabled, cbactEndOfLineComplete, cbactSearchAscending]
|
||||||
|
Constraints.MinWidth = 200
|
||||||
|
ItemHeight = 17
|
||||||
|
OnChange = DependPkgNameComboBoxChange
|
||||||
|
TabOrder = 0
|
||||||
|
Text = 'DependPkgNameComboBox'
|
||||||
|
end
|
||||||
|
object DependMinVersionLabel: TLabel
|
||||||
|
Left = 6
|
||||||
|
Height = 17
|
||||||
|
Top = 38
|
||||||
|
Width = 140
|
||||||
|
BorderSpacing.CellAlignHorizontal = ccaLeftTop
|
||||||
|
BorderSpacing.CellAlignVertical = ccaCenter
|
||||||
|
Caption = 'DependMinVersionLabel'
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object DependMinVersionEdit: TEdit
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
|
Left = 154
|
||||||
|
Height = 23
|
||||||
|
Top = 35
|
||||||
|
Width = 200
|
||||||
|
BorderSpacing.Top = 6
|
||||||
|
TabOrder = 1
|
||||||
|
Text = 'DependMinVersionEdit'
|
||||||
|
end
|
||||||
|
object DependMaxVersionLabel: TLabel
|
||||||
|
Left = 6
|
||||||
|
Height = 17
|
||||||
|
Top = 67
|
||||||
|
Width = 142
|
||||||
|
BorderSpacing.CellAlignHorizontal = ccaLeftTop
|
||||||
|
BorderSpacing.CellAlignVertical = ccaCenter
|
||||||
|
Caption = 'DependMaxVersionLabel'
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object DependMaxVersionEdit: TEdit
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
|
Left = 154
|
||||||
|
Height = 23
|
||||||
|
Top = 64
|
||||||
|
Width = 200
|
||||||
|
BorderSpacing.Top = 6
|
||||||
|
TabOrder = 2
|
||||||
|
Text = 'DependMaxVersionEdit'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object AddFilesPage: TTabSheet
|
||||||
|
Caption = 'Add Files'
|
||||||
|
ClientHeight = 289
|
||||||
|
ClientWidth = 654
|
||||||
|
object FilesListView: TListView
|
||||||
|
Left = 6
|
||||||
|
Height = 236
|
||||||
|
Top = 6
|
||||||
|
Width = 642
|
||||||
|
Align = alClient
|
||||||
|
BorderSpacing.Around = 6
|
||||||
|
Columns = <
|
||||||
|
item
|
||||||
|
Caption = 'Filename'
|
||||||
|
Width = 200
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Caption = 'Type'
|
||||||
|
Width = 436
|
||||||
|
end>
|
||||||
|
MultiSelect = True
|
||||||
|
SortType = stText
|
||||||
|
TabOrder = 0
|
||||||
|
ViewStyle = vsReport
|
||||||
|
OnSelectItem = FilesListViewSelectItem
|
||||||
|
end
|
||||||
|
object AddFilesBtnPanel: TPanel
|
||||||
|
Left = 0
|
||||||
|
Height = 41
|
||||||
|
Top = 248
|
||||||
|
Width = 654
|
||||||
|
Align = alBottom
|
||||||
|
AutoSize = True
|
||||||
|
BevelOuter = bvNone
|
||||||
|
ClientHeight = 41
|
||||||
|
ClientWidth = 654
|
||||||
|
TabOrder = 1
|
||||||
|
object FilesShortenButton: TBitBtn
|
||||||
|
Left = 106
|
||||||
|
Height = 29
|
||||||
|
Top = 6
|
||||||
|
Width = 122
|
||||||
|
Align = alLeft
|
||||||
|
AutoSize = True
|
||||||
|
BorderSpacing.Around = 6
|
||||||
|
Caption = 'FilesShortenButton'
|
||||||
|
OnClick = FilesShortenButtonClick
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object FilesDeleteButton: TBitBtn
|
||||||
|
Left = 234
|
||||||
|
Height = 29
|
||||||
|
Top = 6
|
||||||
|
Width = 113
|
||||||
|
Align = alLeft
|
||||||
|
AutoSize = True
|
||||||
|
BorderSpacing.Around = 6
|
||||||
|
Caption = 'FilesDeleteButton'
|
||||||
|
OnClick = FilesDeleteButtonClick
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object FilesDirButton: TBitBtn
|
||||||
|
Left = 6
|
||||||
|
Height = 29
|
||||||
|
Top = 6
|
||||||
|
Width = 94
|
||||||
|
Align = alLeft
|
||||||
|
AutoSize = True
|
||||||
|
BorderSpacing.Around = 6
|
||||||
|
Caption = 'FilesDirButton'
|
||||||
|
OnClick = FilesDirButtonClick
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -45,8 +45,7 @@ type
|
|||||||
d2ptNewComponent,
|
d2ptNewComponent,
|
||||||
d2ptRequiredPkg,
|
d2ptRequiredPkg,
|
||||||
d2ptFile,
|
d2ptFile,
|
||||||
d2ptFiles,
|
d2ptFiles
|
||||||
d2ptNewFile
|
|
||||||
);
|
);
|
||||||
|
|
||||||
{ TAddToPkgResult }
|
{ TAddToPkgResult }
|
||||||
@ -79,46 +78,40 @@ type
|
|||||||
{ TAddToPackageDlg }
|
{ TAddToPackageDlg }
|
||||||
|
|
||||||
TAddToPackageDlg = class(TForm)
|
TAddToPackageDlg = class(TForm)
|
||||||
FilesDirButton: TBitBtn;
|
AddFilesBtnPanel: TPanel;
|
||||||
// PageControl1
|
|
||||||
PageControl1: TPageControl;
|
|
||||||
NewFilePage: TTabSheet;
|
|
||||||
NewComponentPage: TTabSheet;
|
|
||||||
NewRequirementPage: TTabSheet;
|
|
||||||
AddFilesPage: TTabSheet;
|
AddFilesPage: TTabSheet;
|
||||||
// new file page
|
|
||||||
NewFileTreeView: TTreeView;
|
|
||||||
NewFileDescriptionGroupBox: TGroupBox;
|
|
||||||
NewFileHelpLabel: TLabel;
|
|
||||||
CancelButton: TBitBtn;
|
|
||||||
OkButton: TBitBtn;
|
|
||||||
AncestorTypeLabel: TLabel;
|
|
||||||
AncestorComboBox: TComboBox;
|
AncestorComboBox: TComboBox;
|
||||||
AncestorShowAllCheckBox: TCheckBox;
|
AncestorShowAllCheckBox: TCheckBox;
|
||||||
ClassNameLabel: TLabel;
|
AncestorTypeLabel: TLabel;
|
||||||
|
CancelButton: TBitBtn;
|
||||||
ClassNameEdit: TEdit;
|
ClassNameEdit: TEdit;
|
||||||
PalettePageLabel: TLabel;
|
ClassNameLabel: TLabel;
|
||||||
PalettePageCombobox: TCombobox;
|
|
||||||
ComponentIconLabel: TLabel;
|
ComponentIconLabel: TLabel;
|
||||||
ComponentIconSpeedButton: TSpeedButton;
|
ComponentIconSpeedButton: TSpeedButton;
|
||||||
ComponentUnitFileLabel: TLabel;
|
|
||||||
ComponentUnitFileEdit: TEdit;
|
|
||||||
ComponentUnitFileBrowseButton: TButton;
|
ComponentUnitFileBrowseButton: TButton;
|
||||||
|
ComponentUnitFileEdit: TEdit;
|
||||||
|
ComponentUnitFileLabel: TLabel;
|
||||||
ComponentUnitFileShortenButton: TButton;
|
ComponentUnitFileShortenButton: TButton;
|
||||||
ComponentUnitNameLabel: TLabel;
|
|
||||||
ComponentUnitNameEdit: TEdit;
|
ComponentUnitNameEdit: TEdit;
|
||||||
NewDepPanel: TPanel;
|
ComponentUnitNameLabel: TLabel;
|
||||||
DependPkgNameLabel: TLabel;
|
|
||||||
DependPkgNameComboBox: TComboBox;
|
|
||||||
DependMinVersionLabel: TLabel;
|
|
||||||
DependMinVersionEdit: TEdit;
|
|
||||||
DependMaxVersionLabel: TLabel;
|
|
||||||
DependMaxVersionEdit: TEdit;
|
DependMaxVersionEdit: TEdit;
|
||||||
|
DependMaxVersionLabel: TLabel;
|
||||||
|
DependMinVersionEdit: TEdit;
|
||||||
|
DependMinVersionLabel: TLabel;
|
||||||
|
DependPkgNameComboBox: TComboBox;
|
||||||
|
DependPkgNameLabel: TLabel;
|
||||||
FilesDeleteButton: TBitBtn;
|
FilesDeleteButton: TBitBtn;
|
||||||
FilesShortenButton: TBitBtn;
|
FilesDirButton: TBitBtn;
|
||||||
FilesListView: TListView;
|
FilesListView: TListView;
|
||||||
NewFileBtnPanel: TPanel;
|
FilesShortenButton: TBitBtn;
|
||||||
AddFilesBtnPanel: TPanel;
|
NewComponentPage: TTabSheet;
|
||||||
|
NewDepPanel: TPanel;
|
||||||
|
NewRequirementPage: TTabSheet;
|
||||||
|
OkButton: TBitBtn;
|
||||||
|
AddToPackageBtnPanel: TPanel;
|
||||||
|
PageControl1: TPageControl;
|
||||||
|
PalettePageCombobox: TComboBox;
|
||||||
|
PalettePageLabel: TLabel;
|
||||||
procedure AddToPackageDlgClose(Sender: TObject; var {%H-}CloseAction: TCloseAction);
|
procedure AddToPackageDlgClose(Sender: TObject; var {%H-}CloseAction: TCloseAction);
|
||||||
procedure AddToPackageDlgKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
procedure AddToPackageDlgKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||||
procedure AncestorComboBoxChange(Sender: TObject);
|
procedure AncestorComboBoxChange(Sender: TObject);
|
||||||
@ -142,11 +135,6 @@ type
|
|||||||
procedure NewComponentButtonClick(Sender: TObject);
|
procedure NewComponentButtonClick(Sender: TObject);
|
||||||
procedure NewComponentPageResize(Sender: TObject);
|
procedure NewComponentPageResize(Sender: TObject);
|
||||||
procedure NewDependButtonClick(Sender: TObject);
|
procedure NewDependButtonClick(Sender: TObject);
|
||||||
procedure NewFileOkButtonClick(Sender: TObject);
|
|
||||||
procedure NewFilePageResize(Sender: TObject);
|
|
||||||
procedure NewFileTreeViewClick(Sender: TObject);
|
|
||||||
procedure NewFileTreeViewDblClick(Sender: TObject);
|
|
||||||
procedure NewFileTreeViewSelectionChanged(Sender: TObject);
|
|
||||||
procedure PageControl1Change(Sender: TObject);
|
procedure PageControl1Change(Sender: TObject);
|
||||||
private
|
private
|
||||||
fLastNewComponentAncestorType: string;
|
fLastNewComponentAncestorType: string;
|
||||||
@ -161,7 +149,6 @@ type
|
|||||||
procedure SetActivatePage(AValue: TAddToPkgType);
|
procedure SetActivatePage(AValue: TAddToPkgType);
|
||||||
procedure SetLazPackage(const AValue: TLazPackage);
|
procedure SetLazPackage(const AValue: TLazPackage);
|
||||||
procedure SetupComponents;
|
procedure SetupComponents;
|
||||||
procedure SetupNewFilePage;
|
|
||||||
procedure SetupNewComponentPage;
|
procedure SetupNewComponentPage;
|
||||||
procedure SetupAddDependencyPage;
|
procedure SetupAddDependencyPage;
|
||||||
procedure SetupAddFilesPage;
|
procedure SetupAddFilesPage;
|
||||||
@ -173,7 +160,6 @@ type
|
|||||||
procedure AutoCompleteNewComponent;
|
procedure AutoCompleteNewComponent;
|
||||||
procedure AutoCompleteNewComponentUnitName;
|
procedure AutoCompleteNewComponentUnitName;
|
||||||
function SwitchRelativeAbsoluteFilename(const Filename: string): string;
|
function SwitchRelativeAbsoluteFilename(const Filename: string): string;
|
||||||
procedure FillNewFileTreeView;
|
|
||||||
function FindFileInFilesList(AFilename: string): Integer;
|
function FindFileInFilesList(AFilename: string): Integer;
|
||||||
procedure LoadComponentIcon(AFilename: string);
|
procedure LoadComponentIcon(AFilename: string);
|
||||||
public
|
public
|
||||||
@ -944,52 +930,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TAddToPackageDlg.NewFileOkButtonClick(Sender: TObject);
|
|
||||||
var
|
|
||||||
ANode: TTreeNode;
|
|
||||||
begin
|
|
||||||
ANode:=NewFileTreeView.Selected;
|
|
||||||
if (ANode<>nil) and (ANode.Data<>nil) and (TObject(ANode.Data) is TNewItemProjectFile)
|
|
||||||
then begin
|
|
||||||
Params.Clear;
|
|
||||||
Params.AddType:=d2ptNewFile;
|
|
||||||
Params.NewItem:=TNewIDEItemTemplate(ANode.Data);
|
|
||||||
ModalResult:=mrOk;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
IDEMessageDialog(lisNewDlgNoItemSelected,lisNewDlgPleaseSelectAnItemFirst,mtInformation,[mbOk]);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TAddToPackageDlg.NewFilePageResize(Sender: TObject);
|
|
||||||
begin
|
|
||||||
NewFileTreeView.Width:=NewFilePage.ClientWidth div 2;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TAddToPackageDlg.NewFileTreeViewClick(Sender: TObject);
|
|
||||||
var
|
|
||||||
Desc: String;
|
|
||||||
ANode: TTreeNode;
|
|
||||||
begin
|
|
||||||
ANode:=NewFileTreeView.Selected;
|
|
||||||
Desc:='';
|
|
||||||
if (ANode<>nil) and (ANode.Data<>nil) then begin
|
|
||||||
if TObject(ANode.Data) is TNewIDEItemTemplate then
|
|
||||||
Desc:=TNewIDEItemTemplate(ANode.Data).Description;
|
|
||||||
end;
|
|
||||||
NewFileHelpLabel.Caption:=Desc;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TAddToPackageDlg.NewFileTreeViewDblClick(Sender: TObject);
|
|
||||||
begin
|
|
||||||
NewFileOkButtonClick(Self);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TAddToPackageDlg.NewFileTreeViewSelectionChanged(Sender: TObject);
|
|
||||||
begin
|
|
||||||
OkButton.Enabled:=(NewFileTreeView.Selected<>nil)
|
|
||||||
and (TObject(NewFileTreeView.Selected.Data) is TNewIDEItemTemplate);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TAddToPackageDlg.SetLazPackage(const AValue: TLazPackage);
|
procedure TAddToPackageDlg.SetLazPackage(const AValue: TLazPackage);
|
||||||
begin
|
begin
|
||||||
if FLazPackage=AValue then exit;
|
if FLazPackage=AValue then exit;
|
||||||
@ -1006,10 +946,13 @@ begin
|
|||||||
Result:=d2ptNewComponent
|
Result:=d2ptNewComponent
|
||||||
else if PageControl1.ActivePage=NewRequirementPage then
|
else if PageControl1.ActivePage=NewRequirementPage then
|
||||||
Result:=d2ptRequiredPkg
|
Result:=d2ptRequiredPkg
|
||||||
else if PageControl1.ActivePage=AddFilesPage then
|
else {if PageControl1.ActivePage=AddFilesPage then } begin
|
||||||
Result:=d2ptFiles
|
Assert(PageControl1.ActivePage=AddFilesPage,
|
||||||
else
|
'TAddToPackageDlg.GetActivatePage: PageControl1.ActivePage <> AddFilesPage');
|
||||||
Result:=d2ptNewFile;
|
Result:=d2ptFiles;
|
||||||
|
end;
|
||||||
|
//else
|
||||||
|
// Result:=d2ptNewFile;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TAddToPackageDlg.SetActivatePage(AValue: TAddToPkgType);
|
procedure TAddToPackageDlg.SetActivatePage(AValue: TAddToPkgType);
|
||||||
@ -1017,8 +960,8 @@ begin
|
|||||||
case AValue of
|
case AValue of
|
||||||
d2ptNewComponent: PageControl1.ActivePage:=NewComponentPage;
|
d2ptNewComponent: PageControl1.ActivePage:=NewComponentPage;
|
||||||
d2ptRequiredPkg: PageControl1.ActivePage:=NewRequirementPage;
|
d2ptRequiredPkg: PageControl1.ActivePage:=NewRequirementPage;
|
||||||
d2ptFile,d2ptFiles: PageControl1.ActivePage:=AddFilesPage;
|
d2ptFiles: PageControl1.ActivePage:=AddFilesPage;
|
||||||
else PageControl1.ActivePage:=NewFilePage;
|
else raise Exception.Create('TAddToPackageDlg.SetActivatePage: invalid value.');
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1037,23 +980,17 @@ end;
|
|||||||
procedure TAddToPackageDlg.PageControl1Change(Sender: TObject);
|
procedure TAddToPackageDlg.PageControl1Change(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
case PageControl1.PageIndex of
|
case PageControl1.PageIndex of
|
||||||
0: begin // New File
|
0: begin // New Component
|
||||||
OkButton.Caption:=lisA2PCreateNewFile;
|
|
||||||
OkButton.OnClick:=@NewFileOkButtonClick;
|
|
||||||
OkButton.Enabled:=(NewFileTreeView.Selected<>nil)
|
|
||||||
and (TObject(NewFileTreeView.Selected.Data) is TNewIDEItemTemplate);
|
|
||||||
end;
|
|
||||||
1: begin // New Component
|
|
||||||
OkButton.Caption:=lisA2PCreateNewComp;
|
OkButton.Caption:=lisA2PCreateNewComp;
|
||||||
OkButton.OnClick:=@NewComponentButtonClick;
|
OkButton.OnClick:=@NewComponentButtonClick;
|
||||||
CheckNewCompOk;
|
CheckNewCompOk;
|
||||||
end;
|
end;
|
||||||
2: begin // New Requirement
|
1: begin // New Requirement
|
||||||
OkButton.Caption:=lisA2PCreateNewReq;
|
OkButton.Caption:=lisA2PCreateNewReq;
|
||||||
OkButton.OnClick:=@NewDependButtonClick;
|
OkButton.OnClick:=@NewDependButtonClick;
|
||||||
CheckNewReqOk;
|
CheckNewReqOk;
|
||||||
end;
|
end;
|
||||||
3: begin // Add Files
|
2: begin // Add Files
|
||||||
OkButton.Caption:=lisA2PAddFilesToPackage;
|
OkButton.Caption:=lisA2PAddFilesToPackage;
|
||||||
OkButton.OnClick:=@FilesAddButtonClick;
|
OkButton.OnClick:=@FilesAddButtonClick;
|
||||||
CheckFilesButtonsOk;
|
CheckFilesButtonsOk;
|
||||||
@ -1063,7 +1000,7 @@ end;
|
|||||||
|
|
||||||
procedure TAddToPackageDlg.SetupComponents;
|
procedure TAddToPackageDlg.SetupComponents;
|
||||||
begin
|
begin
|
||||||
NewFilePage.Caption:=lisA2PNewFile;
|
//NewFilePage.Caption:=lisA2PNewFile;
|
||||||
NewComponentPage.Caption:=lisA2PNewComponent;
|
NewComponentPage.Caption:=lisA2PNewComponent;
|
||||||
NewRequirementPage.Caption:=lisProjAddNewRequirement;
|
NewRequirementPage.Caption:=lisProjAddNewRequirement;
|
||||||
AddFilesPage.Caption:=lisA2PAddFiles;
|
AddFilesPage.Caption:=lisA2PAddFiles;
|
||||||
@ -1071,19 +1008,12 @@ begin
|
|||||||
PageControl1.PageIndex:=0;
|
PageControl1.PageIndex:=0;
|
||||||
PageControl1Change(PageControl1);
|
PageControl1Change(PageControl1);
|
||||||
|
|
||||||
SetupNewFilePage;
|
//SetupNewFilePage;
|
||||||
SetupNewComponentPage;
|
SetupNewComponentPage;
|
||||||
SetupAddDependencyPage;
|
SetupAddDependencyPage;
|
||||||
SetupAddFilesPage;
|
SetupAddFilesPage;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TAddToPackageDlg.SetupNewFilePage;
|
|
||||||
begin
|
|
||||||
NewFileDescriptionGroupBox.Caption:=lisCodeHelpDescrTag;
|
|
||||||
NewFileHelpLabel.Caption:='';
|
|
||||||
FillNewFileTreeView;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TAddToPackageDlg.SetupNewComponentPage;
|
procedure TAddToPackageDlg.SetupNewComponentPage;
|
||||||
begin
|
begin
|
||||||
AncestorTypeLabel.Caption:=lisA2PAncestorType;
|
AncestorTypeLabel.Caption:=lisA2PAncestorType;
|
||||||
@ -1237,28 +1167,6 @@ begin
|
|||||||
Result:=TrimFilename(CreateAbsoluteSearchPath(Filename,LazPackage.Directory));
|
Result:=TrimFilename(CreateAbsoluteSearchPath(Filename,LazPackage.Directory));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TAddToPackageDlg.FillNewFileTreeView;
|
|
||||||
var
|
|
||||||
NewParentNode: TTreeNode;
|
|
||||||
Category: TNewIDEItemCategory;
|
|
||||||
TemplateID: Integer;
|
|
||||||
Template: TNewIDEItemTemplate;
|
|
||||||
begin
|
|
||||||
NewFileTreeView.BeginUpdate;
|
|
||||||
NewFileTreeView.Items.Clear;
|
|
||||||
Category:=NewIDEItems.FindByName(FileDescGroupName);
|
|
||||||
NewParentNode:=NewFileTreeView.Items.AddObject(nil,Category.LocalizedName,
|
|
||||||
Category);
|
|
||||||
for TemplateID:=0 to Category.Count-1 do begin
|
|
||||||
Template:=Category[TemplateID];
|
|
||||||
if Template.VisibleInNewDialog and (Template is TNewItemProjectFile) then
|
|
||||||
NewFileTreeView.Items.AddChildObject(NewParentNode,Template.LocalizedName,
|
|
||||||
Template);
|
|
||||||
end;
|
|
||||||
NewParentNode.Expand(true);
|
|
||||||
NewFileTreeView.EndUpdate;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TAddToPackageDlg.FindFileInFilesList(AFilename: string): Integer;
|
function TAddToPackageDlg.FindFileInFilesList(AFilename: string): Integer;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
|
|||||||
@ -42,6 +42,7 @@ uses
|
|||||||
IDEImagesIntf, MenuIntf, LazIDEIntf, ProjectIntf, CodeToolsStructs,
|
IDEImagesIntf, MenuIntf, LazIDEIntf, ProjectIntf, CodeToolsStructs,
|
||||||
FormEditingIntf, PackageIntf, IDEHelpIntf, IDEOptionsIntf,
|
FormEditingIntf, PackageIntf, IDEHelpIntf, IDEOptionsIntf,
|
||||||
IDEExternToolIntf,
|
IDEExternToolIntf,
|
||||||
|
NewItemIntf,
|
||||||
// IDE
|
// IDE
|
||||||
IDEDialogs, IDEProcs, LazarusIDEStrConsts, IDEDefs, CompilerOptions,
|
IDEDialogs, IDEProcs, LazarusIDEStrConsts, IDEDefs, CompilerOptions,
|
||||||
ComponentReg, UnitResources, EnvironmentOpts, DialogProcs, InputHistory,
|
ComponentReg, UnitResources, EnvironmentOpts, DialogProcs, InputHistory,
|
||||||
@ -313,6 +314,7 @@ type
|
|||||||
fUpdateLock: integer;
|
fUpdateLock: integer;
|
||||||
fForcedFlags: TPEFlags;
|
fForcedFlags: TPEFlags;
|
||||||
function AddOneFile(aFilename: string; var NewUnitPaths, NewIncPaths: String): TModalResult;
|
function AddOneFile(aFilename: string; var NewUnitPaths, NewIncPaths: String): TModalResult;
|
||||||
|
procedure DoAddNewFile(NewItem: TNewIDEItemTemplate);
|
||||||
procedure FreeNodeData(Typ: TPENodeType);
|
procedure FreeNodeData(Typ: TPENodeType);
|
||||||
function CreateNodeData(Typ: TPENodeType; aName: string; aRemoved: boolean): TPENodeData;
|
function CreateNodeData(Typ: TPENodeType; aName: string; aRemoved: boolean): TPENodeData;
|
||||||
procedure SetDependencyDefaultFilename(AsPreferred: boolean);
|
procedure SetDependencyDefaultFilename(AsPreferred: boolean);
|
||||||
@ -519,6 +521,9 @@ procedure RegisterStandardPackageEditorMenuItems;
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
uses
|
||||||
|
NewDialog;
|
||||||
|
|
||||||
{$R *.lfm}
|
{$R *.lfm}
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -1035,8 +1040,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPackageEditorForm.mnuAddNewFileClick(Sender: TObject);
|
procedure TPackageEditorForm.mnuAddNewFileClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
NewItem: TNewIDEItemTemplate;
|
||||||
begin
|
begin
|
||||||
ShowAddDialogEx(d2ptNewFile);
|
// Reuse the "New..." dialog for "Add new file".
|
||||||
|
if ShowNewIDEItemDialog(NewItem, true)=mrOk then
|
||||||
|
DoAddNewFile(NewItem);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPackageEditorForm.ItemsTreeViewSelectionChanged(Sender: TObject);
|
procedure TPackageEditorForm.ItemsTreeViewSelectionChanged(Sender: TObject);
|
||||||
@ -2040,6 +2049,47 @@ begin
|
|||||||
IdleConnected:=true;
|
IdleConnected:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TPackageEditorForm.DoAddNewFile(NewItem: TNewIDEItemTemplate);
|
||||||
|
var
|
||||||
|
NewFilename: String;
|
||||||
|
DummyResult: TModalResult;
|
||||||
|
NewFileType: TPkgFileType;
|
||||||
|
NewPkgFileFlags: TPkgFileFlags;
|
||||||
|
Desc: TProjectFileDescriptor;
|
||||||
|
NewUnitName: String;
|
||||||
|
HasRegisterProc: Boolean;
|
||||||
|
begin
|
||||||
|
if NewItem is TNewItemProjectFile then begin
|
||||||
|
// create new file
|
||||||
|
Desc:=TNewItemProjectFile(NewItem).Descriptor;
|
||||||
|
NewFilename:='';
|
||||||
|
DummyResult:=LazarusIDE.DoNewFile(Desc,NewFilename,'',
|
||||||
|
[nfOpenInEditor,nfCreateDefaultSrc,nfIsNotPartOfProject],LazPackage);
|
||||||
|
if DummyResult=mrOk then begin
|
||||||
|
// success -> now add it to package
|
||||||
|
NewUnitName:='';
|
||||||
|
NewFileType:=FileNameToPkgFileType(NewFilename);
|
||||||
|
NewPkgFileFlags:=[];
|
||||||
|
if (NewFileType in PkgFileUnitTypes) then begin
|
||||||
|
Include(NewPkgFileFlags,pffAddToPkgUsesSection);
|
||||||
|
NewUnitName:=ExtractFilenameOnly(NewFilename);
|
||||||
|
if Assigned(PackageEditors.OnGetUnitRegisterInfo) then begin
|
||||||
|
HasRegisterProc:=false;
|
||||||
|
PackageEditors.OnGetUnitRegisterInfo(Self,NewFilename,
|
||||||
|
NewUnitName,HasRegisterProc);
|
||||||
|
if HasRegisterProc then
|
||||||
|
Include(NewPkgFileFlags,pffHasRegisterProc);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
LazPackage.AddFile(NewFilename,NewUnitName,NewFileType,
|
||||||
|
NewPkgFileFlags, cpNormal);
|
||||||
|
FreeAndNil(FNextSelectedPart);
|
||||||
|
FNextSelectedPart:=TPENodeData.Create(penFile,NewFilename,false);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function TPackageEditorForm.ShowAddDialog(var DlgPage: TAddToPkgType): TModalResult;
|
function TPackageEditorForm.ShowAddDialog(var DlgPage: TAddToPkgType): TModalResult;
|
||||||
var
|
var
|
||||||
IgnoreUnitPaths, IgnoreIncPaths: TFilenameToStringTree;
|
IgnoreUnitPaths, IgnoreIncPaths: TFilenameToStringTree;
|
||||||
@ -2137,46 +2187,6 @@ var
|
|||||||
FNextSelectedPart:=TPENodeData.Create(penFile,AddParams.UnitFilename,false);
|
FNextSelectedPart:=TPENodeData.Create(penFile,AddParams.UnitFilename,false);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure AddNewFile(AddParams: TAddToPkgResult);
|
|
||||||
var
|
|
||||||
NewFilename: String;
|
|
||||||
DummyResult: TModalResult;
|
|
||||||
NewFileType: TPkgFileType;
|
|
||||||
NewPkgFileFlags: TPkgFileFlags;
|
|
||||||
Desc: TProjectFileDescriptor;
|
|
||||||
NewUnitName: String;
|
|
||||||
HasRegisterProc: Boolean;
|
|
||||||
begin
|
|
||||||
if AddParams.NewItem is TNewItemProjectFile then begin
|
|
||||||
// create new file
|
|
||||||
Desc:=TNewItemProjectFile(AddParams.NewItem).Descriptor;
|
|
||||||
NewFilename:='';
|
|
||||||
DummyResult:=LazarusIDE.DoNewFile(Desc,NewFilename,'',
|
|
||||||
[nfOpenInEditor,nfCreateDefaultSrc,nfIsNotPartOfProject],LazPackage);
|
|
||||||
if DummyResult=mrOk then begin
|
|
||||||
// success -> now add it to package
|
|
||||||
NewUnitName:='';
|
|
||||||
NewFileType:=FileNameToPkgFileType(NewFilename);
|
|
||||||
NewPkgFileFlags:=[];
|
|
||||||
if (NewFileType in PkgFileUnitTypes) then begin
|
|
||||||
Include(NewPkgFileFlags,pffAddToPkgUsesSection);
|
|
||||||
NewUnitName:=ExtractFilenameOnly(NewFilename);
|
|
||||||
if Assigned(PackageEditors.OnGetUnitRegisterInfo) then begin
|
|
||||||
HasRegisterProc:=false;
|
|
||||||
PackageEditors.OnGetUnitRegisterInfo(Self,NewFilename,
|
|
||||||
NewUnitName,HasRegisterProc);
|
|
||||||
if HasRegisterProc then
|
|
||||||
Include(NewPkgFileFlags,pffHasRegisterProc);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
LazPackage.AddFile(NewFilename,NewUnitName,NewFileType,
|
|
||||||
NewPkgFileFlags, cpNormal);
|
|
||||||
FreeAndNil(FNextSelectedPart);
|
|
||||||
FNextSelectedPart:=TPENodeData.Create(penFile,NewFilename,false);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
var
|
var
|
||||||
AddParams: TAddToPkgResult;
|
AddParams: TAddToPkgResult;
|
||||||
OldParams: TAddToPkgResult;
|
OldParams: TAddToPkgResult;
|
||||||
@ -2197,25 +2207,11 @@ begin
|
|||||||
try
|
try
|
||||||
while AddParams<>nil do begin
|
while AddParams<>nil do begin
|
||||||
case AddParams.AddType of
|
case AddParams.AddType of
|
||||||
|
d2ptUnit: AddUnit(AddParams);
|
||||||
d2ptUnit:
|
d2ptVirtualUnit: AddVirtualUnit(AddParams);
|
||||||
AddUnit(AddParams);
|
d2ptNewComponent: AddNewComponent(AddParams);
|
||||||
|
d2ptRequiredPkg: AddRequiredPkg(AddParams);
|
||||||
d2ptVirtualUnit:
|
d2ptFile: AddFile(AddParams);
|
||||||
AddVirtualUnit(AddParams);
|
|
||||||
|
|
||||||
d2ptNewComponent:
|
|
||||||
AddNewComponent(AddParams);
|
|
||||||
|
|
||||||
d2ptRequiredPkg:
|
|
||||||
AddRequiredPkg(AddParams);
|
|
||||||
|
|
||||||
d2ptFile:
|
|
||||||
AddFile(AddParams);
|
|
||||||
|
|
||||||
d2ptNewFile:
|
|
||||||
AddNewFile(AddParams);
|
|
||||||
|
|
||||||
end;
|
end;
|
||||||
OldParams:=AddParams;
|
OldParams:=AddParams;
|
||||||
AddParams:=AddParams.Next;
|
AddParams:=AddParams.Next;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user