]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/wxFileDialog.py
Warning fixes (still does not compile).
[wxWidgets.git] / wxPython / demo / wxFileDialog.py
index 476efcf8bdcbf9b88ef5d58a8cf50530a6f2f4ad..a87dc1719476d11f74caa8021bd0b6bca3f5c8cf 100644 (file)
@@ -1,13 +1,26 @@
 
 from wxPython.wx import *
+import os
 
 #---------------------------------------------------------------------------
 
+wildcard = "Python source (*.py)|*.py|" \
+           "Compiled Python (*.pyc)|*.pyc|" \
+           "All files (*.*)|*.*"
+
 def runTest(frame, nb, log):
-    dlg = wxFileDialog(frame, "Choose a file", ".", "", "*.*", wxOPEN|wxMULTIPLE)
+    log.WriteText("CWD: %s\n" % os.getcwd())
+    dlg = wxFileDialog(frame, "Choose a file", os.getcwd(), "", wildcard,
+                       wxOPEN
+                       | wxMULTIPLE
+                       #| wxCHANGE_DIR
+                       )
     if dlg.ShowModal() == wxID_OK:
-        for path in dlg.GetPaths():
-            log.WriteText('You selected: %s\n' % path)
+        paths = dlg.GetPaths()
+        log.WriteText('You selected %d files:' % len(paths))
+        for path in paths:
+            log.WriteText('           %s\n' % path)
+    log.WriteText("CWD: %s\n" % os.getcwd())
     dlg.Destroy()
 
 #---------------------------------------------------------------------------
@@ -18,46 +31,14 @@ def runTest(frame, nb, log):
 
 
 
-
-
-
-
-
-
-
 overview = """\
-This class represents the file chooser dialog.
-
-wxFileDialog()
-----------------------------
-
-wxFileDialog(wxWindow* parent, const wxString& message = "Choose a file", const wxString& defaultDir = ""
-, const wxString& defaultFile = "", const wxString& wildcard = "*.*", long style = 0, const wxPoint& pos = wxDefaultPosition)
-
-Constructor. Use wxFileDialog::ShowModal to show the dialog.
+This class provides the file chooser dialog.
 
-Parameters
--------------------
-
-parent = Parent window.
-
-message = Message to show on the dialog.
-
-defaultDir = The default directory, or the empty string.
-
-defaultFile = The default filename, or the empty string.
-
-wildcard = A wildcard, such as "*.*".
-
-style = A dialog style. A bitlist of:
-
-wxOPEN This is an open dialog (Windows only).
-
-wxSAVE This is a save dialog (Windows only).
+"""
 
-wxHIDE_READONLY        Hide read-only files (Windows only).
 
-wxOVERWRITE_PROMPT     Prompt for a conformation if a file will be overridden (Windows only).
+if __name__ == '__main__':
+    import sys,os
+    import run
+    run.main(['', os.path.basename(sys.argv[0])])
 
-pos = Dialog position.
-"""