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>
35 //----------------------------------------------------------------------
38 %include my_typemaps.i
40 // Import some definitions of other classes, etc.
47 %pragma(python) code = "import wx"
49 //----------------------------------------------------------------------
52 wxValidator wxDefaultValidator;
55 //----------------------------------------------------------------------
58 // This is the base class for a control or 'widget'.
60 // A control is generally a small window which processes user input and/or
61 // displays one or more item of data.
62 class wxControl : public wxWindow {
66 wxControl(wxWindow *parent,
68 const wxPoint& pos=wxDefaultPosition,
69 const wxSize& size=wxDefaultSize,
71 const wxValidator& validator=wxDefaultValidator,
72 const char* name="control");
75 %name(wxPreControl)wxControl();
78 bool Create(wxWindow *parent,
80 const wxPoint& pos=wxDefaultPosition,
81 const wxSize& size=wxDefaultSize,
83 const wxValidator& validator=wxDefaultValidator,
84 const char* name="control");
86 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
87 %pragma(python) addtomethod = "wxPreControl:val._setOORInfo(val)"
89 // Simulates the effect of the user issuing a command to the item. See
91 void Command(wxCommandEvent& event);
93 // Return a control's text.
96 // Sets the item's text.
97 void SetLabel(const wxString& label);
101 //----------------------------------------------------------------------
104 class wxControlWithItems : public wxControl {
107 // void Clear(); ambiguous, redefine below...
109 // Deletes an item from the control
112 // Returns the number of items in the control.
114 %pragma(python) addtoclass = "Number = GetCount"
116 // Returns the string at the given position.
117 wxString GetString(int n);
119 // Sets the string value of an item.
120 void SetString(int n, const wxString& s);
122 // Finds an item matching the given string. Returns the zero-based
123 // position of the item, or -1 if the string was not found.
124 int FindString(const wxString& s);
126 // Select the item at postion n.
129 // Gets the position of the selected item.
132 // Gets the current selection as a string.
133 wxString GetStringSelection() const;
135 // void Append(const wxString& item);
136 // void Append(const wxString& item, char* clientData);
137 // char* GetClientData(const int n);
138 // void SetClientData(const int n, char* data);
142 // Adds the item to the control, associating the given data with the
144 void Append(const wxString& item, PyObject* clientData=NULL) {
146 wxPyClientData* data = new wxPyClientData(clientData);
147 self->Append(item, data);
152 // Returns the client data associated with the given item, (if any.)
153 PyObject* GetClientData(int n) {
154 wxPyClientData* data = (wxPyClientData*)self->GetClientObject(n);
156 Py_INCREF(data->m_obj);
164 // Associate the given client data with the item at position n.
165 void SetClientData(int n, PyObject* clientData) {
166 wxPyClientData* data = new wxPyClientData(clientData);
167 self->SetClientObject(n, data);
173 //----------------------------------------------------------------------
175 // A button is a control that contains a text string, and is one of the most
176 // common elements of a GUI. It may be placed on a dialog box or panel, or
177 // indeed almost any other window.
180 // wxBU_LEFT: Left-justifies the label. WIN32 only.
181 // wxBU_TOP: Aligns the label to the top of the button. WIN32 only.
182 // wxBU_RIGHT: Right-justifies the bitmap label. WIN32 only.
183 // wxBU_BOTTOM: Aligns the label to the bottom of the button. WIN32 only.
184 // wxBU_EXACTFIT: Creates the button as small as possible instead of making
185 // it of the standard size (which is the default behaviour.)
188 // EVT_BUTTON(win,id,func):
189 // Sent when the button is clicked.
191 class wxButton : public wxControl {
193 // Constructor, creating and showing a button.
195 // parent: Parent window. Must not be None.
196 // id: Button identifier. A value of -1 indicates a default value.
197 // label: The text to be displayed on the button.
198 // pos: The button position on it's parent.
199 // size: Button size. If the default size (-1, -1) is specified then the
200 // button is sized appropriately for the text.
201 // style: Window style. See wxButton.
202 // validator: Window validator.
203 // name: Window name.
204 wxButton(wxWindow* parent, wxWindowID id, const wxString& label,
205 const wxPoint& pos = wxDefaultPosition,
206 const wxSize& size = wxDefaultSize,
208 const wxValidator& validator = wxDefaultValidator,
209 char* name = "button");
211 // Default constructor
212 %name(wxPreButton)wxButton();
214 // Button creation function for two-step creation.
215 bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
216 const wxPoint& pos = wxDefaultPosition,
217 const wxSize& size = wxDefaultSize,
219 const wxValidator& validator = wxDefaultValidator,
220 char* name = "button");
222 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
223 %pragma(python) addtomethod = "wxPreButton:val._setOORInfo(val)"
225 // This sets the button to be the default item for the panel or dialog box.
227 // Under Windows, only dialog box buttons respond to this function. As
228 // normal under Windows and Motif, pressing return causes the default
229 // button to be depressed when the return key is pressed. See also
230 // wxWindow.SetFocus which sets the keyboard focus for windows and text
231 // panel items, and wxPanel.SetDefaultItem.
235 void SetBackgroundColour(const wxColour& colour);
237 void SetForegroundColour(const wxColour& colour);
240 // show the image in the button in addition to the label
241 void SetImageLabel(const wxBitmap& bitmap);
243 // set the margins around the image
244 void SetImageMargins(wxCoord x, wxCoord y);
247 // returns the default button size for this platform
248 static wxSize GetDefaultSize();
251 //----------------------------------------------------------------------
253 class wxBitmapButton : public wxButton {
255 wxBitmapButton(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap,
256 const wxPoint& pos = wxDefaultPosition,
257 const wxSize& size = wxDefaultSize,
258 long style = wxBU_AUTODRAW,
259 const wxValidator& validator = wxDefaultValidator,
260 char* name = "button");
261 %name(wxPreBitmapButton)wxBitmapButton();
263 bool Create(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap,
264 const wxPoint& pos = wxDefaultPosition,
265 const wxSize& size = wxDefaultSize,
266 long style = wxBU_AUTODRAW,
267 const wxValidator& validator = wxDefaultValidator,
268 char* name = "button");
270 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
271 %pragma(python) addtomethod = "wxPreBitmapButton:val._setOORInfo(val)"
273 wxBitmap GetBitmapLabel();
274 wxBitmap GetBitmapDisabled();
275 wxBitmap GetBitmapFocus();
276 wxBitmap GetBitmapSelected();
277 void SetBitmapDisabled(const wxBitmap& bitmap);
278 void SetBitmapFocus(const wxBitmap& bitmap);
279 void SetBitmapSelected(const wxBitmap& bitmap);
280 void SetBitmapLabel(const wxBitmap& bitmap);
282 void SetMargins(int x, int y) { m_marginX = x; m_marginY = y; }
283 int GetMarginX() const { return m_marginX; }
284 int GetMarginY() const { return m_marginY; }
287 //----------------------------------------------------------------------
289 class wxCheckBox : public wxControl {
291 wxCheckBox(wxWindow* parent, wxWindowID id, const wxString& label,
292 const wxPoint& pos = wxDefaultPosition,
293 const wxSize& size = wxDefaultSize,
295 const wxValidator& val = wxDefaultValidator,
296 char* name = "checkBox");
297 %name(wxPreCheckBox)wxCheckBox();
299 bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
300 const wxPoint& pos = wxDefaultPosition,
301 const wxSize& size = wxDefaultSize,
303 const wxValidator& val = wxDefaultValidator,
304 char* name = "checkBox");
306 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
307 %pragma(python) addtomethod = "wxPreCheckBox:val._setOORInfo(val)"
310 void SetValue(const bool state);
313 //----------------------------------------------------------------------
315 class wxChoice : public wxControlWithItems {
317 wxChoice(wxWindow *parent, wxWindowID id,
318 const wxPoint& pos = wxDefaultPosition,
319 const wxSize& size = wxDefaultSize,
320 int LCOUNT=0, wxString* choices=NULL,
322 const wxValidator& validator = wxDefaultValidator,
323 char* name = "choice");
324 %name(wxPreChoice)wxChoice();
326 bool Create(wxWindow *parent, wxWindowID id,
327 const wxPoint& pos = wxDefaultPosition,
328 const wxSize& size = wxDefaultSize,
329 int LCOUNT=0, wxString* choices=NULL,
331 const wxValidator& validator = wxDefaultValidator,
332 char* name = "choice");
334 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
335 %pragma(python) addtomethod = "wxPreChoice:val._setOORInfo(val)"
340 void SetColumns(const int n = 1);
341 void SetSelection(const int n);
342 void SetStringSelection(const wxString& string);
343 void SetString(int n, const wxString& s);
345 %pragma(python) addtoclass = "
346 Select = SetSelection
350 //----------------------------------------------------------------------
352 // wxGTK's wxComboBox doesn't derive from wxChoice like wxMSW, or
353 // even wxControlWithItems, so we have to duplicate the methods
357 class wxComboBox : public wxControl
360 wxComboBox(wxWindow* parent, wxWindowID id, char* value = "",
361 const wxPoint& pos = wxDefaultPosition,
362 const wxSize& size = wxDefaultSize,
363 int LCOUNT=0, wxString* choices=NULL,
365 const wxValidator& validator = wxDefaultValidator,
366 char* name = "comboBox");
367 %name(wxPreComboBox)wxComboBox();
369 bool Create(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");
377 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
378 %pragma(python) addtomethod = "wxPreComboBox:val._setOORInfo(val)"
382 long GetInsertionPoint();
383 long GetLastPosition();
386 void Replace(long from, long to, const wxString& text);
387 void Remove(long from, long to);
388 void SetInsertionPoint(long pos);
389 void SetInsertionPointEnd();
390 void SetSelection(int n);
391 %name(SetMark)void SetSelection(long from, long to);
392 void SetValue(const wxString& text);
393 void SetEditable(bool editable);
400 %pragma(python) addtoclass = "Number = GetCount"
401 wxString GetString(int n);
402 int FindString(const wxString& s);
404 //void SetString(int n, const wxString& s); *** No equivalent for wxGTK!!!
406 // void Select(int n);
407 %pragma(python) addtoclass = "Select = SetSelection"
410 wxString GetStringSelection() const;
412 // void Append(const wxString& item);
413 // void Append(const wxString& item, char* clientData);
414 // char* GetClientData(const int n);
415 // void SetClientData(const int n, char* data);
417 void Append(const wxString& item, PyObject* clientData=NULL) {
419 wxPyClientData* data = new wxPyClientData(clientData);
420 self->Append(item, data);
425 PyObject* GetClientData(int n) {
426 wxPyClientData* data = (wxPyClientData*)self->GetClientObject(n);
428 Py_INCREF(data->m_obj);
436 void SetClientData(int n, PyObject* clientData) {
437 wxPyClientData* data = new wxPyClientData(clientData);
438 self->SetClientObject(n, data);
446 #else // For all but wxGTK
449 class wxComboBox : public wxChoice {
451 wxComboBox(wxWindow* parent, wxWindowID id, char* value = "",
452 const wxPoint& pos = wxDefaultPosition,
453 const wxSize& size = wxDefaultSize,
454 int LCOUNT=0, wxString* choices=NULL,
456 const wxValidator& validator = wxDefaultValidator,
457 char* name = "comboBox");
458 %name(wxPreComboBox)wxComboBox();
460 bool Create(wxWindow* parent, wxWindowID id, char* value = "",
461 const wxPoint& pos = wxDefaultPosition,
462 const wxSize& size = wxDefaultSize,
463 int LCOUNT=0, wxString* choices=NULL,
465 const wxValidator& validator = wxDefaultValidator,
466 char* name = "comboBox");
468 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
469 %pragma(python) addtomethod = "wxPreComboBox:val._setOORInfo(val)"
473 long GetInsertionPoint();
474 long GetLastPosition();
477 void Replace(long from, long to, const wxString& text);
478 void Remove(long from, long to);
479 void SetInsertionPoint(long pos);
480 void SetInsertionPointEnd();
481 void SetSelection(int n);
482 %name(SetMark)void SetSelection(long from, long to);
483 void SetValue(const wxString& text);
484 void SetEditable(bool editable);
489 //----------------------------------------------------------------------
491 class wxGauge : public wxControl {
493 wxGauge(wxWindow* parent, wxWindowID id, int range,
494 const wxPoint& pos = wxDefaultPosition,
495 const wxSize& size = wxDefaultSize,
496 long style = wxGA_HORIZONTAL,
497 const wxValidator& validator = wxDefaultValidator,
498 char* name = "gauge");
499 %name(wxPreGauge)wxGauge();
501 bool Create(wxWindow* parent, wxWindowID id, int range,
502 const wxPoint& pos = wxDefaultPosition,
503 const wxSize& size = wxDefaultSize,
504 long style = wxGA_HORIZONTAL,
505 const wxValidator& validator = wxDefaultValidator,
506 char* name = "gauge");
508 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
509 %pragma(python) addtomethod = "wxPreGauge:val._setOORInfo(val)"
513 int GetShadowWidth();
515 void SetBezelFace(int width);
516 void SetRange(int range);
517 void SetShadowWidth(int width);
518 void SetValue(int pos);
521 //----------------------------------------------------------------------
523 class wxStaticBox : public wxControl {
525 wxStaticBox(wxWindow* parent, wxWindowID id, const wxString& label,
526 const wxPoint& pos = wxDefaultPosition,
527 const wxSize& size = wxDefaultSize,
529 char* name = "staticBox");
530 %name(wxPreStaticBox)wxStaticBox();
532 bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
533 const wxPoint& pos = wxDefaultPosition,
534 const wxSize& size = wxDefaultSize,
536 char* name = "staticBox");
538 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
539 %pragma(python) addtomethod = "wxPreStaticBox:val._setOORInfo(val)"
543 //----------------------------------------------------------------------
546 class wxStaticLine : public wxControl {
548 wxStaticLine( wxWindow *parent, wxWindowID id,
549 const wxPoint &pos = wxDefaultPosition,
550 const wxSize &size = wxDefaultSize,
551 long style = wxLI_HORIZONTAL,
552 const char* name = "staticLine" );
553 %name(wxPreStaticLine)wxStaticLine();
555 bool Create( wxWindow *parent, wxWindowID id,
556 const wxPoint &pos = wxDefaultPosition,
557 const wxSize &size = wxDefaultSize,
558 long style = wxLI_HORIZONTAL,
559 const char* name = "staticLine" );
561 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
562 %pragma(python) addtomethod = "wxPreStaticLine:val._setOORInfo(val)"
566 //----------------------------------------------------------------------
568 class wxStaticText : public wxControl {
570 wxStaticText(wxWindow* parent, wxWindowID id, const wxString& label,
571 const wxPoint& pos = wxDefaultPosition,
572 const wxSize& size = wxDefaultSize,
574 char* name = "staticText");
575 %name(wxPreStaticText)wxStaticText();
577 bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
578 const wxPoint& pos = wxDefaultPosition,
579 const wxSize& size = wxDefaultSize,
581 char* name = "staticText");
583 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
584 %pragma(python) addtomethod = "wxPreStaticText:val._setOORInfo(val)"
587 void SetLabel(const wxString& label);
590 //----------------------------------------------------------------------
592 class wxListBox : public wxControlWithItems {
594 wxListBox(wxWindow* parent, wxWindowID id,
595 const wxPoint& pos = wxDefaultPosition,
596 const wxSize& size = wxDefaultSize,
597 int LCOUNT, wxString* choices = NULL,
599 const wxValidator& validator = wxDefaultValidator,
600 char* name = "listBox");
601 %name(wxPreListBox)wxListBox();
603 bool Create(wxWindow* parent, wxWindowID id,
604 const wxPoint& pos = wxDefaultPosition,
605 const wxSize& size = wxDefaultSize,
606 int LCOUNT, wxString* choices = NULL,
608 const wxValidator& validator = wxDefaultValidator,
609 char* name = "listBox");
611 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
612 %pragma(python) addtomethod = "wxPreListBox:val._setOORInfo(val)"
615 void Deselect(int n);
617 // int GetSelections(int **selections);
619 PyObject* GetSelections() {
621 self->GetSelections(lst);
622 PyObject *tup = PyTuple_New(lst.GetCount());
623 for(size_t i=0; i<lst.GetCount(); i++) {
624 PyTuple_SetItem(tup, i, PyInt_FromLong(lst[i]));
631 void InsertItems(int LCOUNT, wxString* choices, int pos);
633 bool IsSelected(const int n);
634 bool Selected(const int n);
635 void Set(int LCOUNT, wxString* choices);
636 void SetFirstItem(int n);
637 %name(SetFirstItemStr)void SetFirstItem(const wxString& string);
638 void SetSelection(int n, bool select = TRUE);
639 void SetString(int n, const wxString& string);
640 void SetStringSelection(const wxString& string, bool select = TRUE);
644 //----------------------------------------------------------------------
646 class wxCheckListBox : public wxListBox {
648 wxCheckListBox(wxWindow *parent, wxWindowID id,
649 const wxPoint& pos = wxDefaultPosition,
650 const wxSize& size = wxDefaultSize,
652 wxString* choices = NULL,
654 const wxValidator& validator = wxDefaultValidator,
655 char* name = "listBox");
656 %name(wxPreCheckListBox)wxCheckListBox();
658 bool Create(wxWindow *parent, wxWindowID id,
659 const wxPoint& pos = wxDefaultPosition,
660 const wxSize& size = wxDefaultSize,
662 wxString* choices = NULL,
664 const wxValidator& validator = wxDefaultValidator,
665 char* name = "listBox");
667 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
668 %pragma(python) addtomethod = "wxPreCheckListBox:val._setOORInfo(val)"
670 bool IsChecked(int uiIndex);
671 void Check(int uiIndex, int bCheck = TRUE);
672 void InsertItems(int LCOUNT, wxString* choices, int pos);
679 //----------------------------------------------------------------------
686 wxTextAttr(const wxColour& colText = wxNullColour,
687 const wxColour& colBack = wxNullColour,
688 const wxFont& font = wxNullFont);
692 void SetTextColour(const wxColour& colText);
693 void SetBackgroundColour(const wxColour& colBack);
694 void SetFont(const wxFont& font);
697 bool HasTextColour() const;
698 bool HasBackgroundColour() const;
699 bool HasFont() const;
701 wxColour GetTextColour() const;
702 wxColour GetBackgroundColour() const;
703 wxFont GetFont() const;
705 // returns false if we have any attributes set, true otherwise
708 // return the attribute having the valid font and colours: it uses the
709 // attributes set in attr and falls back first to attrDefault and then to
710 // the text control font/colours for those attributes which are not set
711 static wxTextAttr Combine(const wxTextAttr& attr,
712 const wxTextAttr& attrDef,
713 const wxTextCtrl *text);
718 class wxTextCtrl : public wxControl {
720 wxTextCtrl(wxWindow* parent, wxWindowID id, char* value = "",
721 const wxPoint& pos = wxDefaultPosition,
722 const wxSize& size = wxDefaultSize,
724 const wxValidator& validator = wxDefaultValidator,
725 char* name = "text");
726 %name(wxPreTextCtrl)wxTextCtrl();
728 bool Create(wxWindow* parent, wxWindowID id, char* value = "",
729 const wxPoint& pos = wxDefaultPosition,
730 const wxSize& size = wxDefaultSize,
732 const wxValidator& validator = wxDefaultValidator,
733 char* name = "text");
735 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
736 %pragma(python) addtomethod = "wxPreTextCtrl:val._setOORInfo(val)"
739 wxString GetValue() const;
740 void SetValue(const wxString& value);
742 wxString GetRange(long from, long to);
744 int GetLineLength(long lineNo) const;
745 wxString GetLineText(long lineNo) const;
746 int GetNumberOfLines() const;
748 bool IsModified() const;
749 bool IsEditable() const;
751 // If the return values from and to are the same, there is no selection.
752 void GetSelection(long* OUTPUT, long* OUTPUT) const;
753 wxString GetStringSelection();
756 void Replace(long from, long to, const wxString& value);
757 void Remove(long from, long to);
759 // load/save the controls contents from/to the file
760 bool LoadFile(const wxString& file);
761 bool SaveFile(const wxString& file = wxEmptyString);
763 // clears the dirty flag
766 // set the max number of characters which may be entered in a single line
768 void SetMaxLength(unsigned long len);
770 // writing text inserts it at the current position, appending always
771 // inserts it at the end
772 void WriteText(const wxString& text);
773 void AppendText(const wxString& text);
775 // text control under some platforms supports the text styles: these
776 // methods allow to apply the given text style to the given selection or to
777 // set/get the style which will be used for all appended text
778 bool SetStyle(long start, long end, const wxTextAttr& style);
779 bool SetDefaultStyle(const wxTextAttr& style);
780 const wxTextAttr& GetDefaultStyle() const;
782 // translate between the position (which is just an index in the text ctrl
783 // considering all its contents as a single strings) and (x, y) coordinates
784 // which represent column and line.
785 long XYToPosition(long x, long y) const;
786 void PositionToXY(long pos, long *OUTPUT, long *OUTPUT) const;
788 //bool PositionToXY(long pos, long *OUTPUT, long *OUTPUT) const;
789 // TODO: check return value, raise exception.
791 void ShowPosition(long pos);
793 // Clipboard operations
798 bool CanCopy() const;
800 bool CanPaste() const;
806 bool CanUndo() const;
807 bool CanRedo() const;
810 void SetInsertionPoint(long pos);
811 void SetInsertionPointEnd();
812 long GetInsertionPoint() const;
813 long GetLastPosition() const;
815 void SetSelection(long from, long to);
817 void SetEditable(bool editable);
820 void write(const wxString& text) {
821 self->AppendText(text);
825 // TODO: replace this when the method is really added to wxTextCtrl
827 wxString GetString(long from, long to) {
828 return self->GetValue().Mid(from, to-from);
833 //----------------------------------------------------------------------
835 class wxScrollBar : public wxControl {
837 wxScrollBar(wxWindow* parent, wxWindowID id = -1,
838 const wxPoint& pos = wxDefaultPosition,
839 const wxSize& size = wxDefaultSize,
840 long style = wxSB_HORIZONTAL,
841 const wxValidator& validator = wxDefaultValidator,
842 char* name = "scrollBar");
843 %name(wxPreScrollBar)wxScrollBar();
845 bool Create(wxWindow* parent, wxWindowID id = -1,
846 const wxPoint& pos = wxDefaultPosition,
847 const wxSize& size = wxDefaultSize,
848 long style = wxSB_HORIZONTAL,
849 const wxValidator& validator = wxDefaultValidator,
850 char* name = "scrollBar");
852 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
853 %pragma(python) addtomethod = "wxPreScrollBar:val._setOORInfo(val)"
857 int GetThumbPosition();
859 %name(GetThumbLength) int GetThumbSize(); // to match the docs
863 void SetThumbPosition(int viewStart);
864 void SetScrollbar(int position, int thumbSize,
865 int range, int pageSize,
866 bool refresh = TRUE);
869 //----------------------------------------------------------------------
871 class wxSpinButton : public wxControl {
873 wxSpinButton(wxWindow* parent, wxWindowID id = -1,
874 const wxPoint& pos = wxDefaultPosition,
875 const wxSize& size = wxDefaultSize,
876 long style = wxSP_HORIZONTAL,
877 char* name = "spinButton");
878 %name(wxPreSpinButton)wxSpinButton();
880 bool Create(wxWindow* parent, wxWindowID id = -1,
881 const wxPoint& pos = wxDefaultPosition,
882 const wxSize& size = wxDefaultSize,
883 long style = wxSP_HORIZONTAL,
884 char* name = "spinButton");
886 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
887 %pragma(python) addtomethod = "wxPreSpinButton:val._setOORInfo(val)"
892 void SetRange(int min, int max);
893 void SetValue(int value);
896 //----------------------------------------------------------------------
898 class wxStaticBitmap : public wxControl {
900 wxStaticBitmap(wxWindow* parent, wxWindowID id,
901 const wxBitmap& bitmap,
902 const wxPoint& pos = wxDefaultPosition,
903 const wxSize& size = wxDefaultSize,
905 char* name = "staticBitmap");
906 %name(wxPreStaticBitmap)wxStaticBitmap();
908 bool Create(wxWindow* parent, wxWindowID id,
909 const wxBitmap& bitmap,
910 const wxPoint& pos = wxDefaultPosition,
911 const wxSize& size = wxDefaultSize,
913 char* name = "staticBitmap");
915 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
916 %pragma(python) addtomethod = "wxPreStaticBitmap:val._setOORInfo(val)"
918 wxBitmap GetBitmap();
919 void SetBitmap(const wxBitmap& bitmap);
920 void SetIcon(const wxIcon& icon);
923 //----------------------------------------------------------------------
925 class wxRadioBox : public wxControl {
927 wxRadioBox(wxWindow* parent, wxWindowID id,
928 const wxString& label,
929 const wxPoint& point = wxDefaultPosition,
930 const wxSize& size = wxDefaultSize,
931 int LCOUNT = 0, wxString* choices = NULL,
932 int majorDimension = 0,
933 long style = wxRA_HORIZONTAL,
934 const wxValidator& validator = wxDefaultValidator,
935 char* name = "radioBox");
936 %name(wxPreRadioBox)wxRadioBox();
938 bool Create(wxWindow* parent, wxWindowID id,
939 const wxString& label,
940 const wxPoint& point = wxDefaultPosition,
941 const wxSize& size = wxDefaultSize,
942 int LCOUNT = 0, wxString* choices = NULL,
943 int majorDimension = 0,
944 long style = wxRA_HORIZONTAL,
945 const wxValidator& validator = wxDefaultValidator,
946 char* name = "radioBox");
948 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
949 %pragma(python) addtomethod = "wxPreRadioBox:val._setOORInfo(val)"
951 void Enable(bool enable);
952 %name(EnableItem)void Enable(int n, bool enable);
953 int FindString(const wxString& string);
955 wxString GetString(int n);
958 %name(GetItemLabel)wxString GetLabel( int item );
959 %name(SetItemLabel)void SetLabel( int item, const wxString& label );
961 void SetString(int n, const wxString& label);
962 %pragma(python) addtoclass = "
963 GetItemLabel = GetString
964 SetItemLabel = SetString
966 int GetColumnCount();
971 wxString GetStringSelection();
973 %pragma(python) addtoclass = "Number = GetCount"
975 void SetSelection(int n);
976 void SetStringSelection(const wxString& string);
977 void Show(bool show);
978 %name(ShowItem)void Show(int item, bool show);
981 //----------------------------------------------------------------------
983 class wxRadioButton : public wxControl {
985 wxRadioButton(wxWindow* parent, wxWindowID id,
986 const wxString& label,
987 const wxPoint& pos = wxDefaultPosition,
988 const wxSize& size = wxDefaultSize,
990 const wxValidator& validator = wxDefaultValidator,
991 char* name = "radioButton");
992 %name(wxPreRadioButton)wxRadioButton();
994 bool Create(wxWindow* parent, wxWindowID id,
995 const wxString& label,
996 const wxPoint& pos = wxDefaultPosition,
997 const wxSize& size = wxDefaultSize,
999 const wxValidator& validator = wxDefaultValidator,
1000 char* name = "radioButton");
1002 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
1003 %pragma(python) addtomethod = "wxPreRadioButton:val._setOORInfo(val)"
1006 void SetValue(bool value);
1009 //----------------------------------------------------------------------
1011 class wxSlider : public wxControl {
1013 wxSlider(wxWindow* parent, wxWindowID id,
1014 int value, int minValue, int maxValue,
1015 const wxPoint& point = wxDefaultPosition,
1016 const wxSize& size = wxDefaultSize,
1017 long style = wxSL_HORIZONTAL,
1018 const wxValidator& validator = wxDefaultValidator,
1019 char* name = "slider");
1020 %name(wxPreSlider)wxSlider();
1022 bool Create(wxWindow* parent, wxWindowID id,
1023 int value, int minValue, int maxValue,
1024 const wxPoint& point = wxDefaultPosition,
1025 const wxSize& size = wxDefaultSize,
1026 long style = wxSL_HORIZONTAL,
1027 const wxValidator& validator = wxDefaultValidator,
1028 char* name = "slider");
1030 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
1031 %pragma(python) addtomethod = "wxPreSlider:val._setOORInfo(val)"
1041 int GetThumbLength();
1044 void SetRange(int minValue, int maxValue);
1045 void SetTickFreq(int n, int pos);
1046 void SetLineSize(int lineSize);
1047 void SetPageSize(int pageSize);
1048 void SetSelection(int startPos, int endPos);
1049 void SetThumbLength(int len);
1050 void SetTick(int tickPos);
1051 void SetValue(int value);
1055 //----------------------------------------------------------------------
1057 class wxSpinCtrl : public wxSpinButton {
1059 wxSpinCtrl(wxWindow *parent,
1061 const char* value = "",
1062 const wxPoint& pos = wxDefaultPosition,
1063 const wxSize& size = wxDefaultSize,
1064 long style = wxSP_ARROW_KEYS,
1065 int min = 0, int max = 100, int initial = 0,
1066 const char* name = "wxSpinCtrl");
1067 %name(wxPreSpinCtrl)wxSpinCtrl();
1069 bool Create(wxWindow *parent,
1071 const char* value = "",
1072 const wxPoint& pos = wxDefaultPosition,
1073 const wxSize& size = wxDefaultSize,
1074 long style = wxSP_ARROW_KEYS,
1075 int min = 0, int max = 100, int initial = 0,
1076 const char* name = "wxSpinCtrl");
1078 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
1079 %pragma(python) addtomethod = "wxPreSpinCtrl:val._setOORInfo(val)"
1084 void SetRange(int min, int max);
1085 void SetValue(int value);
1090 //----------------------------------------------------------------------
1093 enum { wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, };
1095 class wxToggleButton : public wxControl {
1097 wxToggleButton(wxWindow *parent,
1099 const wxString& label,
1100 const wxPoint& pos = wxDefaultPosition,
1101 const wxSize& size = wxDefaultSize,
1103 const wxValidator& validator = wxDefaultValidator,
1104 const char* name = "toggle");
1105 %name(wxPreToggleButton)wxToggleButton();
1107 bool Create(wxWindow *parent,
1109 const wxString& label,
1110 const wxPoint& pos = wxDefaultPosition,
1111 const wxSize& size = wxDefaultSize,
1113 const wxValidator& validator = wxDefaultValidator,
1114 const char* name = "toggle");
1116 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
1117 %pragma(python) addtomethod = "wxPreToggleButton:val._setOORInfo(val)"
1119 void SetValue(bool value);
1120 bool GetValue() const ;
1121 void SetLabel(const wxString& label);
1127 //----------------------------------------------------------------------
1128 //----------------------------------------------------------------------
1129 //----------------------------------------------------------------------