]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxMultipleChoiceDialog.py
wxPython metadata xml
[wxWidgets.git] / wxPython / demo / wxMultipleChoiceDialog.py
1 # 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net)
2 #
3 # o Updated for wx namespace
4 #
5 # 11/30/2003 - Jeff Grimmett (grimmtooth@softhome.net)
6 #
7 # o wx renamer not applied to lib.
8 #
9 # 12/18/2003 - Jeff Grimmett (grimmtooth@softhome.net)
10 #
11 # o wxMultipleChoiceDialog -> MultipleChoiceDialog
12 #
13
14 import wx
15 import wx.lib.dialogs
16
17 #---------------------------------------------------------------------------
18
19 def runTest(frame, nb, log):
20 lst = [ 'apple', 'pear', 'banana', 'coconut', 'orange',
21 'etc', 'etc..', 'etc...' ]
22
23 dlg = wx.lib.dialogs.MultipleChoiceDialog(
24 frame,
25 "Pick some from\n this list\nblah blah...",
26 "m.s.d.", lst)
27
28 if (dlg.ShowModal() == wx.ID_OK):
29 print "Selection:", dlg.GetValue(), " -> ", dlg.GetValueString()
30
31 #---------------------------------------------------------------------------
32
33
34
35 overview = """\
36 <html>
37 <body>
38
39 This is a Python implementation of a dialog that is not yet implemented in wxWindows
40 proper, so don't let the wxWindows documentation mislead you.
41
42 <p><code><b>MultipleChoiceDialog</b>(self, parent, msg, title, lst,
43 pos = wx.wxDefaultPosition, size = (200,200), style = wx.wxDEFAULT_DIALOG_STYLE)
44 </code>
45
46 <dl>
47 <dt><code>parent</code>
48 <dd>The parent window
49
50 <dt><code>msg</code>
51 <dd>The message that will be displayed above the list
52
53 <dt><code>title</code>
54 <dd>The text that will appear on the title bar
55
56 <dt><code>lst</code>
57 <dd>A Python list of choices that will appear in the dialog.
58
59 <dt><code>pos</code>
60 <dd>The position of the dialog
61
62 <dt><code>size</code>
63 <dd>The size of the dialog
64
65 <dt><code>style</code>
66 <dd>The style for the dialog. Only styles normally available to wxDialog are
67 available.
68
69 </dl>
70
71 <b><font size=+1><code>Methods</code></font></b>
72
73 <dl>
74 <dt><code>GetValue</code>
75 <dd>Returns a tuple containing the indices of the selected items
76
77 <dt><code>GetValueString</code>
78 <dd>Returns a tuple containing the text of the selected items
79
80 </dl>
81
82 Additionally, MultipleChoiceDialog.lbox is a standard wx.ListBox which supports all
83 methods applicable to that class.
84
85 </body>
86 </html>
87 """
88
89 if __name__ == '__main__':
90 import sys,os
91 import run
92 run.main(['', os.path.basename(sys.argv[0])])