1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface defs for wxSpinButton and wxSpinCtrl
7 // Created: 10-June-1998
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
19 DECLARE_DEF_STRING(SPIN_BUTTON_NAME);
20 wxChar* wxSpinCtrlNameStr = _T("wxSpinCtrl");
21 DECLARE_DEF_STRING(SpinCtrlNameStr);
24 //---------------------------------------------------------------------------
36 // The wxSpinButton is like a small scrollbar than is often placed next
40 // wxSP_HORIZONTAL: horizontal spin button
41 // wxSP_VERTICAL: vertical spin button (the default)
42 // wxSP_ARROW_KEYS: arrow keys increment/decrement value
43 // wxSP_WRAP: value wraps at either end
44 class wxSpinButton : public wxControl
47 %addtofunc wxSpinButton "self._setOORInfo(self)"
48 %addtofunc wxSpinButton() ""
50 wxSpinButton(wxWindow* parent, wxWindowID id = -1,
51 const wxPoint& pos = wxDefaultPosition,
52 const wxSize& size = wxDefaultSize,
53 long style = wxSP_HORIZONTAL,
54 const wxString& name = wxPySPIN_BUTTON_NAME);
55 %name(PreSpinButton)wxSpinButton();
57 bool Create(wxWindow* parent, wxWindowID id = -1,
58 const wxPoint& pos = wxDefaultPosition,
59 const wxSize& size = wxDefaultSize,
60 long style = wxSP_HORIZONTAL,
61 const wxString& name = wxPySPIN_BUTTON_NAME);
63 virtual int GetValue() const;
64 virtual int GetMin() const;
65 virtual int GetMax() const;
67 virtual void SetValue(int val);
68 virtual void SetMin(int minVal);
69 virtual void SetMax(int maxVal);
70 virtual void SetRange(int minVal, int maxVal);
72 // is this spin button vertically oriented?
73 bool IsVertical() const;
77 //---------------------------------------------------------------------------
80 // a spin ctrl is a text control with a spin button which is usually used to
81 // prompt the user for a numeric input
83 class wxSpinCtrl : public wxControl
86 %addtofunc wxSpinCtrl "self._setOORInfo(self)"
87 %addtofunc wxSpinCtrl() ""
89 wxSpinCtrl(wxWindow *parent,
91 const wxString& value = wxPyEmptyString,
92 const wxPoint& pos = wxDefaultPosition,
93 const wxSize& size = wxDefaultSize,
94 long style = wxSP_ARROW_KEYS,
95 int min = 0, int max = 100, int initial = 0,
96 const wxString& name = wxPySpinCtrlNameStr);
97 %name(PreSpinCtrl)wxSpinCtrl();
99 bool Create(wxWindow *parent,
101 const wxString& value = wxPyEmptyString,
102 const wxPoint& pos = wxDefaultPosition,
103 const wxSize& size = wxDefaultSize,
104 long style = wxSP_ARROW_KEYS,
105 int min = 0, int max = 100, int initial = 0,
106 const wxString& name = wxPySpinCtrlNameStr);
108 virtual int GetValue() const;
109 virtual void SetValue( int value );
110 %name(SetValueString) void SetValue(const wxString& text);
112 virtual void SetRange( int minVal, int maxVal );
113 virtual int GetMin() const;
114 virtual int GetMax() const;
117 void SetSelection(long from, long to) {
121 void SetSelection(long from, long to);
126 %constant wxEventType wxEVT_COMMAND_SPINCTRL_UPDATED;
130 EVT_SPINCTRL = wx.PyEventBinder( wxEVT_COMMAND_SPINCTRL_UPDATED, 1)
134 //---------------------------------------------------------------------------