diff options
-rw-r--r-- | src/gui/fpg_dialogs.pas | 24 | ||||
-rw-r--r-- | src/gui/messagedialog.inc | 2 | ||||
-rw-r--r-- | src/gui/newdirdialog.inc | 2 | ||||
-rw-r--r-- | src/gui/promptuserdialog.inc | 2 | ||||
-rw-r--r-- | src/gui/selectdirdialog.inc | 14 |
5 files changed, 33 insertions, 11 deletions
diff --git a/src/gui/fpg_dialogs.pas b/src/gui/fpg_dialogs.pas index d6059e9b..36be0454 100644 --- a/src/gui/fpg_dialogs.pas +++ b/src/gui/fpg_dialogs.pas @@ -46,7 +46,8 @@ uses fpg_grid, fpg_combobox, fpg_panel, - fpg_memo; + fpg_memo, + fpg_tree; type TfpgMsgDlgType = (mtAbout, mtWarning, mtError, mtInformation, mtConfirmation, @@ -207,9 +208,8 @@ procedure ShowMessage(AMessage, ATitle: string; ACentreText: Boolean = False); o procedure ShowMessage(AMessage: string; ACentreText: Boolean = False); overload; function SelectFontDialog(var FontDesc: string): boolean; - -function SelectFileDialog(aDialogType: boolean = sfdOpen; - const aFilter: TfpgString = ''): TfpgString; +function SelectFileDialog(const ADialogType: boolean = sfdOpen; const AFilter: TfpgString = ''): TfpgString; +function SelectDirDialog(const AStartDir: TfpgString = ''): TfpgString; implementation @@ -345,8 +345,7 @@ begin frm.Free; end; -function SelectFileDialog(aDialogType: boolean = sfdOpen; - const aFilter: TfpgString = ''): TfpgString; +function SelectFileDialog(const ADialogType: boolean = sfdOpen; const AFilter: TfpgString = ''): TfpgString; var dlg: TfpgFileDialog; dres: boolean; @@ -374,6 +373,19 @@ begin end; end; +function SelectDirDialog(const AStartDir: TfpgString): TfpgString; +var + dlg: TfpgSelectDirDialog; +begin + dlg := TfpgSelectDirDialog.Create(nil); + try + dlg.ShowModal; + Result := ''; + finally + dlg.Free; + end; +end; + { TfpgMessageBox } procedure TfpgMessageBox.HandleKeyPress(var keycode: word; diff --git a/src/gui/messagedialog.inc b/src/gui/messagedialog.inc index 82aeb97e..235b3c22 100644 --- a/src/gui/messagedialog.inc +++ b/src/gui/messagedialog.inc @@ -1,4 +1,4 @@ -{%mainunit gui_dialogs.pas} +{%mainunit fpg_dialogs.pas} {$IFDEF read_interface} diff --git a/src/gui/newdirdialog.inc b/src/gui/newdirdialog.inc index 0999e2ae..4c8be8e5 100644 --- a/src/gui/newdirdialog.inc +++ b/src/gui/newdirdialog.inc @@ -1,5 +1,5 @@ -{%mainunit gui_dialogs.pas} +{%mainunit fpg_dialogs.pas} {$IFDEF read_interface} diff --git a/src/gui/promptuserdialog.inc b/src/gui/promptuserdialog.inc index 14124d54..a2f14685 100644 --- a/src/gui/promptuserdialog.inc +++ b/src/gui/promptuserdialog.inc @@ -1,4 +1,4 @@ -{%mainunit gui_dialogs.pas} +{%mainunit fpg_dialogs.pas} {$IFDEF read_interface} diff --git a/src/gui/selectdirdialog.inc b/src/gui/selectdirdialog.inc index 2d4305b8..3541a935 100644 --- a/src/gui/selectdirdialog.inc +++ b/src/gui/selectdirdialog.inc @@ -1,4 +1,4 @@ -{%mainunit gui_dialogs.pas} +{%mainunit fpg_dialogs.pas} {$IFDEF read_interface} @@ -9,6 +9,7 @@ private lblTitle: TfpgLabel; edDirectory: TfpgEdit; + tv: TfpgTreeView; function GetDirectory: TfpgString; public constructor Create(AOwner: TComponent); override; @@ -30,6 +31,16 @@ end; constructor TfpgSelectDirDialog.Create(AOwner: TComponent); begin inherited Create(AOwner); + lblTitle := CreateLabel(self, 8, 8, rsEnterNewDirectory); + edDirectory := CreateEdit(self, 8, 28, 270, 0); + edDirectory.Anchors := [anLeft, anTop, anRight]; + + tv := TfpgTreeView.Create(self); + with tv do + begin + Name := 'tv'; + SetPosition(8, 28, 270, 250); + end; // reposition buttons btnCancel.Left := Width-FDefaultButtonWidth-FSpacing; @@ -41,7 +52,6 @@ begin edDirectory.TabOrder := 1; btnOK.TabOrder := 2; btnCancel.TabOrder := 3; - end; {$ENDIF read_implementation} |