X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f0db4f38504f7bc01f7bc2474243a4f6f84152a7..685d898512944add00640b6e37da89159ee4d9b5:/wxPython/demo/wxMultipleChoiceDialog.py diff --git a/wxPython/demo/wxMultipleChoiceDialog.py b/wxPython/demo/wxMultipleChoiceDialog.py index 07fe583a3e..e354d28070 100644 --- a/wxPython/demo/wxMultipleChoiceDialog.py +++ b/wxPython/demo/wxMultipleChoiceDialog.py @@ -1,28 +1,92 @@ +# 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 +# -from wxPython.wx import * -from wxPython.lib.dialogs import wxMultipleChoiceDialog +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) - dlg.CenterOnScreen(wxBOTH) - 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 + import run + run.main(['', os.path.basename(sys.argv[0])])