]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/wxMultipleChoiceDialog.py
New wxDesigner-less version of the MimeTypesManager demo
[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#
33785d9f
RD
9# 12/18/2003 - Jeff Grimmett (grimmtooth@softhome.net)
10#
11# o wxMultipleChoiceDialog -> MultipleChoiceDialog
12#
8fa876ca
RD
13
14import wx
33785d9f 15import wx.lib.dialogs
cf694132
RD
16
17#---------------------------------------------------------------------------
18
19def runTest(frame, nb, log):
20 lst = [ 'apple', 'pear', 'banana', 'coconut', 'orange',
21 'etc', 'etc..', 'etc...' ]
8fa876ca 22
33785d9f
RD
23 dlg = wx.lib.dialogs.MultipleChoiceDialog(
24 frame,
25 "Pick some from\n this list\nblah blah...",
26 "m.s.d.", lst)
8fa876ca
RD
27
28 if (dlg.ShowModal() == wx.ID_OK):
cf694132
RD
29 print "Selection:", dlg.GetValue(), " -> ", dlg.GetValueString()
30
31#---------------------------------------------------------------------------
32
33
34
8fa876ca
RD
35overview = """\
36<html>
37<body>
cf694132 38
8fa876ca
RD
39This is a Python implementation of a dialog that is not yet implemented in wxWindows
40proper, so don't let the wxWindows documentation mislead you.
cf694132 41
33785d9f 42<p><code><b>MultipleChoiceDialog</b>(self, parent, msg, title, lst,
8fa876ca
RD
43pos = wx.wxDefaultPosition, size = (200,200), style = wx.wxDEFAULT_DIALOG_STYLE)
44</code>
cf694132 45
8fa876ca
RD
46<dl>
47<dt><code>parent</code>
48<dd>The parent window
cf694132 49
8fa876ca
RD
50<dt><code>msg</code>
51<dd>The message that will be displayed above the list
cf694132 52
8fa876ca
RD
53<dt><code>title</code>
54<dd>The text that will appear on the title bar
cf694132 55
8fa876ca
RD
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
1fded56b 61
8fa876ca
RD
62<dt><code>size</code>
63<dd>The size of the dialog
1fded56b 64
8fa876ca
RD
65<dt><code>style</code>
66<dd>The style for the dialog. Only styles normally available to wxDialog are
67available.
1fded56b 68
8fa876ca 69</dl>
1fded56b 70
8fa876ca
RD
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
33785d9f 82Additionally, MultipleChoiceDialog.lbox is a standard wx.ListBox which supports all
8fa876ca
RD
83methods applicable to that class.
84
85</body>
86</html>
87"""
1fded56b
RD
88
89if __name__ == '__main__':
90 import sys,os
91 import run
92 run.main(['', os.path.basename(sys.argv[0])])