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);
171 // append several items at once to the control
172 %name(AppendItems)void Append(const wxArrayString& strings);
176 //----------------------------------------------------------------------
178 // A button is a control that contains a text string, and is one of the most
179 // common elements of a GUI. It may be placed on a dialog box or panel, or
180 // indeed almost any other window.
183 // wxBU_LEFT: Left-justifies the label. WIN32 only.
184 // wxBU_TOP: Aligns the label to the top of the button. WIN32 only.
185 // wxBU_RIGHT: Right-justifies the bitmap label. WIN32 only.
186 // wxBU_BOTTOM: Aligns the label to the bottom of the button. WIN32 only.
187 // wxBU_EXACTFIT: Creates the button as small as possible instead of making
188 // it of the standard size (which is the default behaviour.)
191 // EVT_BUTTON(win,id,func):
192 // Sent when the button is clicked.
194 class wxButton : public wxControl {
196 // Constructor, creating and showing a button.
198 // parent: Parent window. Must not be None.
199 // id: Button identifier. A value of -1 indicates a default value.
200 // label: The text to be displayed on the button.
201 // pos: The button position on it's parent.
202 // size: Button size. If the default size (-1, -1) is specified then the
203 // button is sized appropriately for the text.
204 // style: Window style. See wxButton.
205 // validator: Window validator.
206 // name: Window name.
207 wxButton(wxWindow* parent, wxWindowID id, const wxString& label,
208 const wxPoint& pos = wxDefaultPosition,
209 const wxSize& size = wxDefaultSize,
211 const wxValidator& validator = wxDefaultValidator,
212 char* name = "button");
214 // Default constructor
215 %name(wxPreButton)wxButton();
217 // Button creation function for two-step creation.
218 bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
219 const wxPoint& pos = wxDefaultPosition,
220 const wxSize& size = wxDefaultSize,
222 const wxValidator& validator = wxDefaultValidator,
223 char* name = "button");
225 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
226 %pragma(python) addtomethod = "wxPreButton:val._setOORInfo(val)"
228 // This sets the button to be the default item for the panel or dialog box.
230 // Under Windows, only dialog box buttons respond to this function. As
231 // normal under Windows and Motif, pressing return causes the default
232 // button to be depressed when the return key is pressed. See also
233 // wxWindow.SetFocus which sets the keyboard focus for windows and text
234 // panel items, and wxPanel.SetDefaultItem.
238 void SetBackgroundColour(const wxColour& colour);
240 void SetForegroundColour(const wxColour& colour);
243 // show the image in the button in addition to the label
244 void SetImageLabel(const wxBitmap& bitmap);
246 // set the margins around the image
247 void SetImageMargins(wxCoord x, wxCoord y);
250 // returns the default button size for this platform
251 static wxSize GetDefaultSize();
254 //----------------------------------------------------------------------
256 class wxBitmapButton : public wxButton {
258 wxBitmapButton(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap,
259 const wxPoint& pos = wxDefaultPosition,
260 const wxSize& size = wxDefaultSize,
261 long style = wxBU_AUTODRAW,
262 const wxValidator& validator = wxDefaultValidator,
263 char* name = "button");
264 %name(wxPreBitmapButton)wxBitmapButton();
266 bool Create(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap,
267 const wxPoint& pos = wxDefaultPosition,
268 const wxSize& size = wxDefaultSize,
269 long style = wxBU_AUTODRAW,
270 const wxValidator& validator = wxDefaultValidator,
271 char* name = "button");
273 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
274 %pragma(python) addtomethod = "wxPreBitmapButton:val._setOORInfo(val)"
276 wxBitmap GetBitmapLabel();
277 wxBitmap GetBitmapDisabled();
278 wxBitmap GetBitmapFocus();
279 wxBitmap GetBitmapSelected();
280 void SetBitmapDisabled(const wxBitmap& bitmap);
281 void SetBitmapFocus(const wxBitmap& bitmap);
282 void SetBitmapSelected(const wxBitmap& bitmap);
283 void SetBitmapLabel(const wxBitmap& bitmap);
285 void SetMargins(int x, int y) { m_marginX = x; m_marginY = y; }
286 int GetMarginX() const { return m_marginX; }
287 int GetMarginY() const { return m_marginY; }
290 //----------------------------------------------------------------------
292 class wxCheckBox : public wxControl {
294 wxCheckBox(wxWindow* parent, wxWindowID id, const wxString& label,
295 const wxPoint& pos = wxDefaultPosition,
296 const wxSize& size = wxDefaultSize,
298 const wxValidator& val = wxDefaultValidator,
299 char* name = "checkBox");
300 %name(wxPreCheckBox)wxCheckBox();
302 bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
303 const wxPoint& pos = wxDefaultPosition,
304 const wxSize& size = wxDefaultSize,
306 const wxValidator& val = wxDefaultValidator,
307 char* name = "checkBox");
309 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
310 %pragma(python) addtomethod = "wxPreCheckBox:val._setOORInfo(val)"
313 void SetValue(const bool state);
316 //----------------------------------------------------------------------
318 class wxChoice : public wxControlWithItems {
320 wxChoice(wxWindow *parent, wxWindowID id,
321 const wxPoint& pos = wxDefaultPosition,
322 const wxSize& size = wxDefaultSize,
323 int LCOUNT=0, wxString* choices=NULL,
325 const wxValidator& validator = wxDefaultValidator,
326 char* name = "choice");
327 %name(wxPreChoice)wxChoice();
329 bool Create(wxWindow *parent, wxWindowID id,
330 const wxPoint& pos = wxDefaultPosition,
331 const wxSize& size = wxDefaultSize,
332 int LCOUNT=0, wxString* choices=NULL,
334 const wxValidator& validator = wxDefaultValidator,
335 char* name = "choice");
337 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
338 %pragma(python) addtomethod = "wxPreChoice:val._setOORInfo(val)"
343 void SetColumns(const int n = 1);
344 void SetSelection(const int n);
345 void SetStringSelection(const wxString& string);
346 void SetString(int n, const wxString& s);
348 %pragma(python) addtoclass = "
349 Select = SetSelection
353 //----------------------------------------------------------------------
355 // wxGTK's wxComboBox doesn't derive from wxChoice like wxMSW, or
356 // even wxControlWithItems, so we have to duplicate the methods
360 class wxComboBox : public wxControl
363 wxComboBox(wxWindow* parent, wxWindowID id, char* value = "",
364 const wxPoint& pos = wxDefaultPosition,
365 const wxSize& size = wxDefaultSize,
366 int LCOUNT=0, wxString* choices=NULL,
368 const wxValidator& validator = wxDefaultValidator,
369 char* name = "comboBox");
370 %name(wxPreComboBox)wxComboBox();
372 bool Create(wxWindow* parent, wxWindowID id, char* value = "",
373 const wxPoint& pos = wxDefaultPosition,
374 const wxSize& size = wxDefaultSize,
375 int LCOUNT=0, wxString* choices=NULL,
377 const wxValidator& validator = wxDefaultValidator,
378 char* name = "comboBox");
380 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
381 %pragma(python) addtomethod = "wxPreComboBox:val._setOORInfo(val)"
385 long GetInsertionPoint();
386 long GetLastPosition();
389 void Replace(long from, long to, const wxString& text);
390 void Remove(long from, long to);
391 void SetInsertionPoint(long pos);
392 void SetInsertionPointEnd();
393 void SetSelection(int n);
394 %name(SetMark)void SetSelection(long from, long to);
395 void SetValue(const wxString& text);
396 void SetEditable(bool editable);
403 %pragma(python) addtoclass = "Number = GetCount"
404 wxString GetString(int n);
405 int FindString(const wxString& s);
407 //void SetString(int n, const wxString& s); *** No equivalent for wxGTK!!!
409 // void Select(int n);
410 %pragma(python) addtoclass = "Select = SetSelection"
413 wxString GetStringSelection() const;
415 // void Append(const wxString& item);
416 // void Append(const wxString& item, char* clientData);
417 // char* GetClientData(const int n);
418 // void SetClientData(const int n, char* data);
420 void Append(const wxString& item, PyObject* clientData=NULL) {
422 wxPyClientData* data = new wxPyClientData(clientData);
423 self->Append(item, data);
428 PyObject* GetClientData(int n) {
429 wxPyClientData* data = (wxPyClientData*)self->GetClientObject(n);
431 Py_INCREF(data->m_obj);
439 void SetClientData(int n, PyObject* clientData) {
440 wxPyClientData* data = new wxPyClientData(clientData);
441 self->SetClientObject(n, data);
449 #else // For all but wxGTK
452 class wxComboBox : public wxChoice {
454 wxComboBox(wxWindow* parent, wxWindowID id, char* value = "",
455 const wxPoint& pos = wxDefaultPosition,
456 const wxSize& size = wxDefaultSize,
457 int LCOUNT=0, wxString* choices=NULL,
459 const wxValidator& validator = wxDefaultValidator,
460 char* name = "comboBox");
461 %name(wxPreComboBox)wxComboBox();
463 bool Create(wxWindow* parent, wxWindowID id, char* value = "",
464 const wxPoint& pos = wxDefaultPosition,
465 const wxSize& size = wxDefaultSize,
466 int LCOUNT=0, wxString* choices=NULL,
468 const wxValidator& validator = wxDefaultValidator,
469 char* name = "comboBox");
471 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
472 %pragma(python) addtomethod = "wxPreComboBox:val._setOORInfo(val)"
476 long GetInsertionPoint();
477 long GetLastPosition();
480 void Replace(long from, long to, const wxString& text);
481 void Remove(long from, long to);
482 void SetInsertionPoint(long pos);
483 void SetInsertionPointEnd();
484 void SetSelection(int n);
485 %name(SetMark)void SetSelection(long from, long to);
486 void SetValue(const wxString& text);
487 void SetEditable(bool editable);
492 //----------------------------------------------------------------------
494 class wxGauge : public wxControl {
496 wxGauge(wxWindow* parent, wxWindowID id, int range,
497 const wxPoint& pos = wxDefaultPosition,
498 const wxSize& size = wxDefaultSize,
499 long style = wxGA_HORIZONTAL,
500 const wxValidator& validator = wxDefaultValidator,
501 char* name = "gauge");
502 %name(wxPreGauge)wxGauge();
504 bool Create(wxWindow* parent, wxWindowID id, int range,
505 const wxPoint& pos = wxDefaultPosition,
506 const wxSize& size = wxDefaultSize,
507 long style = wxGA_HORIZONTAL,
508 const wxValidator& validator = wxDefaultValidator,
509 char* name = "gauge");
511 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
512 %pragma(python) addtomethod = "wxPreGauge:val._setOORInfo(val)"
516 int GetShadowWidth();
518 void SetBezelFace(int width);
519 void SetRange(int range);
520 void SetShadowWidth(int width);
521 void SetValue(int pos);
524 //----------------------------------------------------------------------
526 class wxStaticBox : public wxControl {
528 wxStaticBox(wxWindow* parent, wxWindowID id, const wxString& label,
529 const wxPoint& pos = wxDefaultPosition,
530 const wxSize& size = wxDefaultSize,
532 char* name = "staticBox");
533 %name(wxPreStaticBox)wxStaticBox();
535 bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
536 const wxPoint& pos = wxDefaultPosition,
537 const wxSize& size = wxDefaultSize,
539 char* name = "staticBox");
541 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
542 %pragma(python) addtomethod = "wxPreStaticBox:val._setOORInfo(val)"
546 //----------------------------------------------------------------------
549 class wxStaticLine : public wxControl {
551 wxStaticLine( wxWindow *parent, wxWindowID id,
552 const wxPoint &pos = wxDefaultPosition,
553 const wxSize &size = wxDefaultSize,
554 long style = wxLI_HORIZONTAL,
555 const char* name = "staticLine" );
556 %name(wxPreStaticLine)wxStaticLine();
558 bool Create( wxWindow *parent, wxWindowID id,
559 const wxPoint &pos = wxDefaultPosition,
560 const wxSize &size = wxDefaultSize,
561 long style = wxLI_HORIZONTAL,
562 const char* name = "staticLine" );
564 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
565 %pragma(python) addtomethod = "wxPreStaticLine:val._setOORInfo(val)"
569 //----------------------------------------------------------------------
571 class wxStaticText : public wxControl {
573 wxStaticText(wxWindow* parent, wxWindowID id, const wxString& label,
574 const wxPoint& pos = wxDefaultPosition,
575 const wxSize& size = wxDefaultSize,
577 char* name = "staticText");
578 %name(wxPreStaticText)wxStaticText();
580 bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
581 const wxPoint& pos = wxDefaultPosition,
582 const wxSize& size = wxDefaultSize,
584 char* name = "staticText");
586 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
587 %pragma(python) addtomethod = "wxPreStaticText:val._setOORInfo(val)"
590 void SetLabel(const wxString& label);
593 //----------------------------------------------------------------------
595 class wxListBox : public wxControlWithItems {
597 wxListBox(wxWindow* parent, wxWindowID id,
598 const wxPoint& pos = wxDefaultPosition,
599 const wxSize& size = wxDefaultSize,
600 int LCOUNT, wxString* choices = NULL,
602 const wxValidator& validator = wxDefaultValidator,
603 char* name = "listBox");
604 %name(wxPreListBox)wxListBox();
606 bool Create(wxWindow* parent, wxWindowID id,
607 const wxPoint& pos = wxDefaultPosition,
608 const wxSize& size = wxDefaultSize,
609 int LCOUNT, wxString* choices = NULL,
611 const wxValidator& validator = wxDefaultValidator,
612 char* name = "listBox");
614 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
615 %pragma(python) addtomethod = "wxPreListBox:val._setOORInfo(val)"
618 void Deselect(int n);
620 // int GetSelections(int **selections);
622 PyObject* GetSelections() {
624 self->GetSelections(lst);
625 PyObject *tup = PyTuple_New(lst.GetCount());
626 for(size_t i=0; i<lst.GetCount(); i++) {
627 PyTuple_SetItem(tup, i, PyInt_FromLong(lst[i]));
634 void InsertItems(int LCOUNT, wxString* choices, int pos);
636 bool IsSelected(const int n);
637 bool Selected(const int n);
638 void Set(int LCOUNT, wxString* choices);
639 void SetFirstItem(int n);
640 %name(SetFirstItemStr)void SetFirstItem(const wxString& string);
641 void SetSelection(int n, bool select = TRUE);
642 void SetString(int n, const wxString& string);
643 void SetStringSelection(const wxString& string, bool select = TRUE);
647 //----------------------------------------------------------------------
649 class wxCheckListBox : public wxListBox {
651 wxCheckListBox(wxWindow *parent, wxWindowID id,
652 const wxPoint& pos = wxDefaultPosition,
653 const wxSize& size = wxDefaultSize,
655 wxString* choices = NULL,
657 const wxValidator& validator = wxDefaultValidator,
658 char* name = "listBox");
659 %name(wxPreCheckListBox)wxCheckListBox();
661 bool Create(wxWindow *parent, wxWindowID id,
662 const wxPoint& pos = wxDefaultPosition,
663 const wxSize& size = wxDefaultSize,
665 wxString* choices = NULL,
667 const wxValidator& validator = wxDefaultValidator,
668 char* name = "listBox");
670 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
671 %pragma(python) addtomethod = "wxPreCheckListBox:val._setOORInfo(val)"
673 bool IsChecked(int uiIndex);
674 void Check(int uiIndex, int bCheck = TRUE);
675 void InsertItems(int LCOUNT, wxString* choices, int pos);
682 //----------------------------------------------------------------------
689 wxTextAttr(const wxColour& colText = wxNullColour,
690 const wxColour& colBack = wxNullColour,
691 const wxFont& font = wxNullFont);
695 void SetTextColour(const wxColour& colText);
696 void SetBackgroundColour(const wxColour& colBack);
697 void SetFont(const wxFont& font);
700 bool HasTextColour() const;
701 bool HasBackgroundColour() const;
702 bool HasFont() const;
704 wxColour GetTextColour() const;
705 wxColour GetBackgroundColour() const;
706 wxFont GetFont() const;
708 // returns false if we have any attributes set, true otherwise
711 // return the attribute having the valid font and colours: it uses the
712 // attributes set in attr and falls back first to attrDefault and then to
713 // the text control font/colours for those attributes which are not set
714 static wxTextAttr Combine(const wxTextAttr& attr,
715 const wxTextAttr& attrDef,
716 const wxTextCtrl *text);
721 class wxTextCtrl : public wxControl {
723 wxTextCtrl(wxWindow* parent, wxWindowID id, char* value = "",
724 const wxPoint& pos = wxDefaultPosition,
725 const wxSize& size = wxDefaultSize,
727 const wxValidator& validator = wxDefaultValidator,
728 char* name = "text");
729 %name(wxPreTextCtrl)wxTextCtrl();
731 bool Create(wxWindow* parent, wxWindowID id, char* value = "",
732 const wxPoint& pos = wxDefaultPosition,
733 const wxSize& size = wxDefaultSize,
735 const wxValidator& validator = wxDefaultValidator,
736 char* name = "text");
738 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
739 %pragma(python) addtomethod = "wxPreTextCtrl:val._setOORInfo(val)"
742 wxString GetValue() const;
743 void SetValue(const wxString& value);
745 wxString GetRange(long from, long to);
747 int GetLineLength(long lineNo) const;
748 wxString GetLineText(long lineNo) const;
749 int GetNumberOfLines() const;
751 bool IsModified() const;
752 bool IsEditable() const;
754 // If the return values from and to are the same, there is no selection.
755 void GetSelection(long* OUTPUT, long* OUTPUT) const;
756 wxString GetStringSelection();
759 void Replace(long from, long to, const wxString& value);
760 void Remove(long from, long to);
762 // load/save the controls contents from/to the file
763 bool LoadFile(const wxString& file);
764 bool SaveFile(const wxString& file = wxEmptyString);
766 // clears the dirty flag
769 // set the max number of characters which may be entered in a single line
771 void SetMaxLength(unsigned long len);
773 // writing text inserts it at the current position, appending always
774 // inserts it at the end
775 void WriteText(const wxString& text);
776 void AppendText(const wxString& text);
778 // text control under some platforms supports the text styles: these
779 // methods allow to apply the given text style to the given selection or to
780 // set/get the style which will be used for all appended text
781 bool SetStyle(long start, long end, const wxTextAttr& style);
782 bool SetDefaultStyle(const wxTextAttr& style);
783 const wxTextAttr& GetDefaultStyle() const;
785 // translate between the position (which is just an index in the text ctrl
786 // considering all its contents as a single strings) and (x, y) coordinates
787 // which represent column and line.
788 long XYToPosition(long x, long y) const;
789 void PositionToXY(long pos, long *OUTPUT, long *OUTPUT) const;
791 //bool PositionToXY(long pos, long *OUTPUT, long *OUTPUT) const;
792 // TODO: check return value, raise exception.
794 void ShowPosition(long pos);
796 // Clipboard operations
801 bool CanCopy() const;
803 bool CanPaste() const;
809 bool CanUndo() const;
810 bool CanRedo() const;
813 void SetInsertionPoint(long pos);
814 void SetInsertionPointEnd();
815 long GetInsertionPoint() const;
816 long GetLastPosition() const;
818 void SetSelection(long from, long to);
820 void SetEditable(bool editable);
823 void write(const wxString& text) {
824 self->AppendText(text);
828 // TODO: replace this when the method is really added to wxTextCtrl
830 wxString GetString(long from, long to) {
831 return self->GetValue().Mid(from, to-from);
836 //----------------------------------------------------------------------
838 class wxScrollBar : public wxControl {
840 wxScrollBar(wxWindow* parent, wxWindowID id = -1,
841 const wxPoint& pos = wxDefaultPosition,
842 const wxSize& size = wxDefaultSize,
843 long style = wxSB_HORIZONTAL,
844 const wxValidator& validator = wxDefaultValidator,
845 char* name = "scrollBar");
846 %name(wxPreScrollBar)wxScrollBar();
848 bool Create(wxWindow* parent, wxWindowID id = -1,
849 const wxPoint& pos = wxDefaultPosition,
850 const wxSize& size = wxDefaultSize,
851 long style = wxSB_HORIZONTAL,
852 const wxValidator& validator = wxDefaultValidator,
853 char* name = "scrollBar");
855 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
856 %pragma(python) addtomethod = "wxPreScrollBar:val._setOORInfo(val)"
860 int GetThumbPosition();
862 %name(GetThumbLength) int GetThumbSize(); // to match the docs
866 void SetThumbPosition(int viewStart);
867 void SetScrollbar(int position, int thumbSize,
868 int range, int pageSize,
869 bool refresh = TRUE);
872 //----------------------------------------------------------------------
874 class wxSpinButton : public wxControl {
876 wxSpinButton(wxWindow* parent, wxWindowID id = -1,
877 const wxPoint& pos = wxDefaultPosition,
878 const wxSize& size = wxDefaultSize,
879 long style = wxSP_HORIZONTAL,
880 char* name = "spinButton");
881 %name(wxPreSpinButton)wxSpinButton();
883 bool Create(wxWindow* parent, wxWindowID id = -1,
884 const wxPoint& pos = wxDefaultPosition,
885 const wxSize& size = wxDefaultSize,
886 long style = wxSP_HORIZONTAL,
887 char* name = "spinButton");
889 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
890 %pragma(python) addtomethod = "wxPreSpinButton:val._setOORInfo(val)"
895 void SetRange(int min, int max);
896 void SetValue(int value);
899 //----------------------------------------------------------------------
901 class wxStaticBitmap : public wxControl {
903 wxStaticBitmap(wxWindow* parent, wxWindowID id,
904 const wxBitmap& bitmap,
905 const wxPoint& pos = wxDefaultPosition,
906 const wxSize& size = wxDefaultSize,
908 char* name = "staticBitmap");
909 %name(wxPreStaticBitmap)wxStaticBitmap();
911 bool Create(wxWindow* parent, wxWindowID id,
912 const wxBitmap& bitmap,
913 const wxPoint& pos = wxDefaultPosition,
914 const wxSize& size = wxDefaultSize,
916 char* name = "staticBitmap");
918 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
919 %pragma(python) addtomethod = "wxPreStaticBitmap:val._setOORInfo(val)"
921 wxBitmap GetBitmap();
922 void SetBitmap(const wxBitmap& bitmap);
923 void SetIcon(const wxIcon& icon);
926 //----------------------------------------------------------------------
928 class wxRadioBox : public wxControl {
930 wxRadioBox(wxWindow* parent, wxWindowID id,
931 const wxString& label,
932 const wxPoint& point = wxDefaultPosition,
933 const wxSize& size = wxDefaultSize,
934 int LCOUNT = 0, wxString* choices = NULL,
935 int majorDimension = 0,
936 long style = wxRA_HORIZONTAL,
937 const wxValidator& validator = wxDefaultValidator,
938 char* name = "radioBox");
939 %name(wxPreRadioBox)wxRadioBox();
941 bool Create(wxWindow* parent, wxWindowID id,
942 const wxString& label,
943 const wxPoint& point = wxDefaultPosition,
944 const wxSize& size = wxDefaultSize,
945 int LCOUNT = 0, wxString* choices = NULL,
946 int majorDimension = 0,
947 long style = wxRA_HORIZONTAL,
948 const wxValidator& validator = wxDefaultValidator,
949 char* name = "radioBox");
951 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
952 %pragma(python) addtomethod = "wxPreRadioBox:val._setOORInfo(val)"
954 void Enable(bool enable);
955 %name(EnableItem)void Enable(int n, bool enable);
956 int FindString(const wxString& string);
958 wxString GetString(int n);
961 %name(GetItemLabel)wxString GetLabel( int item );
962 %name(SetItemLabel)void SetLabel( int item, const wxString& label );
964 void SetString(int n, const wxString& label);
965 %pragma(python) addtoclass = "
966 GetItemLabel = GetString
967 SetItemLabel = SetString
969 int GetColumnCount();
974 wxString GetStringSelection();
976 %pragma(python) addtoclass = "Number = GetCount"
978 void SetSelection(int n);
979 void SetStringSelection(const wxString& string);
980 void Show(bool show);
981 %name(ShowItem)void Show(int item, bool show);
984 //----------------------------------------------------------------------
986 class wxRadioButton : public wxControl {
988 wxRadioButton(wxWindow* parent, wxWindowID id,
989 const wxString& label,
990 const wxPoint& pos = wxDefaultPosition,
991 const wxSize& size = wxDefaultSize,
993 const wxValidator& validator = wxDefaultValidator,
994 char* name = "radioButton");
995 %name(wxPreRadioButton)wxRadioButton();
997 bool Create(wxWindow* parent, wxWindowID id,
998 const wxString& label,
999 const wxPoint& pos = wxDefaultPosition,
1000 const wxSize& size = wxDefaultSize,
1002 const wxValidator& validator = wxDefaultValidator,
1003 char* name = "radioButton");
1005 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
1006 %pragma(python) addtomethod = "wxPreRadioButton:val._setOORInfo(val)"
1009 void SetValue(bool value);
1012 //----------------------------------------------------------------------
1014 class wxSlider : public wxControl {
1016 wxSlider(wxWindow* parent, wxWindowID id,
1017 int value, int minValue, int maxValue,
1018 const wxPoint& point = wxDefaultPosition,
1019 const wxSize& size = wxDefaultSize,
1020 long style = wxSL_HORIZONTAL,
1021 const wxValidator& validator = wxDefaultValidator,
1022 char* name = "slider");
1023 %name(wxPreSlider)wxSlider();
1025 bool Create(wxWindow* parent, wxWindowID id,
1026 int value, int minValue, int maxValue,
1027 const wxPoint& point = wxDefaultPosition,
1028 const wxSize& size = wxDefaultSize,
1029 long style = wxSL_HORIZONTAL,
1030 const wxValidator& validator = wxDefaultValidator,
1031 char* name = "slider");
1033 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
1034 %pragma(python) addtomethod = "wxPreSlider:val._setOORInfo(val)"
1044 int GetThumbLength();
1047 void SetRange(int minValue, int maxValue);
1048 void SetTickFreq(int n, int pos);
1049 void SetLineSize(int lineSize);
1050 void SetPageSize(int pageSize);
1051 void SetSelection(int startPos, int endPos);
1052 void SetThumbLength(int len);
1053 void SetTick(int tickPos);
1054 void SetValue(int value);
1058 //----------------------------------------------------------------------
1060 class wxSpinCtrl : public wxSpinButton {
1062 wxSpinCtrl(wxWindow *parent,
1064 const char* value = "",
1065 const wxPoint& pos = wxDefaultPosition,
1066 const wxSize& size = wxDefaultSize,
1067 long style = wxSP_ARROW_KEYS,
1068 int min = 0, int max = 100, int initial = 0,
1069 const char* name = "wxSpinCtrl");
1070 %name(wxPreSpinCtrl)wxSpinCtrl();
1072 bool Create(wxWindow *parent,
1074 const char* value = "",
1075 const wxPoint& pos = wxDefaultPosition,
1076 const wxSize& size = wxDefaultSize,
1077 long style = wxSP_ARROW_KEYS,
1078 int min = 0, int max = 100, int initial = 0,
1079 const char* name = "wxSpinCtrl");
1081 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
1082 %pragma(python) addtomethod = "wxPreSpinCtrl:val._setOORInfo(val)"
1087 void SetRange(int min, int max);
1088 void SetValue(int value);
1093 //----------------------------------------------------------------------
1096 enum { wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, };
1098 class wxToggleButton : public wxControl {
1100 wxToggleButton(wxWindow *parent,
1102 const wxString& label,
1103 const wxPoint& pos = wxDefaultPosition,
1104 const wxSize& size = wxDefaultSize,
1106 const wxValidator& validator = wxDefaultValidator,
1107 const char* name = "toggle");
1108 %name(wxPreToggleButton)wxToggleButton();
1110 bool Create(wxWindow *parent,
1112 const wxString& label,
1113 const wxPoint& pos = wxDefaultPosition,
1114 const wxSize& size = wxDefaultSize,
1116 const wxValidator& validator = wxDefaultValidator,
1117 const char* name = "toggle");
1119 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
1120 %pragma(python) addtomethod = "wxPreToggleButton:val._setOORInfo(val)"
1122 void SetValue(bool value);
1123 bool GetValue() const ;
1124 void SetLabel(const wxString& label);
1130 //----------------------------------------------------------------------
1131 //----------------------------------------------------------------------
1132 //----------------------------------------------------------------------