diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-09-21 10:37:38 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-09-21 10:37:38 +0200 |
commit | 4ec763879192e974164252221e1cf862d52a9a07 (patch) | |
tree | 60de7ddefe8b8f365730f520e516d23053cfbe1d | |
parent | 7068049fc6ae217a65bb13527a1be7ef2aece3f2 (diff) | |
download | fpGUI-4ec763879192e974164252221e1cf862d52a9a07.tar.xz |
SelectFileDialog() can now specify the initial directory too.
-rw-r--r-- | src/gui/fpg_dialogs.pas | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/fpg_dialogs.pas b/src/gui/fpg_dialogs.pas index 62198263..b66f740f 100644 --- a/src/gui/fpg_dialogs.pas +++ b/src/gui/fpg_dialogs.pas @@ -235,7 +235,7 @@ 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(const ADialogType: boolean = sfdOpen; const AFilter: TfpgString = ''): TfpgString; +function SelectFileDialog(const ADialogType: boolean = sfdOpen; const AFilter: TfpgString = ''; const AInitialDir: TfpgString = ''): TfpgString; function SelectDirDialog(const AStartDir: TfpgString = ''): TfpgString; function fpgShowCharMap: TfpgString; function fpgSelectColorDialog(APresetColor: TfpgColor = clBlack): TfpgColor; @@ -375,7 +375,7 @@ begin frm.Free; end; -function SelectFileDialog(const ADialogType: boolean = sfdOpen; const AFilter: TfpgString = ''): TfpgString; +function SelectFileDialog(const ADialogType: boolean = sfdOpen; const AFilter: TfpgString = ''; const AInitialDir: TfpgString = ''): TfpgString; var dlg: TfpgFileDialog; dres: boolean; @@ -389,6 +389,9 @@ begin else dlg.Filter := aFilter+'|'+DefaultFilter; + if AInitialDir <> '' then + dlg.InitialDir := AInitialDir; + if aDialogType = sfdOpen then dres := dlg.RunOpenFile else |