1//--------------------------------------------------------------------------- 2// This file is generated by wxPython's SIP generator. Do not edit by hand. 3// 4// Copyright: (c) 2018 by Total Control Software 5// License: wxWindows License 6// 7// This file will be included by _core.sip 8// 9//--------------------------------------------------------------------------- 10 11//--------------------------------------------------------------------------- 12 13const char* wxComboBoxNameStr; 14 15class wxComboBox : wxControl, wxItemContainer, wxTextEntry 16{ 17 %Docstring 18 ComboBox() 19 ComboBox(parent, id=ID_ANY, value=EmptyString, pos=DefaultPosition, size=DefaultSize, choices=[], style=0, validator=DefaultValidator, name=ComboBoxNameStr) 20 21 A combobox is like a combination of an edit control and a listbox. 22 %End 23 %TypeHeaderCode 24 #include <wx/combobox.h> 25 %End 26 27public: 28 wxComboBox(); 29 %PreMethodCode 30 if (!wxPyCheckForApp()) return NULL; 31 %End 32 33 wxComboBox( 34 wxWindow * parent /TransferThis/, 35 wxWindowID id = wxID_ANY, 36 const wxString & value = wxEmptyString, 37 const wxPoint & pos = wxDefaultPosition, 38 const wxSize & size = wxDefaultSize, 39 const wxArrayString & choices = wxArrayString(), 40 long style = 0, 41 const wxValidator & validator = wxDefaultValidator, 42 const wxString & name = wxComboBoxNameStr 43 ); 44 %PreMethodCode 45 if (!wxPyCheckForApp()) return NULL; 46 %End 47 48 ~wxComboBox(); 49 50 bool Create( 51 wxWindow * parent /TransferThis/, 52 wxWindowID id = wxID_ANY, 53 const wxString & value = wxEmptyString, 54 const wxPoint & pos = wxDefaultPosition, 55 const wxSize & size = wxDefaultSize, 56 const wxArrayString & choices = wxArrayString(), 57 long style = 0, 58 const wxValidator & validator = wxDefaultValidator, 59 const wxString & name = wxComboBoxNameStr 60 ); 61 %Docstring 62 Create(parent, id=ID_ANY, value=EmptyString, pos=DefaultPosition, size=DefaultSize, choices=[], style=0, validator=DefaultValidator, name=ComboBoxNameStr) -> bool 63 64 Creates the combobox for two-step construction. 65 %End 66 67 int GetCurrentSelection() const; 68 %Docstring 69 GetCurrentSelection() -> int 70 71 Returns the item being selected right now. 72 %End 73 74 long GetInsertionPoint() const; 75 %Docstring 76 GetInsertionPoint() -> long 77 78 Same as wxTextEntry::GetInsertionPoint(). 79 %End 80 81 bool IsListEmpty() const; 82 %Docstring 83 IsListEmpty() -> bool 84 85 Returns true if the list of combobox choices is empty. 86 %End 87 88 bool IsTextEmpty() const; 89 %Docstring 90 IsTextEmpty() -> bool 91 92 Returns true if the text of the combobox is empty. 93 %End 94 95 void SetSelection( 96 long from_, 97 long to_ 98 ); 99 %Docstring 100 SetSelection(from_, to_) 101 SetSelection(n) 102 103 Same as wxTextEntry::SetSelection(). 104 %End 105 106 void SetSelection( 107 int n 108 ); 109 110 void SetTextSelection(long from_, long to_); 111 %Docstring 112 SetTextSelection(from_, to_) 113 114 Same as wxTextEntry::SetSelection(). 115 %End 116 %MethodCode 117 PyErr_Clear(); 118 Py_BEGIN_ALLOW_THREADS 119 _wxComboBox_SetTextSelection(sipCpp, from_, to_); 120 Py_END_ALLOW_THREADS 121 if (PyErr_Occurred()) sipIsErr = 1; 122 %End 123 %TypeCode 124 void _wxComboBox_SetTextSelection(wxComboBox* self, long from_, long to_) 125 { 126 self->SetSelection(from_, to_); 127 } 128 %End 129 130 void SetValue( 131 const wxString & text 132 ); 133 %Docstring 134 SetValue(text) 135 136 Sets the text for the combobox text field. 137 %End 138 139 void Popup(); 140 %Docstring 141 Popup() 142 143 Shows the list box portion of the combo box. 144 %End 145 146 void Dismiss(); 147 %Docstring 148 Dismiss() 149 150 Hides the list box portion of the combo box. 151 %End 152 153 int GetSelection() const; 154 %Docstring 155 GetSelection() -> int 156 157 Returns the index of the selected item or wxNOT_FOUND if no item is 158 selected. 159 %End 160 161 void GetSelection( 162 long * from /Out/, 163 long * to /Out/ 164 ) const /PyName=GetTextSelection/; 165 %Docstring 166 GetTextSelection() -> (from, to) 167 168 Gets the current selection span. 169 %End 170 171 int FindString( 172 const wxString & string, 173 bool caseSensitive = false 174 ) const; 175 %Docstring 176 FindString(string, caseSensitive=False) -> int 177 178 Finds an item whose label matches the given string. 179 %End 180 181 wxString GetString( 182 unsigned int n 183 ) const; 184 %Docstring 185 GetString(n) -> String 186 187 Returns the label of the item with the given index. 188 %End 189 190 wxString GetStringSelection() const; 191 %Docstring 192 GetStringSelection() -> String 193 194 Gets the text currently selected in the control. 195 %End 196 197 void SetString( 198 unsigned int n, 199 const wxString & text 200 ); 201 %Docstring 202 SetString(n, text) 203 204 Changes the text of the specified combobox item. 205 %End 206 207 unsigned int GetCount() const; 208 %Docstring 209 GetCount() -> unsignedint 210 211 Returns the number of items in the control. 212 %End 213 214 public: 215 virtual wxPoint GetClientAreaOrigin() const; 216 virtual bool Validate(); 217 virtual bool TransferDataToWindow(); 218 virtual bool TransferDataFromWindow(); 219 virtual void InitDialog(); 220 virtual bool AcceptsFocus() const; 221 virtual bool AcceptsFocusRecursively() const; 222 virtual bool AcceptsFocusFromKeyboard() const; 223 virtual void AddChild( wxWindowBase *child ); 224 virtual void RemoveChild( wxWindowBase *child ); 225 virtual void InheritAttributes(); 226 virtual bool ShouldInheritColours() const; 227 virtual void OnInternalIdle(); 228 virtual wxWindow *GetMainWindowOfCompositeControl(); 229 virtual bool InformFirstDirection(int direction, int size, int availableOtherDir); 230 virtual void SetCanFocus(bool canFocus); 231 virtual bool Destroy(); 232 virtual void SetValidator( const wxValidator &validator ); 233 virtual wxValidator* GetValidator(); 234 235 236 protected: 237 virtual bool ProcessEvent(wxEvent & event); 238 virtual void DoEnable(bool enable); 239 virtual void DoGetPosition(int *x, int *y) const; 240 virtual void DoGetSize(int *width, int *height) const; 241 virtual void DoGetClientSize(int *width, int *height) const; 242 virtual wxSize DoGetBestSize() const; 243 virtual wxSize DoGetBestClientSize() const; 244 virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags); 245 virtual void DoSetClientSize(int width, int height); 246 virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH ); 247 virtual wxSize DoGetBorderSize() const; 248 virtual void DoMoveWindow(int x, int y, int width, int height); 249 virtual void DoSetWindowVariant( wxWindowVariant variant); 250 virtual wxBorder GetDefaultBorder() const; 251 virtual wxBorder GetDefaultBorderForControl() const; 252 virtual void DoFreeze(); 253 virtual void DoThaw(); 254 virtual bool HasTransparentBackground(); 255 virtual bool TryBefore(wxEvent& event); 256 virtual bool TryAfter(wxEvent& event); 257 258 259 public: 260 261 262 static 263 wxVisualAttributes GetClassDefaultAttributes( 264 wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL 265 ); 266 %Docstring 267 GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes 268 %End 269 %PreMethodCode 270 if (!wxPyCheckForApp()) return NULL; 271 %End 272 273 public: 274 275 276 %Property(name=Count, get=GetCount) 277 %Property(name=CurrentSelection, get=GetCurrentSelection) 278 %Property(name=InsertionPoint, get=GetInsertionPoint) 279 %Property(name=Selection, get=GetSelection, set=SetSelection) 280 %Property(name=StringSelection, get=GetStringSelection) 281}; // end of class wxComboBox 282 283 284%Extract(id=pycode_core) 285ComboBox.SetMark = wx.deprecated(ComboBox.SetTextSelection, 'Use SetTextSelection instead.') 286 287%End 288 289%Extract(id=pycode_core) 290ComboBox.GetMark = wx.deprecated(ComboBox.GetTextSelection, 'Use GetTextSelection instead.') 291 292%End 293 294 295//--------------------------------------------------------------------------- 296 297