X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..6da1ce616686ad1dc03021aead77a048971279d3:/wxPython/demo/wxMultipleChoiceDialog.py diff --git a/wxPython/demo/wxMultipleChoiceDialog.py b/wxPython/demo/wxMultipleChoiceDialog.py index 6e3fb5de55..c2a0b6638a 100644 --- a/wxPython/demo/wxMultipleChoiceDialog.py +++ b/wxPython/demo/wxMultipleChoiceDialog.py @@ -1,27 +1,87 @@ +# 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. +# -from wxPython.wx import * -from wxPython.lib.dialogs import wxMultipleChoiceDialog +import wx +import wx.lib.dialogs as dlgs #--------------------------------------------------------------------------- def runTest(frame, nb, log): lst = [ 'apple', 'pear', 'banana', 'coconut', 'orange', 'etc', 'etc..', 'etc...' ] - dlg = wxMultipleChoiceDialog(frame, + + dlg = dlgs.wxMultipleChoiceDialog(frame, "Pick some from\n this list\nblah blah...", "m.s.d.", lst) - if (dlg.ShowModal() == wxID_OK): + + 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. +

wxMultipleChoiceDialog(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, wxMultipleChoiceDialog.lbox is a standard wxListBox which supports all +methods applicable to that class. + + + """ + +if __name__ == '__main__': + import sys,os + import run + run.main(['', os.path.basename(sys.argv[0])])