]>
Commit | Line | Data |
---|---|---|
8fa876ca RD |
1 | |
2 | import wx | |
33785d9f | 3 | import wx.lib.dialogs |
cf694132 RD |
4 | |
5 | #--------------------------------------------------------------------------- | |
6 | ||
7 | def runTest(frame, nb, log): | |
8 | lst = [ 'apple', 'pear', 'banana', 'coconut', 'orange', | |
9 | 'etc', 'etc..', 'etc...' ] | |
8fa876ca | 10 | |
33785d9f RD |
11 | dlg = wx.lib.dialogs.MultipleChoiceDialog( |
12 | frame, | |
13 | "Pick some from\n this list\nblah blah...", | |
14 | "m.s.d.", lst) | |
8fa876ca RD |
15 | |
16 | if (dlg.ShowModal() == wx.ID_OK): | |
da65a439 RD |
17 | log.write("Selection: %s -> %s\n" % (dlg.GetValue(), dlg.GetValueString())) |
18 | ||
19 | dlg.Destroy() | |
cf694132 RD |
20 | |
21 | #--------------------------------------------------------------------------- | |
22 | ||
23 | ||
24 | ||
8fa876ca RD |
25 | overview = """\ |
26 | <html> | |
27 | <body> | |
cf694132 | 28 | |
8fa876ca RD |
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. | |
cf694132 | 31 | |
33785d9f | 32 | <p><code><b>MultipleChoiceDialog</b>(self, parent, msg, title, lst, |
95bfd958 | 33 | pos = wx.wxDefaultPosition, size = (200,200), style = wx.DEFAULT_DIALOG_STYLE) |
8fa876ca | 34 | </code> |
cf694132 | 35 | |
8fa876ca RD |
36 | <dl> |
37 | <dt><code>parent</code> | |
38 | <dd>The parent window | |
cf694132 | 39 | |
8fa876ca RD |
40 | <dt><code>msg</code> |
41 | <dd>The message that will be displayed above the list | |
cf694132 | 42 | |
8fa876ca RD |
43 | <dt><code>title</code> |
44 | <dd>The text that will appear on the title bar | |
cf694132 | 45 | |
8fa876ca RD |
46 | <dt><code>lst</code> |
47 | <dd>A Python list of choices that will appear in the dialog. | |
48 | ||
49 | <dt><code>pos</code> | |
50 | <dd>The position of the dialog | |
1fded56b | 51 | |
8fa876ca RD |
52 | <dt><code>size</code> |
53 | <dd>The size of the dialog | |
1fded56b | 54 | |
8fa876ca RD |
55 | <dt><code>style</code> |
56 | <dd>The style for the dialog. Only styles normally available to wxDialog are | |
57 | available. | |
1fded56b | 58 | |
8fa876ca | 59 | </dl> |
1fded56b | 60 | |
8fa876ca RD |
61 | <b><font size=+1><code>Methods</code></font></b> |
62 | ||
63 | <dl> | |
64 | <dt><code>GetValue</code> | |
65 | <dd>Returns a tuple containing the indices of the selected items | |
66 | ||
67 | <dt><code>GetValueString</code> | |
68 | <dd>Returns a tuple containing the text of the selected items | |
69 | ||
70 | </dl> | |
71 | ||
33785d9f | 72 | Additionally, MultipleChoiceDialog.lbox is a standard wx.ListBox which supports all |
8fa876ca RD |
73 | methods applicable to that class. |
74 | ||
75 | </body> | |
76 | </html> | |
77 | """ | |
1fded56b RD |
78 | |
79 | if __name__ == '__main__': | |
80 | import sys,os | |
81 | import run | |
8eca4fef | 82 | run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:]) |