1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Control (widget) classes for wxPython
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
17 #include <wx/slider.h>
18 #include <wx/spinbutt.h>
19 #include <wx/spinctrl.h>
20 #include <wx/dynarray.h>
21 #include <wx/statline.h>
22 #include <wx/tglbtn.h>
26 #include <wx/checklst.h>
31 #include <wx/checklst.h>
36 //----------------------------------------------------------------------
39 %include my_typemaps.i
41 // Import some definitions of other classes, etc.
48 %pragma(python) code = "import wx"
50 //----------------------------------------------------------------------
53 wxValidator wxDefaultValidator;
56 //----------------------------------------------------------------------
58 class wxControl : public wxWindow {
60 wxControl(wxWindow *parent,
62 const wxPoint& pos=wxDefaultPosition,
63 const wxSize& size=wxDefaultSize,
65 const wxValidator& validator=wxDefaultValidator,
66 const char* name="control");
67 %name(wxPreControl)wxControl();
69 bool Create(wxWindow *parent,
71 const wxPoint& pos=wxDefaultPosition,
72 const wxSize& size=wxDefaultSize,
74 const wxValidator& validator=wxDefaultValidator,
75 const char* name="control");
77 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
78 %pragma(python) addtomethod = "wxPreControl:val._setOORInfo(val)"
80 void Command(wxCommandEvent& event);
82 void SetLabel(const wxString& label);
86 //----------------------------------------------------------------------
89 class wxControlWithItems : public wxControl {
92 // void Clear(); ambiguous, redefine below...
96 %pragma(python) addtoclass = "Number = GetCount"
97 wxString GetString(int n);
98 void SetString(int n, const wxString& s);
99 int FindString(const wxString& s);
104 wxString GetStringSelection() const;
106 // void Append(const wxString& item);
107 // void Append(const wxString& item, char* clientData);
108 // char* GetClientData(const int n);
109 // void SetClientData(const int n, char* data);
111 void Append(const wxString& item, PyObject* clientData=NULL) {
113 wxPyClientData* data = new wxPyClientData(clientData);
114 self->Append(item, data);
119 PyObject* GetClientData(int n) {
120 wxPyClientData* data = (wxPyClientData*)self->GetClientObject(n);
122 Py_INCREF(data->m_obj);
130 void SetClientData(int n, PyObject* clientData) {
131 wxPyClientData* data = new wxPyClientData(clientData);
132 self->SetClientObject(n, data);
137 //----------------------------------------------------------------------
139 class wxButton : public wxControl {
141 wxButton(wxWindow* parent, wxWindowID id, const wxString& label,
142 const wxPoint& pos = wxDefaultPosition,
143 const wxSize& size = wxDefaultSize,
145 const wxValidator& validator = wxDefaultValidator,
146 char* name = "button");
147 %name(wxPreButton)wxButton();
149 bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
150 const wxPoint& pos = wxDefaultPosition,
151 const wxSize& size = wxDefaultSize,
153 const wxValidator& validator = wxDefaultValidator,
154 char* name = "button");
156 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
157 %pragma(python) addtomethod = "wxPreButton:val._setOORInfo(val)"
160 void SetBackgroundColour(const wxColour& colour);
161 void SetForegroundColour(const wxColour& colour);
163 void SetImageLabel(const wxBitmap& bitmap);
164 void SetImageMargins(wxCoord x, wxCoord y);
166 static wxSize GetDefaultSize();
169 //----------------------------------------------------------------------
171 class wxBitmapButton : public wxButton {
173 wxBitmapButton(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap,
174 const wxPoint& pos = wxDefaultPosition,
175 const wxSize& size = wxDefaultSize,
176 long style = wxBU_AUTODRAW,
177 const wxValidator& validator = wxDefaultValidator,
178 char* name = "button");
179 %name(wxPreBitmapButton)wxBitmapButton();
181 bool Create(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap,
182 const wxPoint& pos = wxDefaultPosition,
183 const wxSize& size = wxDefaultSize,
184 long style = wxBU_AUTODRAW,
185 const wxValidator& validator = wxDefaultValidator,
186 char* name = "button");
188 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
189 %pragma(python) addtomethod = "wxPreBitmapButton:val._setOORInfo(val)"
191 wxBitmap& GetBitmapLabel();
192 wxBitmap& GetBitmapDisabled();
193 wxBitmap& GetBitmapFocus();
194 wxBitmap& GetBitmapSelected();
195 void SetBitmapDisabled(const wxBitmap& bitmap);
196 void SetBitmapFocus(const wxBitmap& bitmap);
197 void SetBitmapSelected(const wxBitmap& bitmap);
198 void SetBitmapLabel(const wxBitmap& bitmap);
200 void SetMargins(int x, int y) { m_marginX = x; m_marginY = y; }
201 int GetMarginX() const { return m_marginX; }
202 int GetMarginY() const { return m_marginY; }
205 //----------------------------------------------------------------------
207 class wxCheckBox : public wxControl {
209 wxCheckBox(wxWindow* parent, wxWindowID id, const wxString& label,
210 const wxPoint& pos = wxDefaultPosition,
211 const wxSize& size = wxDefaultSize,
213 const wxValidator& val = wxDefaultValidator,
214 char* name = "checkBox");
215 %name(wxPreCheckBox)wxCheckBox();
217 bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
218 const wxPoint& pos = wxDefaultPosition,
219 const wxSize& size = wxDefaultSize,
221 const wxValidator& val = wxDefaultValidator,
222 char* name = "checkBox");
224 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
225 %pragma(python) addtomethod = "wxPreCheckBox:val._setOORInfo(val)"
228 void SetValue(const bool state);
231 //----------------------------------------------------------------------
233 class wxChoice : public wxControlWithItems {
235 wxChoice(wxWindow *parent, wxWindowID id,
236 const wxPoint& pos = wxDefaultPosition,
237 const wxSize& size = wxDefaultSize,
238 int LCOUNT=0, wxString* choices=NULL,
240 const wxValidator& validator = wxDefaultValidator,
241 char* name = "choice");
242 %name(wxPreChoice)wxChoice();
244 bool Create(wxWindow *parent, wxWindowID id,
245 const wxPoint& pos = wxDefaultPosition,
246 const wxSize& size = wxDefaultSize,
247 int LCOUNT=0, wxString* choices=NULL,
249 const wxValidator& validator = wxDefaultValidator,
250 char* name = "choice");
252 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
253 %pragma(python) addtomethod = "wxPreChoice:val._setOORInfo(val)"
258 void SetColumns(const int n = 1);
259 void SetSelection(const int n);
260 void SetStringSelection(const wxString& string);
261 void SetString(int n, const wxString& s);
263 %pragma(python) addtoclass = "
264 Select = SetSelection
268 //----------------------------------------------------------------------
270 // wxGTK's wxComboBox doesn't derive from wxChoice like wxMSW, or
271 // even wxControlWithItems, so we have to duplicate the methods
275 class wxComboBox : public wxControl
278 wxComboBox(wxWindow* parent, wxWindowID id, char* value = "",
279 const wxPoint& pos = wxDefaultPosition,
280 const wxSize& size = wxDefaultSize,
281 int LCOUNT=0, wxString* choices=NULL,
283 const wxValidator& validator = wxDefaultValidator,
284 char* name = "comboBox");
285 %name(wxPreComboBox)wxComboBox();
287 bool Create(wxWindow* parent, wxWindowID id, char* value = "",
288 const wxPoint& pos = wxDefaultPosition,
289 const wxSize& size = wxDefaultSize,
290 int LCOUNT=0, wxString* choices=NULL,
292 const wxValidator& validator = wxDefaultValidator,
293 char* name = "comboBox");
295 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
296 %pragma(python) addtomethod = "wxPreComboBox:val._setOORInfo(val)"
300 long GetInsertionPoint();
301 long GetLastPosition();
304 void Replace(long from, long to, const wxString& text);
305 void Remove(long from, long to);
306 void SetInsertionPoint(long pos);
307 void SetInsertionPointEnd();
308 void SetSelection(int n);
309 %name(SetMark)void SetSelection(long from, long to);
310 void SetValue(const wxString& text);
311 void SetEditable(bool editable);
318 %pragma(python) addtoclass = "Number = GetCount"
319 wxString GetString(int n);
320 int FindString(const wxString& s);
322 //void SetString(int n, const wxString& s); *** No equivalent for wxGTK!!!
324 // void Select(int n);
325 %pragma(python) addtoclass = "Select = SetSelection"
328 wxString GetStringSelection() const;
330 // void Append(const wxString& item);
331 // void Append(const wxString& item, char* clientData);
332 // char* GetClientData(const int n);
333 // void SetClientData(const int n, char* data);
335 void Append(const wxString& item, PyObject* clientData=NULL) {
337 wxPyClientData* data = new wxPyClientData(clientData);
338 self->Append(item, data);
343 PyObject* GetClientData(int n) {
344 wxPyClientData* data = (wxPyClientData*)self->GetClientObject(n);
346 Py_INCREF(data->m_obj);
354 void SetClientData(int n, PyObject* clientData) {
355 wxPyClientData* data = new wxPyClientData(clientData);
356 self->SetClientObject(n, data);
364 #else // For all but wxGTK
367 class wxComboBox : public wxChoice {
369 wxComboBox(wxWindow* parent, wxWindowID id, char* value = "",
370 const wxPoint& pos = wxDefaultPosition,
371 const wxSize& size = wxDefaultSize,
372 int LCOUNT=0, wxString* choices=NULL,
374 const wxValidator& validator = wxDefaultValidator,
375 char* name = "comboBox");
376 %name(wxPreComboBox)wxComboBox();
378 bool Create(wxWindow* parent, wxWindowID id, char* value = "",
379 const wxPoint& pos = wxDefaultPosition,
380 const wxSize& size = wxDefaultSize,
381 int LCOUNT=0, wxString* choices=NULL,
383 const wxValidator& validator = wxDefaultValidator,
384 char* name = "comboBox");
386 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
387 %pragma(python) addtomethod = "wxPreComboBox:val._setOORInfo(val)"
391 long GetInsertionPoint();
392 long GetLastPosition();
395 void Replace(long from, long to, const wxString& text);
396 void Remove(long from, long to);
397 void SetInsertionPoint(long pos);
398 void SetInsertionPointEnd();
399 void SetSelection(int n);
400 %name(SetMark)void SetSelection(long from, long to);
401 void SetValue(const wxString& text);
402 void SetEditable(bool editable);
407 //----------------------------------------------------------------------
409 class wxGauge : public wxControl {
411 wxGauge(wxWindow* parent, wxWindowID id, int range,
412 const wxPoint& pos = wxDefaultPosition,
413 const wxSize& size = wxDefaultSize,
414 long style = wxGA_HORIZONTAL,
415 const wxValidator& validator = wxDefaultValidator,
416 char* name = "gauge");
417 %name(wxPreGauge)wxGauge();
419 bool Create(wxWindow* parent, wxWindowID id, int range,
420 const wxPoint& pos = wxDefaultPosition,
421 const wxSize& size = wxDefaultSize,
422 long style = wxGA_HORIZONTAL,
423 const wxValidator& validator = wxDefaultValidator,
424 char* name = "gauge");
426 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
427 %pragma(python) addtomethod = "wxPreGauge:val._setOORInfo(val)"
431 int GetShadowWidth();
433 void SetBezelFace(int width);
434 void SetRange(int range);
435 void SetShadowWidth(int width);
436 void SetValue(int pos);
439 //----------------------------------------------------------------------
441 class wxStaticBox : public wxControl {
443 wxStaticBox(wxWindow* parent, wxWindowID id, const wxString& label,
444 const wxPoint& pos = wxDefaultPosition,
445 const wxSize& size = wxDefaultSize,
447 char* name = "staticBox");
448 %name(wxPreStaticBox)wxStaticBox();
450 bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
451 const wxPoint& pos = wxDefaultPosition,
452 const wxSize& size = wxDefaultSize,
454 char* name = "staticBox");
456 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
457 %pragma(python) addtomethod = "wxPreStaticBox:val._setOORInfo(val)"
461 //----------------------------------------------------------------------
464 class wxStaticLine : public wxControl {
466 wxStaticLine( wxWindow *parent, wxWindowID id,
467 const wxPoint &pos = wxDefaultPosition,
468 const wxSize &size = wxDefaultSize,
469 long style = wxLI_HORIZONTAL,
470 const char* name = "staticLine" );
471 %name(wxPreStaticLine)wxStaticLine();
473 bool Create( wxWindow *parent, wxWindowID id,
474 const wxPoint &pos = wxDefaultPosition,
475 const wxSize &size = wxDefaultSize,
476 long style = wxLI_HORIZONTAL,
477 const char* name = "staticLine" );
479 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
480 %pragma(python) addtomethod = "wxPreStaticLine:val._setOORInfo(val)"
484 //----------------------------------------------------------------------
486 class wxStaticText : public wxControl {
488 wxStaticText(wxWindow* parent, wxWindowID id, const wxString& label,
489 const wxPoint& pos = wxDefaultPosition,
490 const wxSize& size = wxDefaultSize,
492 char* name = "staticText");
493 %name(wxPreStaticText)wxStaticText();
495 bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
496 const wxPoint& pos = wxDefaultPosition,
497 const wxSize& size = wxDefaultSize,
499 char* name = "staticText");
501 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
502 %pragma(python) addtomethod = "wxPreStaticText:val._setOORInfo(val)"
505 void SetLabel(const wxString& label);
508 //----------------------------------------------------------------------
510 class wxListBox : public wxControlWithItems {
512 wxListBox(wxWindow* parent, wxWindowID id,
513 const wxPoint& pos = wxDefaultPosition,
514 const wxSize& size = wxDefaultSize,
515 int LCOUNT, wxString* choices = NULL,
517 const wxValidator& validator = wxDefaultValidator,
518 char* name = "listBox");
519 %name(wxPreListBox)wxListBox();
521 bool Create(wxWindow* parent, wxWindowID id,
522 const wxPoint& pos = wxDefaultPosition,
523 const wxSize& size = wxDefaultSize,
524 int LCOUNT, wxString* choices = NULL,
526 const wxValidator& validator = wxDefaultValidator,
527 char* name = "listBox");
529 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
530 %pragma(python) addtomethod = "wxPreListBox:val._setOORInfo(val)"
533 void Deselect(int n);
535 // int GetSelections(int **selections);
537 PyObject* GetSelections() {
539 self->GetSelections(lst);
540 PyObject *tup = PyTuple_New(lst.GetCount());
541 for(size_t i=0; i<lst.GetCount(); i++) {
542 PyTuple_SetItem(tup, i, PyInt_FromLong(lst[i]));
549 void InsertItems(int LCOUNT, wxString* choices, int pos);
551 bool IsSelected(const int n);
552 bool Selected(const int n);
553 void Set(int LCOUNT, wxString* choices);
554 void SetFirstItem(int n);
555 %name(SetFirstItemStr)void SetFirstItem(const wxString& string);
556 void SetSelection(int n, bool select = TRUE);
557 void SetString(int n, const wxString& string);
558 void SetStringSelection(const wxString& string, bool select = TRUE);
562 //----------------------------------------------------------------------
564 class wxCheckListBox : public wxListBox {
566 wxCheckListBox(wxWindow *parent, wxWindowID id,
567 const wxPoint& pos = wxDefaultPosition,
568 const wxSize& size = wxDefaultSize,
570 wxString* choices = NULL,
572 const wxValidator& validator = wxDefaultValidator,
573 char* name = "listBox");
574 %name(wxPreCheckListBox)wxCheckListBox();
576 bool Create(wxWindow *parent, wxWindowID id,
577 const wxPoint& pos = wxDefaultPosition,
578 const wxSize& size = wxDefaultSize,
580 wxString* choices = NULL,
582 const wxValidator& validator = wxDefaultValidator,
583 char* name = "listBox");
585 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
586 %pragma(python) addtomethod = "wxPreCheckListBox:val._setOORInfo(val)"
588 bool IsChecked(int uiIndex);
589 void Check(int uiIndex, int bCheck = TRUE);
590 void InsertItems(int LCOUNT, wxString* choices, int pos);
597 //----------------------------------------------------------------------
604 wxTextAttr(const wxColour& colText = wxNullColour,
605 const wxColour& colBack = wxNullColour,
606 const wxFont& font = wxNullFont);
610 void SetTextColour(const wxColour& colText);
611 void SetBackgroundColour(const wxColour& colBack);
612 void SetFont(const wxFont& font);
615 bool HasTextColour() const;
616 bool HasBackgroundColour() const;
617 bool HasFont() const;
619 const wxColour& GetTextColour() const;
620 const wxColour& GetBackgroundColour() const;
621 const wxFont& GetFont() const;
623 // returns false if we have any attributes set, true otherwise
626 // return the attribute having the valid font and colours: it uses the
627 // attributes set in attr and falls back first to attrDefault and then to
628 // the text control font/colours for those attributes which are not set
629 static wxTextAttr Combine(const wxTextAttr& attr,
630 const wxTextAttr& attrDef,
631 const wxTextCtrl *text);
636 class wxTextCtrl : public wxControl {
638 wxTextCtrl(wxWindow* parent, wxWindowID id, char* value = "",
639 const wxPoint& pos = wxDefaultPosition,
640 const wxSize& size = wxDefaultSize,
642 const wxValidator& validator = wxDefaultValidator,
643 char* name = "text");
644 %name(wxPreTextCtrl)wxTextCtrl();
646 bool Create(wxWindow* parent, wxWindowID id, char* value = "",
647 const wxPoint& pos = wxDefaultPosition,
648 const wxSize& size = wxDefaultSize,
650 const wxValidator& validator = wxDefaultValidator,
651 char* name = "text");
653 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
654 %pragma(python) addtomethod = "wxPreTextCtrl:val._setOORInfo(val)"
657 wxString GetValue() const;
658 void SetValue(const wxString& value);
660 int GetLineLength(long lineNo) const;
661 wxString GetLineText(long lineNo) const;
662 int GetNumberOfLines() const;
664 bool IsModified() const;
665 bool IsEditable() const;
667 // If the return values from and to are the same, there is no selection.
668 void GetSelection(long* OUTPUT, long* OUTPUT) const;
669 wxString GetStringSelection();
672 void Replace(long from, long to, const wxString& value);
673 void Remove(long from, long to);
675 // load/save the controls contents from/to the file
676 bool LoadFile(const wxString& file);
677 bool SaveFile(const wxString& file = wxEmptyString);
679 // clears the dirty flag
682 // set the max number of characters which may be entered in a single line
684 void SetMaxLength(unsigned long len);
686 // writing text inserts it at the current position, appending always
687 // inserts it at the end
688 void WriteText(const wxString& text);
689 void AppendText(const wxString& text);
691 // text control under some platforms supports the text styles: these
692 // methods allow to apply the given text style to the given selection or to
693 // set/get the style which will be used for all appended text
694 bool SetStyle(long start, long end, const wxTextAttr& style);
695 bool SetDefaultStyle(const wxTextAttr& style);
696 const wxTextAttr& GetDefaultStyle() const;
698 // translate between the position (which is just an index in the text ctrl
699 // considering all its contents as a single strings) and (x, y) coordinates
700 // which represent column and line.
701 long XYToPosition(long x, long y) const;
702 bool PositionToXY(long pos, long *OUTPUT, long *OUTPUT) const;
704 void ShowPosition(long pos);
706 // Clipboard operations
711 bool CanCopy() const;
713 bool CanPaste() const;
719 bool CanUndo() const;
720 bool CanRedo() const;
723 void SetInsertionPoint(long pos);
724 void SetInsertionPointEnd();
725 long GetInsertionPoint() const;
726 long GetLastPosition() const;
728 void SetSelection(long from, long to);
730 void SetEditable(bool editable);
733 void write(const wxString& text) {
734 self->AppendText(text);
738 // TODO: replace this when the method is really added to wxTextCtrl
740 wxString GetString(long from, long to) {
741 return self->GetValue().Mid(from, to-from);
746 //----------------------------------------------------------------------
748 class wxScrollBar : public wxControl {
750 wxScrollBar(wxWindow* parent, wxWindowID id = -1,
751 const wxPoint& pos = wxDefaultPosition,
752 const wxSize& size = wxDefaultSize,
753 long style = wxSB_HORIZONTAL,
754 const wxValidator& validator = wxDefaultValidator,
755 char* name = "scrollBar");
756 %name(wxPreScrollBar)wxScrollBar();
758 bool Create(wxWindow* parent, wxWindowID id = -1,
759 const wxPoint& pos = wxDefaultPosition,
760 const wxSize& size = wxDefaultSize,
761 long style = wxSB_HORIZONTAL,
762 const wxValidator& validator = wxDefaultValidator,
763 char* name = "scrollBar");
765 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
766 %pragma(python) addtomethod = "wxPreScrollBar:val._setOORInfo(val)"
770 int GetThumbPosition();
772 %name(GetThumbLength) int GetThumbSize(); // to match the docs
776 void SetThumbPosition(int viewStart);
777 void SetScrollbar(int position, int thumbSize,
778 int range, int pageSize,
779 bool refresh = TRUE);
782 //----------------------------------------------------------------------
784 class wxSpinButton : public wxControl {
786 wxSpinButton(wxWindow* parent, wxWindowID id = -1,
787 const wxPoint& pos = wxDefaultPosition,
788 const wxSize& size = wxDefaultSize,
789 long style = wxSP_HORIZONTAL,
790 char* name = "spinButton");
791 %name(wxPreSpinButton)wxSpinButton();
793 bool Create(wxWindow* parent, wxWindowID id = -1,
794 const wxPoint& pos = wxDefaultPosition,
795 const wxSize& size = wxDefaultSize,
796 long style = wxSP_HORIZONTAL,
797 char* name = "spinButton");
799 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
800 %pragma(python) addtomethod = "wxPreSpinButton:val._setOORInfo(val)"
805 void SetRange(int min, int max);
806 void SetValue(int value);
809 //----------------------------------------------------------------------
811 class wxStaticBitmap : public wxControl {
813 wxStaticBitmap(wxWindow* parent, wxWindowID id,
814 const wxBitmap& bitmap,
815 const wxPoint& pos = wxDefaultPosition,
816 const wxSize& size = wxDefaultSize,
818 char* name = "staticBitmap");
819 %name(wxPreStaticBitmap)wxStaticBitmap();
821 bool Create(wxWindow* parent, wxWindowID id,
822 const wxBitmap& bitmap,
823 const wxPoint& pos = wxDefaultPosition,
824 const wxSize& size = wxDefaultSize,
826 char* name = "staticBitmap");
828 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
829 %pragma(python) addtomethod = "wxPreStaticBitmap:val._setOORInfo(val)"
831 const wxBitmap& GetBitmap();
832 void SetBitmap(const wxBitmap& bitmap);
833 void SetIcon(const wxIcon& icon);
836 //----------------------------------------------------------------------
838 class wxRadioBox : public wxControl {
840 wxRadioBox(wxWindow* parent, wxWindowID id,
841 const wxString& label,
842 const wxPoint& point = wxDefaultPosition,
843 const wxSize& size = wxDefaultSize,
844 int LCOUNT = 0, wxString* choices = NULL,
845 int majorDimension = 0,
846 long style = wxRA_HORIZONTAL,
847 const wxValidator& validator = wxDefaultValidator,
848 char* name = "radioBox");
849 %name(wxPreRadioBox)wxRadioBox();
851 bool Create(wxWindow* parent, wxWindowID id,
852 const wxString& label,
853 const wxPoint& point = wxDefaultPosition,
854 const wxSize& size = wxDefaultSize,
855 int LCOUNT = 0, wxString* choices = NULL,
856 int majorDimension = 0,
857 long style = wxRA_HORIZONTAL,
858 const wxValidator& validator = wxDefaultValidator,
859 char* name = "radioBox");
861 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
862 %pragma(python) addtomethod = "wxPreRadioBox:val._setOORInfo(val)"
864 void Enable(bool enable);
865 %name(EnableItem)void Enable(int n, bool enable);
866 int FindString(const wxString& string);
868 wxString GetString(int n);
871 %name(GetItemLabel)wxString GetLabel( int item );
872 %name(SetItemLabel)void SetLabel( int item, const wxString& label );
874 void SetString(int n, const wxString& label);
875 %pragma(python) addtoclass = "
876 GetItemLabel = GetString
877 SetItemLabel = SetString
879 int GetColumnCount();
884 wxString GetStringSelection();
886 %pragma(python) addtoclass = "Number = GetCount"
888 void SetSelection(int n);
889 void SetStringSelection(const wxString& string);
890 void Show(bool show);
891 %name(ShowItem)void Show(int item, bool show);
894 //----------------------------------------------------------------------
896 class wxRadioButton : public wxControl {
898 wxRadioButton(wxWindow* parent, wxWindowID id,
899 const wxString& label,
900 const wxPoint& pos = wxDefaultPosition,
901 const wxSize& size = wxDefaultSize,
903 const wxValidator& validator = wxDefaultValidator,
904 char* name = "radioButton");
905 %name(wxPreRadioButton)wxRadioButton();
907 bool Create(wxWindow* parent, wxWindowID id,
908 const wxString& label,
909 const wxPoint& pos = wxDefaultPosition,
910 const wxSize& size = wxDefaultSize,
912 const wxValidator& validator = wxDefaultValidator,
913 char* name = "radioButton");
915 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
916 %pragma(python) addtomethod = "wxPreRadioButton:val._setOORInfo(val)"
919 void SetValue(bool value);
922 //----------------------------------------------------------------------
924 class wxSlider : public wxControl {
926 wxSlider(wxWindow* parent, wxWindowID id,
927 int value, int minValue, int maxValue,
928 const wxPoint& point = wxDefaultPosition,
929 const wxSize& size = wxDefaultSize,
930 long style = wxSL_HORIZONTAL,
931 const wxValidator& validator = wxDefaultValidator,
932 char* name = "slider");
933 %name(wxPreSlider)wxSlider();
935 bool Create(wxWindow* parent, wxWindowID id,
936 int value, int minValue, int maxValue,
937 const wxPoint& point = wxDefaultPosition,
938 const wxSize& size = wxDefaultSize,
939 long style = wxSL_HORIZONTAL,
940 const wxValidator& validator = wxDefaultValidator,
941 char* name = "slider");
943 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
944 %pragma(python) addtomethod = "wxPreSlider:val._setOORInfo(val)"
954 int GetThumbLength();
957 void SetRange(int minValue, int maxValue);
958 void SetTickFreq(int n, int pos);
959 void SetLineSize(int lineSize);
960 void SetPageSize(int pageSize);
961 void SetSelection(int startPos, int endPos);
962 void SetThumbLength(int len);
963 void SetTick(int tickPos);
964 void SetValue(int value);
968 //----------------------------------------------------------------------
970 class wxSpinCtrl : public wxSpinButton {
972 wxSpinCtrl(wxWindow *parent,
974 const char* value = "",
975 const wxPoint& pos = wxDefaultPosition,
976 const wxSize& size = wxDefaultSize,
977 long style = wxSP_ARROW_KEYS,
978 int min = 0, int max = 100, int initial = 0,
979 const char* name = "wxSpinCtrl");
980 %name(wxPreSpinCtrl)wxSpinCtrl();
982 bool Create(wxWindow *parent,
984 const char* value = "",
985 const wxPoint& pos = wxDefaultPosition,
986 const wxSize& size = wxDefaultSize,
987 long style = wxSP_ARROW_KEYS,
988 int min = 0, int max = 100, int initial = 0,
989 const char* name = "wxSpinCtrl");
991 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
992 %pragma(python) addtomethod = "wxPreSpinCtrl:val._setOORInfo(val)"
997 void SetRange(int min, int max);
998 void SetValue(int value);
1003 //----------------------------------------------------------------------
1006 enum { wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, };
1008 class wxToggleButton : public wxControl {
1010 wxToggleButton(wxWindow *parent,
1012 const wxString& label,
1013 const wxPoint& pos = wxDefaultPosition,
1014 const wxSize& size = wxDefaultSize,
1016 const wxValidator& validator = wxDefaultValidator,
1017 const char* name = "toggle");
1018 %name(wxPreToggleButton)wxToggleButton();
1020 bool Create(wxWindow *parent,
1022 const wxString& label,
1023 const wxPoint& pos = wxDefaultPosition,
1024 const wxSize& size = wxDefaultSize,
1026 const wxValidator& validator = wxDefaultValidator,
1027 const char* name = "toggle");
1029 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
1030 %pragma(python) addtomethod = "wxPreToggleButton:val._setOORInfo(val)"
1032 void SetValue(bool value);
1033 bool GetValue() const ;
1034 void SetLabel(const wxString& label);
1039 //----------------------------------------------------------------------
1040 //----------------------------------------------------------------------
1041 //----------------------------------------------------------------------