]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/MultipleChoiceDialog.py
Use Bind
[wxWidgets.git] / wxPython / demo / MultipleChoiceDialog.py
CommitLineData
8fa876ca
RD
1
2import wx
33785d9f 3import wx.lib.dialogs
cf694132
RD
4
5#---------------------------------------------------------------------------
6
7def runTest(frame, nb, log):
8 lst = [ 'apple', 'pear', 'banana', 'coconut', 'orange',
9 'etc', 'etc..', 'etc...' ]
8fa876ca 10
33785d9f
RD
11 dlg = wx.lib.dialogs.MultipleChoiceDialog(
12 frame,
13 "Pick some from\n this list\nblah blah...",
14 "m.s.d.", lst)
8fa876ca
RD
15
16 if (dlg.ShowModal() == wx.ID_OK):
cf694132
RD
17 print "Selection:", dlg.GetValue(), " -> ", dlg.GetValueString()
18
19#---------------------------------------------------------------------------
20
21
22
8fa876ca
RD
23overview = """\
24<html>
25<body>
cf694132 26
8fa876ca
RD
27This is a Python implementation of a dialog that is not yet implemented in wxWindows
28proper, so don't let the wxWindows documentation mislead you.
cf694132 29
33785d9f 30<p><code><b>MultipleChoiceDialog</b>(self, parent, msg, title, lst,
95bfd958 31pos = wx.wxDefaultPosition, size = (200,200), style = wx.DEFAULT_DIALOG_STYLE)
8fa876ca 32</code>
cf694132 33
8fa876ca
RD
34<dl>
35<dt><code>parent</code>
36<dd>The parent window
cf694132 37
8fa876ca
RD
38<dt><code>msg</code>
39<dd>The message that will be displayed above the list
cf694132 40
8fa876ca
RD
41<dt><code>title</code>
42<dd>The text that will appear on the title bar
cf694132 43
8fa876ca
RD
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
1fded56b 49
8fa876ca
RD
50<dt><code>size</code>
51<dd>The size of the dialog
1fded56b 52
8fa876ca
RD
53<dt><code>style</code>
54<dd>The style for the dialog. Only styles normally available to wxDialog are
55available.
1fded56b 56
8fa876ca 57</dl>
1fded56b 58
8fa876ca
RD
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
33785d9f 70Additionally, MultipleChoiceDialog.lbox is a standard wx.ListBox which supports all
8fa876ca
RD
71methods applicable to that class.
72
73</body>
74</html>
75"""
1fded56b
RD
76
77if __name__ == '__main__':
78 import sys,os
79 import run
80 run.main(['', os.path.basename(sys.argv[0])])