]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/MultipleChoiceDialog.py
1 # 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net)
3 # o Updated for wx namespace
5 # 11/30/2003 - Jeff Grimmett (grimmtooth@softhome.net)
7 # o wx renamer not applied to lib.
9 # 12/18/2003 - Jeff Grimmett (grimmtooth@softhome.net)
11 # o wxMultipleChoiceDialog -> MultipleChoiceDialog
17 #---------------------------------------------------------------------------
19 def runTest(frame
, nb
, log
):
20 lst
= [ 'apple', 'pear', 'banana', 'coconut', 'orange',
21 'etc', 'etc..', 'etc...' ]
23 dlg
= wx
.lib
.dialogs
.MultipleChoiceDialog(
25 "Pick some from\n this list\nblah blah...",
28 if (dlg
.ShowModal() == wx
.ID_OK
):
29 print "Selection:", dlg
.GetValue(), " -> ", dlg
.GetValueString()
31 #---------------------------------------------------------------------------
39 This is a Python implementation of a dialog that is not yet implemented in wxWindows
40 proper, so don't let the wxWindows documentation mislead you.
42 <p><code><b>MultipleChoiceDialog</b>(self, parent, msg, title, lst,
43 pos = wx.wxDefaultPosition, size = (200,200), style = wx.wxDEFAULT_DIALOG_STYLE)
47 <dt><code>parent</code>
51 <dd>The message that will be displayed above the list
53 <dt><code>title</code>
54 <dd>The text that will appear on the title bar
57 <dd>A Python list of choices that will appear in the dialog.
60 <dd>The position of the dialog
63 <dd>The size of the dialog
65 <dt><code>style</code>
66 <dd>The style for the dialog. Only styles normally available to wxDialog are
71 <b><font size=+1><code>Methods</code></font></b>
74 <dt><code>GetValue</code>
75 <dd>Returns a tuple containing the indices of the selected items
77 <dt><code>GetValueString</code>
78 <dd>Returns a tuple containing the text of the selected items
82 Additionally, MultipleChoiceDialog.lbox is a standard wx.ListBox which supports all
83 methods applicable to that class.
89 if __name__
== '__main__':
92 run
.main(['', os
.path
.basename(sys
.argv
[0])])