Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pynxc/waxy/singlechoicedialog.py~
diff options
context:
space:
mode:
Diffstat (limited to 'pynxc/waxy/singlechoicedialog.py~')
-rw-r--r--pynxc/waxy/singlechoicedialog.py~29
1 files changed, 29 insertions, 0 deletions
diff --git a/pynxc/waxy/singlechoicedialog.py~ b/pynxc/waxy/singlechoicedialog.py~
new file mode 100644
index 0000000..2941dbc
--- /dev/null
+++ b/pynxc/waxy/singlechoicedialog.py~
@@ -0,0 +1,29 @@
+import wx
+import waxyobject
+from font import Font
+
+# would be nice with a select all or something
+
+class SingleChoiceDialog(wx.SingleChoiceDialog, waxyobject.WaxyObject):
+
+ def __init__(self, parent,lst,text='Choose',title='Single Choice Dialog'):
+ wx.SingleChoiceDialog.__init__(self, parent,text,title,lst)
+
+ self.lst=lst
+
+ def ShowModal(self):
+ """ Simplified ShowModal(), returning strings 'ok' or 'cancel'. """
+ result = wx.SingleChoiceDialog.ShowModal(self)
+ if result == wx.ID_OK:
+ return 'ok'
+ else:
+ return 'cancel'
+
+ def GetChosenItems(self):
+ selections = self.GetSelections()
+ strings = [self.lst[x] for x in selections]
+
+ return strings
+
+
+