]>
git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/demo/wxSingleChoiceDialog.py
2 from wxPython
. wx
import *
4 #---------------------------------------------------------------------------
6 def runTest ( frame
, nb
, log
):
7 dlg
= wxSingleChoiceDialog ( frame
, 'Test Single Choice' , 'The Caption' ,
8 [ 'zero' , 'one' , 'two' , 'three' , 'four' , 'five' ,
9 'six' , 'seven' , 'eight' ])
10 if dlg
. ShowModal () == wxID_OK
:
11 log
. WriteText ( 'You selected: %s \n ' % dlg
. GetStringSelection ())
14 #---------------------------------------------------------------------------
29 This class represents a dialog that shows a list of strings, and allows the user to select one. Double-clicking on a list item is equivalent to single-clicking and then pressing OK.
31 wxSingleChoiceDialog()
32 ---------------------------------------------
34 wxSingleChoiceDialog(wxWindow* parent, const wxString& message, const wxString& caption, int n, const wxString* choices, char** clientData = NULL, long style = wxOK | wxCANCEL | wxCENTRE, const wxPoint& pos = wxDefaultPosition)
36 Constructor, taking an array of wxString choices and optional client data.
41 parent = Parent window.
43 message = Message to show on the dialog.
45 caption = The dialog caption.
46 n = The number of choices.
48 choices = An array of strings, or a string list, containing the choices.
50 style = A dialog style (bitlist) containing flags chosen from the following:
52 wxOK Show an OK button.
54 wxCANCEL Show a Cancel button.
56 wxCENTRE Centre the message. Not Windows.
58 pos = Dialog position.