1 /////////////////////////////////////////////////////////////////////////////
 
   3 // Purpose:     SWIG interface defs for wxComboBox
 
   7 // Created:     10-June-1998
 
   9 // Copyright:   (c) 2003 by Total Control Software
 
  10 // Licence:     wxWindows license
 
  11 /////////////////////////////////////////////////////////////////////////////
 
  16 //---------------------------------------------------------------------------
 
  18 MAKE_CONST_WXSTRING(ComboBoxNameStr);
 
  20 //---------------------------------------------------------------------------
 
  25 "A combobox is like a combination of an edit control and a
 
  26 listbox. It can be displayed as static list with editable or
 
  27 read-only text field; or a drop-down list with text field.
 
  29 A combobox permits a single selection only. Combobox items are
 
  30 numbered from zero.", "
 
  34     ================    ===============================================
 
  35     wx.CB_SIMPLE        Creates a combobox with a permanently
 
  36                         displayed list.  Windows only.
 
  38     wx.CB_DROPDOWN      Creates a combobox with a drop-down list.
 
  40     wx.CB_READONLY      Same as wxCB_DROPDOWN but only the strings
 
  41                         specified as the combobox choices can be
 
  42                         selected, it is impossible to select
 
  43                         (even from a program) a string which is
 
  44                         not in the choices list.
 
  46     wx.CB_SORT          Sorts the entries in the list alphabetically.
 
  47     ================    ===============================================
 
  51     ================    ===============================================
 
  52     EVT_COMBOBOX        Sent when an item on the list is selected.
 
  53     EVT_TEXT            Sent when the combobox text changes.
 
  54     ================    ===============================================
 
  59 MustHaveApp(wxComboBox);
 
  62 class wxComboBox : public wxChoice
 
  64 class wxComboBox : public wxControl, public wxItemContainer
 
  68     %pythonAppend wxComboBox         "self._setOORInfo(self)"
 
  69     %pythonAppend wxComboBox()       ""
 
  72         wxComboBox(wxWindow* parent, wxWindowID id=-1,
 
  73                    const wxString& value = wxPyEmptyString,
 
  74                    const wxPoint& pos = wxDefaultPosition,
 
  75                    const wxSize& size = wxDefaultSize,
 
  76                    const wxArrayString& choices = wxPyEmptyStringArray,
 
  78                    const wxValidator& validator = wxDefaultValidator,
 
  79                    const wxString& name = wxPyComboBoxNameStr),
 
  80         "__init__(Window parent, int id, String value=EmptyString,
 
  81     Point pos=DefaultPosition, Size size=DefaultSize,
 
  82     List choices=[], long style=0, Validator validator=DefaultValidator,
 
  83     String name=ComboBoxNameStr) -> ComboBox",
 
  84         "Constructor, creates and shows a ComboBox control.", "");
 
  88         "Precreate a ComboBox control for 2-phase creation.", "",
 
  93         bool, Create(wxWindow *parent, wxWindowID id=-1,
 
  94                      const wxString& value = wxPyEmptyString,
 
  95                      const wxPoint& pos = wxDefaultPosition,
 
  96                      const wxSize& size = wxDefaultSize,
 
  97                      const wxArrayString& choices = wxPyEmptyStringArray,
 
  99                      const wxValidator& validator = wxDefaultValidator,
 
 100                      const wxString& name = wxPyChoiceNameStr),
 
 101         "Create(Window parent, int id, String value=EmptyString,
 
 102     Point pos=DefaultPosition, Size size=DefaultSize,
 
 103     List choices=[], long style=0, Validator validator=DefaultValidator,
 
 104     String name=ChoiceNameStr) -> bool",
 
 105         "Actually create the GUI wxComboBox control for 2-phase creation", "");
 
 109         virtual wxString , GetValue() const,
 
 110         "Returns the current value in the combobox text field.", "");
 
 113         virtual void , SetValue(const wxString& value),
 
 118         virtual void , Copy(),
 
 119         "Copies the selected text to the clipboard.", "");
 
 122         virtual void , Cut(),
 
 123         "Copies the selected text to the clipboard and removes the selection.", "");
 
 126         virtual void , Paste(),
 
 127         "Pastes text from the clipboard to the text field.", "");
 
 131         virtual void , SetInsertionPoint(long pos),
 
 132         "Sets the insertion point in the combobox text field.", "");
 
 135         virtual long , GetInsertionPoint() const,
 
 136         "Returns the insertion point for the combobox's text field.", "");
 
 139         virtual long , GetLastPosition() const,
 
 140         "Returns the last position in the combobox text field.", "");
 
 143         virtual void , Replace(long from, long to, const wxString& value),
 
 144         "Replaces the text between two positions with the given text, in the
 
 145 combobox text field.", "");
 
 148         void , SetSelection(int n),
 
 149         "Sets the item at index 'n' to be the selected item.", "");
 
 152         virtual void , SetSelection(long from, long to),
 
 153         "Selects the text between the two positions in the combobox text field.", "",
 
 157         bool , SetStringSelection(const wxString& string),
 
 158         "Select the item with the specifed string", "");
 
 161         void , SetString(int n, const wxString& string),
 
 162         "Set the label for the n'th item (zero based) in the list.", "");
 
 165         virtual void , SetEditable(bool editable),
 
 170         virtual void , SetInsertionPointEnd(),
 
 171         "Sets the insertion point at the end of the combobox text field.", "");
 
 174         virtual void , Remove(long from, long to),
 
 175         "Removes the text between the two positions in the combobox text field.", "");
 
 177     static wxVisualAttributes
 
 178     GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
 
 181 //---------------------------------------------------------------------------