1 /////////////////////////////////////////////////////////////////////////////
 
   3 // Purpose:     SWIG interface defs for wxChoice
 
   7 // Created:     10-June-1998
 
   9 // Copyright:   (c) 2003 by Total Control Software
 
  10 // Licence:     wxWindows license
 
  11 /////////////////////////////////////////////////////////////////////////////
 
  16 //---------------------------------------------------------------------------
 
  18 MAKE_CONST_WXSTRING(ChoiceNameStr);
 
  20 //---------------------------------------------------------------------------
 
  25 "A Choice control is used to select one of a list of strings.
 
  26 Unlike a `wx.ListBox`, only the selection is visible until the
 
  27 user pulls down the menu of choices.", "
 
  31     ================    ==========================================
 
  32     EVT_CHOICE          Sent when an item in the list is selected.
 
  33     ================    ==========================================
 
  37 MustHaveApp(wxChoice);
 
  39 class wxChoice : public wxControlWithItems
 
  42     %pythonAppend wxChoice         "self._setOORInfo(self)"
 
  43     %pythonAppend wxChoice()       ""
 
  46         wxChoice(wxWindow *parent, wxWindowID id=-1,
 
  47                  const wxPoint& pos = wxDefaultPosition,
 
  48                  const wxSize& size = wxDefaultSize,
 
  49                  const wxArrayString& choices = wxPyEmptyStringArray,
 
  51                  const wxValidator& validator = wxDefaultValidator,
 
  52                  const wxString& name = wxPyChoiceNameStr),
 
  53         "__init__(Window parent, int id, Point pos=DefaultPosition, Size size=DefaultSize,
 
  54     List choices=[], long style=0, Validator validator=DefaultValidator,
 
  55     String name=ChoiceNameStr) -> Choice",
 
  56         "Create and show a Choice control", "");
 
  60         "Precreate a Choice control for 2-phase creation.", "",
 
  65         bool, Create(wxWindow *parent, wxWindowID id=-1,
 
  66                      const wxPoint& pos = wxDefaultPosition,
 
  67                      const wxSize& size = wxDefaultSize,
 
  68                      const wxArrayString& choices = wxPyEmptyStringArray,
 
  70                      const wxValidator& validator = wxDefaultValidator,
 
  71                      const wxString& name = wxPyChoiceNameStr),
 
  72         "Create(Window parent, int id, Point pos=DefaultPosition, Size size=DefaultSize,
 
  73     List choices=[], long style=0, Validator validator=DefaultValidator,
 
  74     String name=ChoiceNameStr) -> bool",
 
  75         "Actually create the GUI Choice control for 2-phase creation", "");
 
  78 //     // These are only meaningful on wxMotif...
 
  80 //     void SetColumns(const int n = 1);
 
  84         void , SetSelection(const int n),
 
  85         "Select the n'th item (zero based) in the list.", "");
 
  88         bool , SetStringSelection(const wxString& string),
 
  89         "Select the item with the specifed string", "");
 
  92         void , SetString(int n, const wxString& string),
 
  93         "Set the label for the n'th item (zero based) in the list.", "");
 
  96     %pythoncode { Select = SetSelection }
 
  98     static wxVisualAttributes
 
  99     GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
 
 102 //---------------------------------------------------------------------------