diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-03-19 13:57:35 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-03-19 13:57:35 +0200 |
commit | 2e5e0b34db113e177bf5994ff7a6e2cbcd1d339e (patch) | |
tree | ccf163477cb0736057a474f2c51a50579c25adef | |
parent | fba3c63cc06de9dc83f4f8a70c92762b6d404fa9 (diff) | |
download | fpGUI-2e5e0b34db113e177bf5994ff7a6e2cbcd1d339e.tar.xz |
SelectDir dialog: Fixed various issues in the dialog.
* Removed duplicate / char under Linux
* Fixed directory selection under Windows - this was totally broken.
Thanks to Jean-Pierre ANGHEL <jp.anghel@bbox.fr> for some support
on this and bringing it to my attention.
-rw-r--r-- | src/gui/selectdirdialog.inc | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/gui/selectdirdialog.inc b/src/gui/selectdirdialog.inc index 35bafff6..6415fde9 100644 --- a/src/gui/selectdirdialog.inc +++ b/src/gui/selectdirdialog.inc @@ -35,16 +35,30 @@ {$IFDEF read_implementation} function TfpgSelectDirDialog.GetAbsolutePath(Node: TfpgTreeNode): TfpgString; +var + lResult: TfpgString; begin - Result := ''; + lResult := ''; while Node <> nil do begin - if Node.Text = PathDelim then - Result := Node.Text + Result - else - Result := Node.Text + PathDelim + Result; + {$IFDEF UNIX} + if (Node.Text = PathDelim) then + lResult := Node.Text + lResult + else if (Node.Text <> '') then + lResult := Node.Text + PathDelim + lResult; + {$ENDIF} + {$IFDEF MSWINDOWS} + if (Node.Text <> '') then + begin + if (Node.Text[Length(Node.Text)] = PathDelim) then + lResult := Node.Text + lResult + else + lResult := Node.Text + PathDelim + lResult; + end; + {$ENDIF} Node := Node.Parent; end; + Result := lResult; end; procedure TfpgSelectDirDialog.InitializeTreeview; |