diff options
author | Jean-Marc <jean-marc.levecque@jmlesite.fr> | 2009-10-27 08:46:19 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2009-10-27 08:46:19 +0200 |
commit | 589a72ebf95a4a08b918df42b5c096fb301b9646 (patch) | |
tree | 32561a12b5f32b12b35716c7027118422f774855 /src/gui/fpg_dialogs.pas | |
parent | 0dc30eccdce9886160a6e2a5b3db5d08c08abde1 (diff) | |
download | fpGUI-589a72ebf95a4a08b918df42b5c096fb301b9646.tar.xz |
New property setting initial directory in the File Open/Save dialog.
Diffstat (limited to 'src/gui/fpg_dialogs.pas')
-rw-r--r-- | src/gui/fpg_dialogs.pas | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/fpg_dialogs.pas b/src/gui/fpg_dialogs.pas index 2ffc803b..41f675ab 100644 --- a/src/gui/fpg_dialogs.pas +++ b/src/gui/fpg_dialogs.pas @@ -159,10 +159,12 @@ type FOpenMode: boolean; FFilterList: TStringList; FFilter: string; + FInitialDir: string; procedure SetFilter(const Value: string); function GetFontDesc: string; function GetShowHidden: boolean; procedure SetFontDesc(const AValue: string); + procedure SetInitialDir(const AValue: string); procedure SetShowHidden(const Value: boolean); procedure ListChanged(Sender: TObject; ARow: Integer); procedure GridDblClicked(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); @@ -188,6 +190,7 @@ type function RunSaveFile: boolean; property Filter: string read FFilter write SetFilter; property FontDesc: string read GetFontDesc write SetFontDesc; + property InitialDir: string read FInitialDir write SetInitialDir; property ShowHidden: boolean read GetShowHidden write SetShowHidden; end; @@ -986,6 +989,15 @@ begin grid.FontDesc := AValue; end; +procedure TfpgFileDialog.SetInitialDir(const AValue: string); +begin + if FInitialDir <> AValue then + begin + FInitialDir := AValue; + SetCurrentDirectory(FInitialDir); + end; +end; + procedure TfpgFileDialog.SetShowHidden(const Value: boolean); begin btnShowHidden.Down := Value; |