summaryrefslogtreecommitdiff
path: root/src/corelib/gdi
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-03-12 13:05:58 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-03-12 13:05:58 +0000
commitd2e0a0849e139d4cdbf518751dd8d6611692533b (patch)
tree5c69924788e471b9a166f3224d0ac77dfa925b87 /src/corelib/gdi
parentfd0f20fe11c9d3d9865ff714c19bcfe0f6bab946 (diff)
downloadfpGUI-d2e0a0849e139d4cdbf518751dd8d6611692533b.tar.xz
* Applied a patch from Vladimir moving some code out of gui_grid.pas to gfxbase.pas and getting rid of some IFDEF's in the process.
Diffstat (limited to 'src/corelib/gdi')
-rw-r--r--src/corelib/gdi/gfx_gdi.pas49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/corelib/gdi/gfx_gdi.pas b/src/corelib/gdi/gfx_gdi.pas
index f284bb38..b198fa24 100644
--- a/src/corelib/gdi/gfx_gdi.pas
+++ b/src/corelib/gdi/gfx_gdi.pas
@@ -206,6 +206,14 @@ type
procedure InitClipboard; override;
end;
+
+ { TfpgFileListImpl }
+
+ TfpgFileListImpl = class(TfpgFileListBase)
+ function InitializeEntry(sr: TSearchRec): TFileEntry; override;
+ function UpdateDirectory(const aDirectory: TfpgString): TfpgString; override;
+ end;
+
implementation
uses
@@ -1989,6 +1997,47 @@ begin
);
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;
+var
+ n: integer;
+ drvs: string;
+begin
+ FSpecialDirs.Clear;
+
+ // making drive list
+ if Copy(aDirectory, 2, 1) = ':' then
+ begin
+ n := 0;
+ { TODO: replace 25 with a constant: max nested directories displayed }
+ while n <= 25 do
+ begin
+ drvs := chr(n+ord('A'))+':\';
+ if Windows.GetDriveType(PChar(drvs)) <> 1 then
+ begin
+ // vvzh: to avoid doubling of drive letters in inherited UpdateDirectory
+ if Pos(drvs, aDirectory) <> 1 then
+ FSpecialDirs.Add(drvs);
+ end;
+ inc(n);
+ end;
+ end;
+
+ Result := inherited UpdateDirectory(aDirectory);
+end;
+
initialization
wapplication := nil;
MouseFocusedWH := 0;