]> git.saurik.com Git - wxWidgets.git/blame_incremental - wxPython/demo/MultipleChoiceDialog.py
default style for statusbars varies by platform
[wxWidgets.git] / wxPython / demo / MultipleChoiceDialog.py
... / ...
CommitLineData
1
2import wx
3import wx.lib.dialogs
4
5#---------------------------------------------------------------------------
6
7def 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
23overview = """\
24<html>
25<body>
26
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.
29
30<p><code><b>MultipleChoiceDialog</b>(self, parent, msg, title, lst,
31pos = 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
55available.
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
70Additionally, MultipleChoiceDialog.lbox is a standard wx.ListBox which supports all
71methods applicable to that class.
72
73</body>
74</html>
75"""
76
77if __name__ == '__main__':
78 import sys,os
79 import run
80 run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])