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