1999-04-29 23:29:54 -04:00
|
|
|
|
|
|
|
from wxPython.wx import *
|
2003-07-02 19:13:10 -04:00
|
|
|
import os
|
1999-04-29 23:29:54 -04:00
|
|
|
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
|
2002-08-13 19:59:08 -04:00
|
|
|
wildcard = "Python source (*.py)|*.py|" \
|
|
|
|
"Compiled Python (*.pyc)|*.pyc|" \
|
|
|
|
"All files (*.*)|*.*"
|
|
|
|
|
1999-04-29 23:29:54 -04:00
|
|
|
def runTest(frame, nb, log):
|
2003-07-02 19:13:10 -04:00
|
|
|
log.WriteText("CWD: %s\n" % os.getcwd())
|
|
|
|
dlg = wxFileDialog(frame, "Choose a file", os.getcwd(), "", wildcard,
|
|
|
|
wxOPEN
|
|
|
|
| wxMULTIPLE
|
|
|
|
#| wxCHANGE_DIR
|
|
|
|
)
|
1999-04-29 23:29:54 -04:00
|
|
|
if dlg.ShowModal() == wxID_OK:
|
2003-03-25 01:35:27 -05:00
|
|
|
paths = dlg.GetPaths()
|
|
|
|
log.WriteText('You selected %d files:' % len(paths))
|
|
|
|
for path in paths:
|
|
|
|
log.WriteText(' %s\n' % path)
|
2003-07-02 19:13:10 -04:00
|
|
|
log.WriteText("CWD: %s\n" % os.getcwd())
|
1999-04-29 23:29:54 -04:00
|
|
|
dlg.Destroy()
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2003-07-02 19:13:10 -04:00
|
|
|
overview = """\
|
|
|
|
This class provides the file chooser dialog.
|
1999-04-29 23:29:54 -04:00
|
|
|
|
2003-07-02 19:13:10 -04:00
|
|
|
"""
|
1999-04-29 23:29:54 -04:00
|
|
|
|
|
|
|
|
2003-07-02 19:13:10 -04:00
|
|
|
if __name__ == '__main__':
|
|
|
|
import sys,os
|
|
|
|
import run
|
|
|
|
run.main(['', os.path.basename(sys.argv[0])])
|
1999-04-29 23:29:54 -04:00
|
|
|
|