X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1fded56b375bf7a4687af1cdb182899614c1b2a8..ca6c45b23dd2a583dabbf8567f23657d310eb0b0:/wxPython/demo/wxMultipleChoiceDialog.py?ds=sidebyside diff --git a/wxPython/demo/wxMultipleChoiceDialog.py b/wxPython/demo/wxMultipleChoiceDialog.py index c7f93764e1..e354d28070 100644 --- a/wxPython/demo/wxMultipleChoiceDialog.py +++ b/wxPython/demo/wxMultipleChoiceDialog.py @@ -1,34 +1,90 @@ - -from wxPython.wx import * -from wxPython.lib.dialogs import wxMultipleChoiceDialog +# 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o Updated for wx namespace +# +# 11/30/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wx renamer not applied to lib. +# +# 12/18/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxMultipleChoiceDialog -> MultipleChoiceDialog +# + +import wx +import wx.lib.dialogs #--------------------------------------------------------------------------- def runTest(frame, nb, log): lst = [ 'apple', 'pear', 'banana', 'coconut', 'orange', 'etc', 'etc..', 'etc...' ] - dlg = wxMultipleChoiceDialog(frame, - "Pick some from\n this list\nblah blah...", - "m.s.d.", lst) - if (dlg.ShowModal() == wxID_OK): + + dlg = wx.lib.dialogs.MultipleChoiceDialog( + frame, + "Pick some from\n this list\nblah blah...", + "m.s.d.", lst) + + if (dlg.ShowModal() == wx.ID_OK): print "Selection:", dlg.GetValue(), " -> ", dlg.GetValueString() #--------------------------------------------------------------------------- +overview = """\ + + +This is a Python implementation of a dialog that is not yet implemented in wxWindows +proper, so don't let the wxWindows documentation mislead you. +

MultipleChoiceDialog(self, parent, msg, title, lst, +pos = wx.wxDefaultPosition, size = (200,200), style = wx.wxDEFAULT_DIALOG_STYLE) + +

+
parent +
The parent window +
msg +
The message that will be displayed above the list +
title +
The text that will appear on the title bar -overview = """\ -""" +
lst +
A Python list of choices that will appear in the dialog. + +
pos +
The position of the dialog +
size +
The size of the dialog +
style +
The style for the dialog. Only styles normally available to wxDialog are +available. +
+Methods + +
+
GetValue +
Returns a tuple containing the indices of the selected items + +
GetValueString +
Returns a tuple containing the text of the selected items + +
+ +Additionally, MultipleChoiceDialog.lbox is a standard wx.ListBox which supports all +methods applicable to that class. + + + +""" if __name__ == '__main__': import sys,os