ide: use button panels in add project dialog

git-svn-id: trunk@20507 -
This commit is contained in:
paul 2009-06-08 06:22:29 +00:00
parent cfa6393564
commit 0f87070034
3 changed files with 86 additions and 155 deletions

View File

@ -9,11 +9,12 @@ object AddToProjectDialog: TAddToProjectDialog
ClientHeight = 300
ClientWidth = 500
OnClose = AddToProjectDialogClose
ParentFont = False
Position = poScreenCenter
LCLVersion = '0.9.25'
LCLVersion = '0.9.27'
object Notebook: TNotebook
Left = 0
Height = 300
Top = 0
Width = 500
Align = alClient
PageIndex = 0
@ -33,48 +34,26 @@ object AddToProjectDialog: TAddToProjectDialog
ParentColor = False
end
object AddFileListBox: TListBox
AnchorSideBottom.Control = FileButtonPanel
Left = 6
Height = 206
Height = 210
Top = 26
Width = 480
Align = alTop
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6
ItemHeight = 0
MultiSelect = True
TabOrder = 0
end
object AddFileButton: TBitBtn
AnchorSideRight.Control = CancelAddFileButton
AnchorSideBottom.Control = AddEditorFilePage
AnchorSideBottom.Side = asrBottom
Left = 262
Height = 23
Top = 245
Width = 93
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Around = 6
Caption = 'AddFileButton'
NumGlyphs = 0
OnClick = AddFileButtonClick
object FileButtonPanel: TButtonPanel
Left = 6
Height = 26
Top = 242
Width = 480
TabOrder = 1
end
object CancelAddFileButton: TBitBtn
AnchorSideRight.Control = AddEditorFilePage
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = AddEditorFilePage
AnchorSideBottom.Side = asrBottom
Left = 361
Height = 23
Top = 245
Width = 125
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Around = 6
Caption = 'CancelAddFileButton'
ModalResult = 2
NumGlyphs = 0
TabOrder = 2
ShowButtons = [pbOK, pbCancel]
ShowBevel = False
end
end
object NewDependPage: TPage
@ -135,38 +114,14 @@ object AddToProjectDialog: TAddToProjectDialog
TabOrder = 2
Text = 'DependMaxVersionEdit'
end
object NewDependButton: TBitBtn
AnchorSideRight.Control = CancelDependButton
AnchorSideBottom.Control = NewDependPage
AnchorSideBottom.Side = asrBottom
Left = 237
Height = 23
Top = 245
Width = 116
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Around = 6
Caption = 'NewDependButton'
NumGlyphs = 0
OnClick = NewDependButtonClick
object DependButtonPanel: TButtonPanel
Left = 6
Height = 26
Top = 242
Width = 480
TabOrder = 3
end
object CancelDependButton: TBitBtn
AnchorSideRight.Control = NewDependPage
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = NewDependPage
AnchorSideBottom.Side = asrBottom
Left = 359
Height = 23
Top = 245
Width = 127
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Around = 6
Caption = 'CancelDependButton'
ModalResult = 2
NumGlyphs = 0
TabOrder = 4
ShowButtons = [pbOK, pbCancel]
ShowBevel = False
end
end
object AddFilesPage: TPage

View File

@ -5,77 +5,60 @@ LazarusResources.Add('TAddToProjectDialog','FORMDATA',[
+#3','#1#3'Top'#3#250#0#5'Width'#3#244#1#13'ActiveControl'#7#8'Notebook'#11'B'
+'orderStyle'#7#13'bsSizeToolWin'#7'Caption'#6#18'AddToProjectDialog'#12'Clie'
+'ntHeight'#3','#1#11'ClientWidth'#3#244#1#7'OnClose'#7#23'AddToProjectDialog'
+'Close'#10'ParentFont'#8#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#6
+'0.9.25'#0#9'TNotebook'#8'Notebook'#6'Height'#3','#1#5'Width'#3#244#1#5'Alig'
+'n'#7#8'alClient'#9'PageIndex'#2#0#8'TabOrder'#2#0#0#5'TPage'#17'AddEditorFi'
+'lePage'#7'Caption'#6#17'AddEditorFilePage'#11'ClientWidth'#3#236#1#12'Clien'
+'tHeight'#3#18#1#0#6'TLabel'#12'AddFileLabel'#4'Left'#2#6#6'Height'#2#14#3'T'
+'op'#2#6#5'Width'#3#224#1#5'Align'#7#5'alTop'#20'BorderSpacing.Around'#2#6#7
+'Caption'#6#12'AddFileLabel'#11'ParentColor'#8#0#0#8'TListBox'#14'AddFileLis'
+'tBox'#4'Left'#2#6#6'Height'#3#206#0#3'Top'#2#26#5'Width'#3#224#1#5'Align'#7
+#5'alTop'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#20'Borde'
+'rSpacing.Around'#2#6#11'MultiSelect'#9#8'TabOrder'#2#0#0#0#7'TBitBtn'#13'Ad'
+'dFileButton'#23'AnchorSideRight.Control'#7#19'CancelAddFileButton'#24'Ancho'
+'rSideBottom.Control'#7#17'AddEditorFilePage'#21'AnchorSideBottom.Side'#7#9
+'asrBottom'#4'Left'#3#6#1#6'Height'#2#23#3'Top'#3#245#0#5'Width'#2']'#7'Anch'
+'ors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6
+#7'Caption'#6#13'AddFileButton'#9'NumGlyphs'#2#0#7'OnClick'#7#18'AddFileButt'
+'onClick'#8'TabOrder'#2#1#0#0#7'TBitBtn'#19'CancelAddFileButton'#23'AnchorSi'
+'deRight.Control'#7#17'AddEditorFilePage'#20'AnchorSideRight.Side'#7#9'asrBo'
+'ttom'#24'AnchorSideBottom.Control'#7#17'AddEditorFilePage'#21'AnchorSideBot'
+'tom.Side'#7#9'asrBottom'#4'Left'#3'i'#1#6'Height'#2#23#3'Top'#3#245#0#5'Wid'
+'th'#2'}'#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpac'
+'ing.Around'#2#6#7'Caption'#6#19'CancelAddFileButton'#11'ModalResult'#2#2#9
+'NumGlyphs'#2#0#8'TabOrder'#2#2#0#0#0#5'TPage'#13'NewDependPage'#7'Caption'#6
+#13'NewDependPage'#11'ClientWidth'#3#236#1#12'ClientHeight'#3#18#1#0#6'TLabe'
+'l'#18'DependPkgNameLabel'#4'Left'#2#8#6'Height'#2#14#3'Top'#2#19#5'Width'#2
+'k'#7'Caption'#6#18'DependPkgNameLabel'#11'ParentColor'#8#0#0#6'TLabel'#21'D'
+'ependMinVersionLabel'#4'Left'#2#8#6'Height'#2#14#3'Top'#2'/'#5'Width'#2'r'#7
+'Caption'#6#21'DependMinVersionLabel'#11'ParentColor'#8#0#0#6'TLabel'#21'Dep'
+'endMaxVersionLabel'#4'Left'#2#8#6'Height'#2#14#3'Top'#2'L'#5'Width'#2'v'#7
+'Caption'#6#21'DependMaxVersionLabel'#11'ParentColor'#8#0#0#9'TComboBox'#21
+'DependPkgNameComboBox'#4'Left'#3#218#0#6'Height'#2#21#3'Top'#2#14#5'Width'#3
+#12#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#12'AutoComplete'#9#16'Au'
+'toCompleteText'#11#12'cbactEnabled'#22'cbactEndOfLineComplete'#20'cbactSear'
+'chAscending'#0#10'ItemHeight'#2#13#8'TabOrder'#2#0#4'Text'#6#21'DependPkgNa'
+'meComboBox'#0#0#5'TEdit'#20'DependMinVersionEdit'#4'Left'#3#218#0#6'Height'
+#2#23#3'Top'#2','#5'Width'#3#12#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'
+#0#8'TabOrder'#2#1#4'Text'#6#20'DependMinVersionEdit'#0#0#5'TEdit'#20'Depend'
+'MaxVersionEdit'#4'Left'#3#218#0#6'Height'#2#23#3'Top'#2'I'#5'Width'#3#12#1#7
+'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'TabOrder'#2#2#4'Text'#6#20'De'
+'pendMaxVersionEdit'#0#0#7'TBitBtn'#15'NewDependButton'#23'AnchorSideRight.C'
+'ontrol'#7#18'CancelDependButton'#24'AnchorSideBottom.Control'#7#13'NewDepen'
+'dPage'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#3#237#0#6'Height'#2
+#23#3'Top'#3#245#0#5'Width'#2't'#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'Au'
+'toSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6#15'NewDependButton'#9'N'
+'umGlyphs'#2#0#7'OnClick'#7#20'NewDependButtonClick'#8'TabOrder'#2#3#0#0#7'T'
+'BitBtn'#18'CancelDependButton'#23'AnchorSideRight.Control'#7#13'NewDependPa'
+'ge'#20'AnchorSideRight.Side'#7#9'asrBottom'#24'AnchorSideBottom.Control'#7
+#13'NewDependPage'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#3'g'#1#6
+'Height'#2#23#3'Top'#3#245#0#5'Width'#2''#7'Anchors'#11#7'akRight'#8'akBott'
+'om'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6#18'CancelDepe'
+'ndButton'#11'ModalResult'#2#2#9'NumGlyphs'#2#0#8'TabOrder'#2#4#0#0#0#5'TPag'
+'e'#12'AddFilesPage'#7'Caption'#6#12'AddFilesPage'#11'ClientWidth'#3#236#1#12
+'ClientHeight'#3#18#1#0#9'TListView'#13'FilesListView'#4'Left'#2#6#6'Height'
+#3#226#0#3'Top'#2#6#5'Width'#3#224#1#5'Align'#7#5'alTop'#7'Anchors'#11#5'akT'
+'op'#6'akLeft'#7'akRight'#8'akBottom'#0#20'BorderSpacing.Around'#2#6#7'Colum'
+'ns'#14#0#11'MultiSelect'#9#8'TabOrder'#2#0#9'ViewStyle'#7#8'vsReport'#12'On'
+'SelectItem'#7#23'FilesListViewSelectItem'#0#0#7'TButton'#17'FilesBrowseButt'
+'on'#4'Left'#2#6#6'Height'#2#23#3'Top'#3#244#0#5'Width'#2'r'#7'Anchors'#11#6
+'akLeft'#8'akBottom'#0#8'AutoSize'#9#7'Caption'#6#17'FilesBrowseButton'#7'On'
+'Click'#7#22'FilesBrowseButtonClick'#8'TabOrder'#2#1#0#0#7'TButton'#18'Files'
+'ShortenButton'#22'AnchorSideLeft.Control'#7#17'FilesBrowseButton'#19'Anchor'
,'SideLeft.Side'#7#9'asrBottom'#4'Left'#2'~'#6'Height'#2#23#3'Top'#3#244#0#5
+'Width'#2'u'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#8'AutoSize'#9#18'BorderSp'
+'acing.Left'#2#6#7'Caption'#6#18'FilesShortenButton'#7'OnClick'#7#23'FilesSh'
+'ortenButtonClick'#8'TabOrder'#2#2#0#0#7'TButton'#17'FilesDeleteButton'#22'A'
+'nchorSideLeft.Control'#7#18'FilesShortenButton'#19'AnchorSideLeft.Side'#7#9
+'asrBottom'#4'Left'#3#249#0#6'Height'#2#23#3'Top'#3#244#0#5'Width'#2'n'#7'An'
+'chors'#11#6'akLeft'#8'akBottom'#0#8'AutoSize'#9#18'BorderSpacing.Left'#2#6#7
+'Caption'#6#17'FilesDeleteButton'#7'OnClick'#7#22'FilesDeleteButtonClick'#8
+'TabOrder'#2#3#0#0#7'TButton'#14'FilesAddButton'#22'AnchorSideLeft.Control'#7
+#17'FilesDeleteButton'#19'AnchorSideLeft.Side'#7#9'asrBottom'#4'Left'#3'm'#1
+#6'Height'#2#23#3'Top'#3#244#0#5'Width'#2'b'#7'Anchors'#11#6'akLeft'#8'akBot'
+'tom'#0#8'AutoSize'#9#18'BorderSpacing.Left'#2#6#7'Caption'#6#14'FilesAddBut'
+'ton'#7'OnClick'#7#19'FilesAddButtonClick'#8'TabOrder'#2#4#0#0#0#0#0
+'Close'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#6'0.9.27'#0#9'TNot'
+'ebook'#8'Notebook'#4'Left'#2#0#6'Height'#3','#1#3'Top'#2#0#5'Width'#3#244#1
+#5'Align'#7#8'alClient'#9'PageIndex'#2#0#8'TabOrder'#2#0#0#5'TPage'#17'AddEd'
+'itorFilePage'#7'Caption'#6#17'AddEditorFilePage'#11'ClientWidth'#3#236#1#12
+'ClientHeight'#3#18#1#0#6'TLabel'#12'AddFileLabel'#4'Left'#2#6#6'Height'#2#14
+#3'Top'#2#6#5'Width'#3#224#1#5'Align'#7#5'alTop'#20'BorderSpacing.Around'#2#6
+#7'Caption'#6#12'AddFileLabel'#11'ParentColor'#8#0#0#8'TListBox'#14'AddFileL'
+'istBox'#24'AnchorSideBottom.Control'#7#15'FileButtonPanel'#4'Left'#2#6#6'He'
+'ight'#3#210#0#3'Top'#2#26#5'Width'#3#224#1#5'Align'#7#5'alTop'#7'Anchors'#11
+#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#20'BorderSpacing.Around'#2#6#10
+'ItemHeight'#2#0#11'MultiSelect'#9#8'TabOrder'#2#0#0#0#12'TButtonPanel'#15'F'
+'ileButtonPanel'#4'Left'#2#6#6'Height'#2#26#3'Top'#3#242#0#5'Width'#3#224#1#8
+'TabOrder'#2#1#11'ShowButtons'#11#4'pbOK'#8'pbCancel'#0#9'ShowBevel'#8#0#0#0
+#5'TPage'#13'NewDependPage'#7'Caption'#6#13'NewDependPage'#11'ClientWidth'#3
+#236#1#12'ClientHeight'#3#18#1#0#6'TLabel'#18'DependPkgNameLabel'#4'Left'#2#8
+#6'Height'#2#14#3'Top'#2#19#5'Width'#2'k'#7'Caption'#6#18'DependPkgNameLabel'
+#11'ParentColor'#8#0#0#6'TLabel'#21'DependMinVersionLabel'#4'Left'#2#8#6'Hei'
+'ght'#2#14#3'Top'#2'/'#5'Width'#2'r'#7'Caption'#6#21'DependMinVersionLabel'
+#11'ParentColor'#8#0#0#6'TLabel'#21'DependMaxVersionLabel'#4'Left'#2#8#6'Hei'
+'ght'#2#14#3'Top'#2'L'#5'Width'#2'v'#7'Caption'#6#21'DependMaxVersionLabel'
+#11'ParentColor'#8#0#0#9'TComboBox'#21'DependPkgNameComboBox'#4'Left'#3#218#0
+#6'Height'#2#21#3'Top'#2#14#5'Width'#3#12#1#7'Anchors'#11#5'akTop'#6'akLeft'
+#7'akRight'#0#12'AutoComplete'#9#16'AutoCompleteText'#11#12'cbactEnabled'#22
+'cbactEndOfLineComplete'#20'cbactSearchAscending'#0#10'ItemHeight'#2#13#8'Ta'
+'bOrder'#2#0#4'Text'#6#21'DependPkgNameComboBox'#0#0#5'TEdit'#20'DependMinVe'
+'rsionEdit'#4'Left'#3#218#0#6'Height'#2#23#3'Top'#2','#5'Width'#3#12#1#7'Anc'
+'hors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'TabOrder'#2#1#4'Text'#6#20'Depen'
+'dMinVersionEdit'#0#0#5'TEdit'#20'DependMaxVersionEdit'#4'Left'#3#218#0#6'He'
+'ight'#2#23#3'Top'#2'I'#5'Width'#3#12#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'a'
+'kRight'#0#8'TabOrder'#2#2#4'Text'#6#20'DependMaxVersionEdit'#0#0#12'TButton'
+'Panel'#17'DependButtonPanel'#4'Left'#2#6#6'Height'#2#26#3'Top'#3#242#0#5'Wi'
+'dth'#3#224#1#8'TabOrder'#2#3#11'ShowButtons'#11#4'pbOK'#8'pbCancel'#0#9'Sho'
+'wBevel'#8#0#0#0#5'TPage'#12'AddFilesPage'#7'Caption'#6#12'AddFilesPage'#11
+'ClientWidth'#3#236#1#12'ClientHeight'#3#18#1#0#9'TListView'#13'FilesListVie'
+'w'#4'Left'#2#6#6'Height'#3#226#0#3'Top'#2#6#5'Width'#3#224#1#5'Align'#7#5'a'
+'lTop'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#20'BorderSp'
+'acing.Around'#2#6#7'Columns'#14#0#11'MultiSelect'#9#8'TabOrder'#2#0#9'ViewS'
+'tyle'#7#8'vsReport'#12'OnSelectItem'#7#23'FilesListViewSelectItem'#0#0#7'TB'
+'utton'#17'FilesBrowseButton'#4'Left'#2#6#6'Height'#2#23#3'Top'#3#244#0#5'Wi'
+'dth'#2'r'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#8'AutoSize'#9#7'Caption'#6
+#17'FilesBrowseButton'#7'OnClick'#7#22'FilesBrowseButtonClick'#8'TabOrder'#2
+#1#0#0#7'TButton'#18'FilesShortenButton'#22'AnchorSideLeft.Control'#7#17'Fil'
+'esBrowseButton'#19'AnchorSideLeft.Side'#7#9'asrBottom'#4'Left'#2'~'#6'Heigh'
+'t'#2#23#3'Top'#3#244#0#5'Width'#2'u'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#8
+'AutoSize'#9#18'BorderSpacing.Left'#2#6#7'Caption'#6#18'FilesShortenButton'#7
+'OnClick'#7#23'FilesShortenButtonClick'#8'TabOrder'#2#2#0#0#7'TButton'#17'Fi'
+'lesDeleteButton'#22'AnchorSideLeft.Control'#7#18'FilesShortenButton'#19'Anc'
+'horSideLeft.Side'#7#9'asrBottom'#4'Left'#3#249#0#6'Height'#2#23#3'Top'#3#244
+#0#5'Width'#2'n'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#8'AutoSize'#9#18'Bord'
+'erSpacing.Left'#2#6#7'Caption'#6#17'FilesDeleteButton'#7'OnClick'#7#22'File'
+'sDeleteButtonClick'#8'TabOrder'#2#3#0#0#7'TButton'#14'FilesAddButton'#22'An'
+'chorSideLeft.Control'#7#17'FilesDeleteButton'#19'AnchorSideLeft.Side'#7#9'a'
+'srBottom'#4'Left'#3'm'#1#6'Height'#2#23#3'Top'#3#244#0#5'Width'#2'b'#7'Anch'
+'ors'#11#6'akLeft'#8'akBottom'#0#8'AutoSize'#9#18'BorderSpacing.Left'#2#6#7
+'Caption'#6#14'FilesAddButton'#7'OnClick'#7#19'FilesAddButtonClick'#8'TabOrd'
+'er'#2#4#0#0#0#0#0
]);

View File

@ -35,10 +35,9 @@ interface
uses
Classes, SysUtils, Math, LCLProc, LResources, Forms, Controls, Buttons,
ComCtrls, StdCtrls, ExtCtrls, Menus, Dialogs, Graphics, FileUtil, AVL_Tree,
IDEWindowIntf,
LazarusIDEStrConsts, IDEProcs, IDEOptionDefs, EnvironmentOpts,
Project, PackageDefs, PackageSystem, InputHistory;
ComCtrls, StdCtrls, ExtCtrls, Menus, Dialogs, Graphics, FileUtil, ButtonPanel,
AVL_Tree, IDEWindowIntf, LazarusIDEStrConsts, IDEProcs, IDEOptionDefs,
EnvironmentOpts, Project, PackageDefs, PackageSystem, InputHistory;
type
TAddToProjectType = (
@ -57,6 +56,8 @@ type
{ TAddToProjectDialog }
TAddToProjectDialog = class(TForm)
FileButtonPanel: TButtonPanel;
DependButtonPanel: TButtonPanel;
// notebook
NoteBook: TNoteBook;
AddEditorFilePage: TPage;
@ -65,8 +66,6 @@ type
// add file page
AddFileLabel: TLabel;
AddFileListBox: TListBox;
AddFileButton: TBitBtn;
CancelAddFileButton: TBitBtn;
// new required package
DependPkgNameLabel: TLabel;
DependPkgNameComboBox: TComboBox;
@ -74,8 +73,6 @@ type
DependMinVersionEdit: TEdit;
DependMaxVersionLabel: TLabel;
DependMaxVersionEdit: TEdit;
NewDependButton: TBitBtn;
CancelDependButton: TBitBtn;
// add files page
FilesListView: TListView;
FilesBrowseButton: TButton;
@ -386,10 +383,11 @@ procedure TAddToProjectDialog.SetupComponents;
begin
NoteBook.PageIndex:=0;
AddFileButton.LoadGlyphFromLazarusResource('btn_ok');
CancelAddFileButton.LoadGlyphFromLazarusResource('btn_cancel');
CancelDependButton.LoadGlyphFromLazarusResource('btn_cancel');
NewDependButton.LoadGlyphFromLazarusResource('btn_ok');
FileButtonPanel.OKButton.ModalResult := mrNone;
FileButtonPanel.OKButton.OnClick := @AddFileButtonClick;
DependButtonPanel.OKButton.ModalResult := mrNone;
DependButtonPanel.OKButton.OnClick := @NewDependButtonClick;
SetupAddEditorFilePage(0);
SetupAddRequirementPage(1);
@ -408,8 +406,6 @@ begin
DependMaxVersionLabel.Caption:=lisProjAddMaximumVersionOptional;
DependMaxVersionEdit.Text:='';
NewDependButton.Caption:=lisLazBuildOk;
end;
procedure TAddToProjectDialog.SetupAddFilesPage(index: integer);
@ -444,9 +440,6 @@ begin
Notebook.Page[index].Caption := lisProjAddEditorFile;
AddFileLabel.Caption:=lisProjAddAddFileToProject;
AddFileButton.Caption:=lisLazBuildOk;
CancelAddFileButton.Caption:=dlgCancel;
end;
function TAddToProjectDialog.CheckAddingFile(NewFiles: TStringList;