Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pynxc/waxy/multichoicedialog.py
blob: e0ec608b60aa8d3af200962d88172bb61a50e957 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import wx
import waxyobject
from font import Font

# would be nice with a select all or something

class MultiChoiceDialog(wx.MultiChoiceDialog, waxyobject.WaxyObject):

    def __init__(self, parent,lst,text='Choose',title='Multi Choice Dialog'):
        wx.MultiChoiceDialog.__init__(self, parent,text,title,lst)

        self.lst=lst
        
    def ShowModal(self):
        """ Simplified ShowModal(), returning strings 'ok' or 'cancel'. """
        result = wx.MultiChoiceDialog.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