]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxMultipleChoiceDialog.py
Applied patch [ 827011 ] Event-based processing of item tooltips in wxTreeCtrl
[wxWidgets.git] / wxPython / demo / wxMultipleChoiceDialog.py
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
10 import wx
11 import wx.lib.dialogs as dlgs
12
13 #---------------------------------------------------------------------------
14
15 def runTest(frame, nb, log):
16 lst = [ 'apple', 'pear', 'banana', 'coconut', 'orange',
17 'etc', 'etc..', 'etc...' ]
18
19 dlg = dlgs.wxMultipleChoiceDialog(frame,
20 "Pick some from\n this list\nblah blah...",
21 "m.s.d.", lst)
22
23 if (dlg.ShowModal() == wx.ID_OK):
24 print "Selection:", dlg.GetValue(), " -> ", dlg.GetValueString()
25
26 #---------------------------------------------------------------------------
27
28
29
30 overview = """\
31 <html>
32 <body>
33
34 This is a Python implementation of a dialog that is not yet implemented in wxWindows
35 proper, so don't let the wxWindows documentation mislead you.
36
37 <p><code><b>wxMultipleChoiceDialog</b>(self, parent, msg, title, lst,
38 pos = wx.wxDefaultPosition, size = (200,200), style = wx.wxDEFAULT_DIALOG_STYLE)
39 </code>
40
41 <dl>
42 <dt><code>parent</code>
43 <dd>The parent window
44
45 <dt><code>msg</code>
46 <dd>The message that will be displayed above the list
47
48 <dt><code>title</code>
49 <dd>The text that will appear on the title bar
50
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
56
57 <dt><code>size</code>
58 <dd>The size of the dialog
59
60 <dt><code>style</code>
61 <dd>The style for the dialog. Only styles normally available to wxDialog are
62 available.
63
64 </dl>
65
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
77 Additionally, wxMultipleChoiceDialog.lbox is a standard wxListBox which supports all
78 methods applicable to that class.
79
80 </body>
81 </html>
82 """
83
84 if __name__ == '__main__':
85 import sys,os
86 import run
87 run.main(['', os.path.basename(sys.argv[0])])