fixed a small file selection problem

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@19024 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Roman Rolinsky
2003-01-30 10:36:18 +00:00
parent 5db1613aae
commit 0b02859ebf

View File

@@ -670,12 +670,15 @@ class ParamFile(PPanel):
if self.textModified: # text has newer value
self.value = self.text.GetValue()
dlg = wxFileDialog(self,
defaultDir = os.path.dirname(self.value),
defaultDir = os.path.abspath(os.path.dirname(self.value)),
defaultFile = os.path.basename(self.value))
if dlg.ShowModal() == wxID_OK:
# Make relative
common = os.path.commonprefix([os.path.abspath(g.frame.dataFile),
dlg.GetPath()])
# Get common part of selected path and current
if g.frame.dataFile:
curpath = os.path.abspath(g.frame.dataFile)
else:
curpath = os.path.join(os.getcwd(), '')
common = os.path.commonprefix([curpath, dlg.GetPath()])
self.SetValue(dlg.GetPath()[len(common):])
self.SetModified()
self.textModified = false