]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/MultipleChoiceDialog.py
5 #---------------------------------------------------------------------------
7 def runTest(frame
, nb
, log
):
8 lst
= [ 'apple', 'pear', 'banana', 'coconut', 'orange',
9 'etc', 'etc..', 'etc...' ]
11 dlg
= wx
.lib
.dialogs
.MultipleChoiceDialog(
13 "Pick some from\n this list\nblah blah...",
16 if (dlg
.ShowModal() == wx
.ID_OK
):
17 log
.write("Selection: %s -> %s\n" % (dlg
.GetValue(), dlg
.GetValueString()))
21 #---------------------------------------------------------------------------
29 This is a Python implementation of a dialog that is not yet implemented in wxWindows
30 proper, so don't let the wxWindows documentation mislead you.
32 <p><code><b>MultipleChoiceDialog</b>(self, parent, msg, title, lst,
33 pos = wx.wxDefaultPosition, size = (200,200), style = wx.DEFAULT_DIALOG_STYLE)
37 <dt><code>parent</code>
41 <dd>The message that will be displayed above the list
43 <dt><code>title</code>
44 <dd>The text that will appear on the title bar
47 <dd>A Python list of choices that will appear in the dialog.
50 <dd>The position of the dialog
53 <dd>The size of the dialog
55 <dt><code>style</code>
56 <dd>The style for the dialog. Only styles normally available to wxDialog are
61 <b><font size=+1><code>Methods</code></font></b>
64 <dt><code>GetValue</code>
65 <dd>Returns a tuple containing the indices of the selected items
67 <dt><code>GetValueString</code>
68 <dd>Returns a tuple containing the text of the selected items
72 Additionally, MultipleChoiceDialog.lbox is a standard wx.ListBox which supports all
73 methods applicable to that class.
79 if __name__
== '__main__':
82 run
.main(['', os
.path
.basename(sys
.argv
[0])] + sys
.argv
[1:])