diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2009-01-14 08:16:02 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2009-01-14 08:16:02 +0000 |
commit | 5cafb41e20578ccbd15489c876e986f01b8f4fc6 (patch) | |
tree | 24c4fc6ff62a91194dcd7f29a32f760019e97254 /src/corelib/fpg_utils.pas | |
parent | 1991b86c925074dd7f2d7dd93f5fbd0c4aabcc0e (diff) | |
download | fpGUI-5cafb41e20578ccbd15489c876e986f01b8f4fc6.tar.xz |
* new methods added to fpg_utils unit.
* Select Dir Dialog can already display some directories, but still far from complete.
Diffstat (limited to 'src/corelib/fpg_utils.pas')
-rw-r--r-- | src/corelib/fpg_utils.pas | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/corelib/fpg_utils.pas b/src/corelib/fpg_utils.pas index 7d5871c9..603ecca9 100644 --- a/src/corelib/fpg_utils.pas +++ b/src/corelib/fpg_utils.pas @@ -34,6 +34,9 @@ procedure fpgOpenURL(const aURL: TfpgString); // *** Common functions for all platforms *** function fpgAddTrailingValue(const ALine, AValue: TfpgString; ADuplicates: boolean = true): TfpgString; +function fpgAppendPathDelim(const Path: TfpgString): TfpgString; +function fpgHasSubDirs(const Dir: TfpgString; AShowHidden: Boolean): Boolean; +function fpgAllFilesMask: TfpgString; // RTL wrapper filesystem functions with platform independant encoding @@ -45,8 +48,6 @@ function fpgGetCurrentDir: TfpgString; function fpgSetCurrentDir(const NewDir: TfpgString): Boolean; function fpgExpandFileName(const FileName: TfpgString): TfpgString; function fpgFileExists(const FileName: TfpgString): Boolean; -function fpgAppendPathDelim(const Path: TfpgString): TfpgString; -function fpgHasSubDirs(const Dir: TfpgString; AShowHidden: Boolean): Boolean; implementation @@ -131,7 +132,7 @@ begin if Dir <> '' then begin FCurrentDir := fpgAppendPathDelim(Dir); - FCurrentDir := FCurrentDir + AllFilesMask; + FCurrentDir := FCurrentDir + fpgAllFilesMask; try if fpgFindFirst(FCurrentDir, faAnyFile or $00000080, FileInfo) = 0 then repeat @@ -158,6 +159,15 @@ begin end; end; +function fpgAllFilesMask: TfpgString; +begin + {$Note In FPC 2.2.2 onwards we can use AllFilesMask which is part of RTL } + {$IFDEF WINDOWS} + Result := '*.*'; + {$ELSE} + Result := '*'; + {$ENDIF} +end; end. |