diff options
Diffstat (limited to 'pynxc/waxy/filedialog.py~')
-rw-r--r-- | pynxc/waxy/filedialog.py~ | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/pynxc/waxy/filedialog.py~ b/pynxc/waxy/filedialog.py~ new file mode 100644 index 0000000..2bfd2b6 --- /dev/null +++ b/pynxc/waxy/filedialog.py~ @@ -0,0 +1,35 @@ +# filedialog.py + +import wx +import waxyobject + +class FileDialog(wx.FileDialog, waxyobject.WaxyObject): + + def __init__(self, parent, title="Choose a file", default_dir="", + default_file="", wildcard="*.*", open=0, save=0, multiple=0): + style = 0 + if open: + style |= wx.OPEN + elif save: + style |= wx.SAVE + if multiple: + style |= wx.MULTIPLE + + self.multiple=multiple + + wx.FileDialog.__init__(self, parent, title, default_dir, default_file, + wildcard, style) + + def ShowModal(self): + """ Simplified ShowModal(), returning strings 'ok' or 'cancel'. """ + result = wx.FileDialog.ShowModal(self) + if result == wx.ID_OK: + return 'ok' + else: + return 'cancel' + + + def GetChosenFile(self): + """ Shorthand... """ + data = self.GetPaths() + return data |