diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-03-14 12:24:19 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-03-14 12:24:19 +0000 |
commit | ac9f0769fc3e837c82ad07c16a1d16d2dc180f1d (patch) | |
tree | b4d9a81be44b1d09fb71b7f194be590148c5c78d /src/corelib/gdi | |
parent | 777cd7fe27ccbbffb69519829442a03e9c28d2d4 (diff) | |
download | fpGUI-ac9f0769fc3e837c82ad07c16a1d16d2dc180f1d.tar.xz |
* Applied various patch from Vladimir which implements locale file encoding support and improves the file dialog.
Diffstat (limited to 'src/corelib/gdi')
-rw-r--r-- | src/corelib/gdi/gfx_gdi.pas | 18 | ||||
-rw-r--r-- | src/corelib/gdi/gfx_utils_impl.inc | 33 |
2 files changed, 36 insertions, 15 deletions
diff --git a/src/corelib/gdi/gfx_gdi.pas b/src/corelib/gdi/gfx_gdi.pas index b198fa24..41505413 100644 --- a/src/corelib/gdi/gfx_gdi.pas +++ b/src/corelib/gdi/gfx_gdi.pas @@ -210,8 +210,7 @@ type { TfpgFileListImpl } TfpgFileListImpl = class(TfpgFileListBase) - function InitializeEntry(sr: TSearchRec): TFileEntry; override; - function UpdateDirectory(const aDirectory: TfpgString): TfpgString; override; + procedure PopulateSpecialDirs(const aDirectory: TfpgString); override; end; implementation @@ -1999,18 +1998,7 @@ end; { TfpgFileListImpl } -function TfpgFileListImpl.InitializeEntry(sr: TSearchRec): TFileEntry; -begin - Result := inherited InitializeEntry(sr); - if Assigned(Result) then - begin - Result.Name := UTF8Encode(Result.Name); - Result.Extention := UTF8Encode(Result.Extention); - end; -end; - -function TfpgFileListImpl.UpdateDirectory(const aDirectory: TfpgString - ): TfpgString; +procedure TfpgFileListImpl.PopulateSpecialDirs(const aDirectory: TfpgString); var n: integer; drvs: string; @@ -2035,7 +2023,7 @@ begin end; end; - Result := inherited UpdateDirectory(aDirectory); + inherited PopulateSpecialDirs(aDirectory); end; initialization diff --git a/src/corelib/gdi/gfx_utils_impl.inc b/src/corelib/gdi/gfx_utils_impl.inc index f9ee80b3..2597d977 100644 --- a/src/corelib/gdi/gfx_utils_impl.inc +++ b/src/corelib/gdi/gfx_utils_impl.inc @@ -2,5 +2,38 @@ // GDI specific implementations of RTL wrapper functions +function fpgFindFirst(const Path: TfpgString; Attr: Longint; out + Rslt: TSearchRec): Longint; +begin + Result := FindFirst(Utf8ToAnsi(Path), Attr, Rslt); + Rslt.Name := AnsiToUtf8(Rslt.Name); +end; + +function fpgFindNext(var Rslt: TSearchRec): Longint; +begin + Result := FindNext(Rslt); + Rslt.Name := AnsiToUtf8(Rslt.Name); +end; + +function fpgGetCurrentDir: TfpgString; +begin + Result := AnsiToUtf8(GetCurrentDir); +end; + +function fpgSetCurrentDir(const NewDir: TfpgString): Boolean; +begin + Result := SetCurrentDir(Utf8ToAnsi(NewDir)); +end; + +function fpgExpandFileName(const FileName: TfpgString): TfpgString; +begin + Result := AnsiToUtf8(ExpandFileName(Utf8ToAnsi(FileName))); +end; + +function fpgFileExists(const FileName: TfpgString): Boolean; +begin + Result := FileExists(Utf8ToAnsi(FileName)); +end; + |