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 class wxComboBox : public wxChoice {
272 wxComboBox(wxWindow* parent, wxWindowID id, char* value = "",
273 const wxPoint& pos = wxDefaultPosition,
274 const wxSize& size = wxDefaultSize,
275 int LCOUNT=0, wxString* choices=NULL,
277 const wxValidator& validator = wxDefaultValidator,
278 char* name = "comboBox");
279 %name(wxPreComboBox)wxComboBox();
281 bool Create(wxWindow* parent, wxWindowID id, char* value = "",
282 const wxPoint& pos = wxDefaultPosition,
283 const wxSize& size = wxDefaultSize,
284 int LCOUNT=0, wxString* choices=NULL,
286 const wxValidator& validator = wxDefaultValidator,
287 char* name = "comboBox");
289 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
290 %pragma(python) addtomethod = "wxPreComboBox:val._setOORInfo(val)"
294 long GetInsertionPoint();
295 long GetLastPosition();
298 void Replace(long from, long to, const wxString& text);
299 void Remove(long from, long to);
300 void SetInsertionPoint(long pos);
301 void SetInsertionPointEnd();
302 void SetSelection(int n);
303 %name(SetMark)void SetSelection(long from, long to);
304 void SetValue(const wxString& text);
305 void SetEditable(bool editable);
308 //----------------------------------------------------------------------
310 class wxGauge : public wxControl {
312 wxGauge(wxWindow* parent, wxWindowID id, int range,
313 const wxPoint& pos = wxDefaultPosition,
314 const wxSize& size = wxDefaultSize,
315 long style = wxGA_HORIZONTAL,
316 const wxValidator& validator = wxDefaultValidator,
317 char* name = "gauge");
318 %name(wxPreGauge)wxGauge();
320 bool Create(wxWindow* parent, wxWindowID id, int range,
321 const wxPoint& pos = wxDefaultPosition,
322 const wxSize& size = wxDefaultSize,
323 long style = wxGA_HORIZONTAL,
324 const wxValidator& validator = wxDefaultValidator,
325 char* name = "gauge");
327 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
328 %pragma(python) addtomethod = "wxPreGauge:val._setOORInfo(val)"
332 int GetShadowWidth();
334 void SetBezelFace(int width);
335 void SetRange(int range);
336 void SetShadowWidth(int width);
337 void SetValue(int pos);
340 //----------------------------------------------------------------------
342 class wxStaticBox : public wxControl {
344 wxStaticBox(wxWindow* parent, wxWindowID id, const wxString& label,
345 const wxPoint& pos = wxDefaultPosition,
346 const wxSize& size = wxDefaultSize,
348 char* name = "staticBox");
349 %name(wxPreStaticBox)wxStaticBox();
351 bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
352 const wxPoint& pos = wxDefaultPosition,
353 const wxSize& size = wxDefaultSize,
355 char* name = "staticBox");
357 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
358 %pragma(python) addtomethod = "wxPreStaticBox:val._setOORInfo(val)"
362 //----------------------------------------------------------------------
365 class wxStaticLine : public wxControl {
367 wxStaticLine( wxWindow *parent, wxWindowID id,
368 const wxPoint &pos = wxDefaultPosition,
369 const wxSize &size = wxDefaultSize,
370 long style = wxLI_HORIZONTAL,
371 const char* name = "staticLine" );
372 %name(wxPreStaticLine)wxStaticLine();
374 bool Create( wxWindow *parent, wxWindowID id,
375 const wxPoint &pos = wxDefaultPosition,
376 const wxSize &size = wxDefaultSize,
377 long style = wxLI_HORIZONTAL,
378 const char* name = "staticLine" );
380 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
381 %pragma(python) addtomethod = "wxPreStaticLine:val._setOORInfo(val)"
385 //----------------------------------------------------------------------
387 class wxStaticText : public wxControl {
389 wxStaticText(wxWindow* parent, wxWindowID id, const wxString& label,
390 const wxPoint& pos = wxDefaultPosition,
391 const wxSize& size = wxDefaultSize,
393 char* name = "staticText");
394 %name(wxPreStaticText)wxStaticText();
396 bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
397 const wxPoint& pos = wxDefaultPosition,
398 const wxSize& size = wxDefaultSize,
400 char* name = "staticText");
402 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
403 %pragma(python) addtomethod = "wxPreStaticText:val._setOORInfo(val)"
406 void SetLabel(const wxString& label);
409 //----------------------------------------------------------------------
411 class wxListBox : public wxControlWithItems {
413 wxListBox(wxWindow* parent, wxWindowID id,
414 const wxPoint& pos = wxDefaultPosition,
415 const wxSize& size = wxDefaultSize,
416 int LCOUNT, wxString* choices = NULL,
418 const wxValidator& validator = wxDefaultValidator,
419 char* name = "listBox");
420 %name(wxPreListBox)wxListBox();
422 bool Create(wxWindow* parent, wxWindowID id,
423 const wxPoint& pos = wxDefaultPosition,
424 const wxSize& size = wxDefaultSize,
425 int LCOUNT, wxString* choices = NULL,
427 const wxValidator& validator = wxDefaultValidator,
428 char* name = "listBox");
430 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
431 %pragma(python) addtomethod = "wxPreListBox:val._setOORInfo(val)"
434 void Deselect(int n);
436 // int GetSelections(int **selections);
438 PyObject* GetSelections() {
440 self->GetSelections(lst);
441 PyObject *tup = PyTuple_New(lst.GetCount());
442 for(size_t i=0; i<lst.GetCount(); i++) {
443 PyTuple_SetItem(tup, i, PyInt_FromLong(lst[i]));
450 void InsertItems(int LCOUNT, wxString* choices, int pos);
452 bool IsSelected(const int n);
453 bool Selected(const int n);
454 void Set(int LCOUNT, wxString* choices);
455 void SetFirstItem(int n);
456 %name(SetFirstItemStr)void SetFirstItem(const wxString& string);
457 void SetSelection(int n, bool select = TRUE);
458 void SetString(int n, const wxString& string);
459 void SetStringSelection(const wxString& string, bool select = TRUE);
463 //----------------------------------------------------------------------
465 class wxCheckListBox : public wxListBox {
467 wxCheckListBox(wxWindow *parent, wxWindowID id,
468 const wxPoint& pos = wxDefaultPosition,
469 const wxSize& size = wxDefaultSize,
471 wxString* choices = NULL,
473 const wxValidator& validator = wxDefaultValidator,
474 char* name = "listBox");
475 %name(wxPreCheckListBox)wxCheckListBox();
477 bool Create(wxWindow *parent, wxWindowID id,
478 const wxPoint& pos = wxDefaultPosition,
479 const wxSize& size = wxDefaultSize,
481 wxString* choices = NULL,
483 const wxValidator& validator = wxDefaultValidator,
484 char* name = "listBox");
486 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
487 %pragma(python) addtomethod = "wxPreCheckListBox:val._setOORInfo(val)"
489 bool IsChecked(int uiIndex);
490 void Check(int uiIndex, int bCheck = TRUE);
491 void InsertItems(int LCOUNT, wxString* choices, int pos);
496 //----------------------------------------------------------------------
503 wxTextAttr(const wxColour& colText = wxNullColour,
504 const wxColour& colBack = wxNullColour,
505 const wxFont& font = wxNullFont);
509 void SetTextColour(const wxColour& colText);
510 void SetBackgroundColour(const wxColour& colBack);
511 void SetFont(const wxFont& font);
514 bool HasTextColour() const;
515 bool HasBackgroundColour() const;
516 bool HasFont() const;
518 const wxColour& GetTextColour() const;
519 const wxColour& GetBackgroundColour() const;
520 const wxFont& GetFont() const;
525 class wxTextCtrl : public wxControl {
527 wxTextCtrl(wxWindow* parent, wxWindowID id, char* value = "",
528 const wxPoint& pos = wxDefaultPosition,
529 const wxSize& size = wxDefaultSize,
531 const wxValidator& validator = wxDefaultValidator,
532 char* name = "text");
533 %name(wxPreTextCtrl)wxTextCtrl();
535 bool Create(wxWindow* parent, wxWindowID id, char* value = "",
536 const wxPoint& pos = wxDefaultPosition,
537 const wxSize& size = wxDefaultSize,
539 const wxValidator& validator = wxDefaultValidator,
540 char* name = "text");
542 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
543 %pragma(python) addtomethod = "wxPreTextCtrl:val._setOORInfo(val)"
549 long GetInsertionPoint();
550 long GetLastPosition();
551 int GetLineLength(long lineNo);
552 wxString GetLineText(long lineNo);
553 int GetNumberOfLines();
556 bool LoadFile(const wxString& filename);
558 void PositionToXY(long pos, long *OUTPUT, long *OUTPUT);
559 void Remove(long from, long to);
560 void Replace(long from, long to, const wxString& value);
561 bool SaveFile(const wxString& filename);
562 void SetEditable(bool editable);
563 void SetInsertionPoint(long pos);
564 void SetInsertionPointEnd();
565 void SetSelection(long from, long to);
566 void SetValue(const wxString& value);
567 void ShowPosition(long pos);
568 void WriteText(const wxString& text);
569 void AppendText(const wxString& text);
570 long XYToPosition(long x, long y);
577 void GetSelection(long* OUTPUT, long* OUTPUT);
582 bool SetStyle(long start, long end, const wxTextAttr& style);
583 bool SetDefaultStyle(const wxTextAttr& style);
584 const wxTextAttr& GetDefaultStyle() const;
586 void SetMaxLength(unsigned long len);
589 void write(const wxString& text) {
590 self->AppendText(text);
595 //----------------------------------------------------------------------
597 class wxScrollBar : public wxControl {
599 wxScrollBar(wxWindow* parent, wxWindowID id = -1,
600 const wxPoint& pos = wxDefaultPosition,
601 const wxSize& size = wxDefaultSize,
602 long style = wxSB_HORIZONTAL,
603 const wxValidator& validator = wxDefaultValidator,
604 char* name = "scrollBar");
605 %name(wxPreScrollBar)wxScrollBar();
607 bool Create(wxWindow* parent, wxWindowID id = -1,
608 const wxPoint& pos = wxDefaultPosition,
609 const wxSize& size = wxDefaultSize,
610 long style = wxSB_HORIZONTAL,
611 const wxValidator& validator = wxDefaultValidator,
612 char* name = "scrollBar");
614 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
615 %pragma(python) addtomethod = "wxPreScrollBar:val._setOORInfo(val)"
619 int GetThumbPosition();
621 %name(GetThumbLength) int GetThumbSize(); // to match the docs
622 void SetThumbPosition(int viewStart);
623 void SetScrollbar(int position, int thumbSize,
624 int range, int pageSize,
625 bool refresh = TRUE);
628 //----------------------------------------------------------------------
630 class wxSpinButton : public wxControl {
632 wxSpinButton(wxWindow* parent, wxWindowID id = -1,
633 const wxPoint& pos = wxDefaultPosition,
634 const wxSize& size = wxDefaultSize,
635 long style = wxSP_HORIZONTAL,
636 char* name = "spinButton");
637 %name(wxPreSpinButton)wxSpinButton();
639 bool Create(wxWindow* parent, wxWindowID id = -1,
640 const wxPoint& pos = wxDefaultPosition,
641 const wxSize& size = wxDefaultSize,
642 long style = wxSP_HORIZONTAL,
643 char* name = "spinButton");
645 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
646 %pragma(python) addtomethod = "wxPreSpinButton:val._setOORInfo(val)"
651 void SetRange(int min, int max);
652 void SetValue(int value);
655 //----------------------------------------------------------------------
657 class wxStaticBitmap : public wxControl {
659 wxStaticBitmap(wxWindow* parent, wxWindowID id,
660 const wxBitmap& bitmap,
661 const wxPoint& pos = wxDefaultPosition,
662 const wxSize& size = wxDefaultSize,
664 char* name = "staticBitmap");
665 %name(wxPreStaticBitmap)wxStaticBitmap();
667 bool Create(wxWindow* parent, wxWindowID id,
668 const wxBitmap& bitmap,
669 const wxPoint& pos = wxDefaultPosition,
670 const wxSize& size = wxDefaultSize,
672 char* name = "staticBitmap");
674 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
675 %pragma(python) addtomethod = "wxPreStaticBitmap:val._setOORInfo(val)"
677 const wxBitmap& GetBitmap();
678 void SetBitmap(const wxBitmap& bitmap);
679 void SetIcon(const wxIcon& icon);
682 //----------------------------------------------------------------------
684 class wxRadioBox : public wxControl {
686 wxRadioBox(wxWindow* parent, wxWindowID id,
687 const wxString& label,
688 const wxPoint& point = wxDefaultPosition,
689 const wxSize& size = wxDefaultSize,
690 int LCOUNT = 0, wxString* choices = NULL,
691 int majorDimension = 0,
692 long style = wxRA_HORIZONTAL,
693 const wxValidator& validator = wxDefaultValidator,
694 char* name = "radioBox");
695 %name(wxPreRadioBox)wxRadioBox();
697 bool Create(wxWindow* parent, wxWindowID id,
698 const wxString& label,
699 const wxPoint& point = wxDefaultPosition,
700 const wxSize& size = wxDefaultSize,
701 int LCOUNT = 0, wxString* choices = NULL,
702 int majorDimension = 0,
703 long style = wxRA_HORIZONTAL,
704 const wxValidator& validator = wxDefaultValidator,
705 char* name = "radioBox");
707 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
708 %pragma(python) addtomethod = "wxPreRadioBox:val._setOORInfo(val)"
710 void Enable(bool enable);
711 %name(EnableItem)void Enable(int n, bool enable);
712 int FindString(const wxString& string);
714 wxString GetString(int n);
717 void SetString(int n, const wxString& label);
718 %pragma(python) addtoclass = "
719 GetItemLabel = GetString
720 SetItemLabel = SetString
722 int GetColumnCount();
725 %name(GetItemLabel)wxString GetLabel( int item );
726 %name(SetItemLabel)void SetLabel( int item, const wxString& label );
730 wxString GetStringSelection();
732 %pragma(python) addtoclass = "Number = GetCount"
734 void SetSelection(int n);
735 void SetStringSelection(const wxString& string);
736 void Show(bool show);
737 %name(ShowItem)void Show(int item, bool show);
740 //----------------------------------------------------------------------
742 class wxRadioButton : public wxControl {
744 wxRadioButton(wxWindow* parent, wxWindowID id,
745 const wxString& label,
746 const wxPoint& pos = wxDefaultPosition,
747 const wxSize& size = wxDefaultSize,
749 const wxValidator& validator = wxDefaultValidator,
750 char* name = "radioButton");
751 %name(wxPreRadioButton)wxRadioButton();
753 bool Create(wxWindow* parent, wxWindowID id,
754 const wxString& label,
755 const wxPoint& pos = wxDefaultPosition,
756 const wxSize& size = wxDefaultSize,
758 const wxValidator& validator = wxDefaultValidator,
759 char* name = "radioButton");
761 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
762 %pragma(python) addtomethod = "wxPreRadioButton:val._setOORInfo(val)"
765 void SetValue(bool value);
768 //----------------------------------------------------------------------
770 class wxSlider : public wxControl {
772 wxSlider(wxWindow* parent, wxWindowID id,
773 int value, int minValue, int maxValue,
774 const wxPoint& point = wxDefaultPosition,
775 const wxSize& size = wxDefaultSize,
776 long style = wxSL_HORIZONTAL,
777 const wxValidator& validator = wxDefaultValidator,
778 char* name = "slider");
779 %name(wxPreSlider)wxSlider();
781 bool Create(wxWindow* parent, wxWindowID id,
782 int value, int minValue, int maxValue,
783 const wxPoint& point = wxDefaultPosition,
784 const wxSize& size = wxDefaultSize,
785 long style = wxSL_HORIZONTAL,
786 const wxValidator& validator = wxDefaultValidator,
787 char* name = "slider");
789 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
790 %pragma(python) addtomethod = "wxPreSlider:val._setOORInfo(val)"
800 int GetThumbLength();
803 void SetRange(int minValue, int maxValue);
804 void SetTickFreq(int n, int pos);
805 void SetLineSize(int lineSize);
806 void SetPageSize(int pageSize);
807 void SetSelection(int startPos, int endPos);
808 void SetThumbLength(int len);
809 void SetTick(int tickPos);
810 void SetValue(int value);
814 //----------------------------------------------------------------------
816 class wxSpinCtrl : public wxSpinButton {
818 wxSpinCtrl(wxWindow *parent,
820 const char* value = "",
821 const wxPoint& pos = wxDefaultPosition,
822 const wxSize& size = wxDefaultSize,
823 long style = wxSP_ARROW_KEYS,
824 int min = 0, int max = 100, int initial = 0,
825 const char* name = "wxSpinCtrl");
826 %name(wxPreSpinCtrl)wxSpinCtrl();
828 bool Create(wxWindow *parent,
830 const char* value = "",
831 const wxPoint& pos = wxDefaultPosition,
832 const wxSize& size = wxDefaultSize,
833 long style = wxSP_ARROW_KEYS,
834 int min = 0, int max = 100, int initial = 0,
835 const char* name = "wxSpinCtrl");
837 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
838 %pragma(python) addtomethod = "wxPreSpinCtrl:val._setOORInfo(val)"
843 void SetRange(int min, int max);
844 void SetValue(int value);
849 //----------------------------------------------------------------------
851 enum { wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, };
853 class wxToggleButton : public wxControl {
855 wxToggleButton(wxWindow *parent,
857 const wxString& label,
858 const wxPoint& pos = wxDefaultPosition,
859 const wxSize& size = wxDefaultSize,
861 const wxValidator& validator = wxDefaultValidator,
862 const char* name = "toggle");
863 %name(wxPreToggleButton)wxToggleButton();
865 bool Create(wxWindow *parent,
867 const wxString& label,
868 const wxPoint& pos = wxDefaultPosition,
869 const wxSize& size = wxDefaultSize,
871 const wxValidator& validator = wxDefaultValidator,
872 const char* name = "toggle");
874 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
875 %pragma(python) addtomethod = "wxPreToggleButton:val._setOORInfo(val)"
877 void SetValue(bool value);
878 bool GetValue() const ;
879 void SetLabel(const wxString& label);
883 //----------------------------------------------------------------------
884 //----------------------------------------------------------------------
885 //----------------------------------------------------------------------