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