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 //---------------------------------------------------------------------------
18 MAKE_CONST_WXSTRING(SPIN_BUTTON_NAME);
19 MAKE_CONST_WXSTRING2(SpinCtrlNameStr, _T("wxSpinCtrl"));
21 //---------------------------------------------------------------------------
33 // The wxSpinButton is like a small scrollbar than is often placed next
37 // wxSP_HORIZONTAL: horizontal spin button
38 // wxSP_VERTICAL: vertical spin button (the default)
39 // wxSP_ARROW_KEYS: arrow keys increment/decrement value
40 // wxSP_WRAP: value wraps at either end
41 MustHaveApp(wxSpinButton);
42 class wxSpinButton : public wxControl
45 %pythonAppend wxSpinButton "self._setOORInfo(self)"
46 %pythonAppend wxSpinButton() ""
48 wxSpinButton(wxWindow* parent, wxWindowID id = -1,
49 const wxPoint& pos = wxDefaultPosition,
50 const wxSize& size = wxDefaultSize,
51 long style = wxSP_HORIZONTAL,
52 const wxString& name = wxPySPIN_BUTTON_NAME);
53 %name(PreSpinButton)wxSpinButton();
55 bool Create(wxWindow* parent, wxWindowID id = -1,
56 const wxPoint& pos = wxDefaultPosition,
57 const wxSize& size = wxDefaultSize,
58 long style = wxSP_HORIZONTAL,
59 const wxString& name = wxPySPIN_BUTTON_NAME);
61 virtual int GetValue() const;
62 virtual int GetMin() const;
63 virtual int GetMax() const;
65 virtual void SetValue(int val);
66 virtual void SetMin(int minVal);
67 virtual void SetMax(int maxVal);
68 virtual void SetRange(int minVal, int maxVal);
70 // is this spin button vertically oriented?
71 bool IsVertical() const;
73 static wxVisualAttributes
74 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
78 //---------------------------------------------------------------------------
81 // a spin ctrl is a text control with a spin button which is usually used to
82 // prompt the user for a numeric input
84 MustHaveApp(wxSpinCtrl);
86 class wxSpinCtrl : public wxControl
89 %pythonAppend wxSpinCtrl "self._setOORInfo(self)"
90 %pythonAppend wxSpinCtrl() ""
92 wxSpinCtrl(wxWindow *parent,
94 const wxString& value = wxPyEmptyString,
95 const wxPoint& pos = wxDefaultPosition,
96 const wxSize& size = wxDefaultSize,
97 long style = wxSP_ARROW_KEYS,
98 int min = 0, int max = 100, int initial = 0,
99 const wxString& name = wxPySpinCtrlNameStr);
100 %name(PreSpinCtrl)wxSpinCtrl();
102 bool Create(wxWindow *parent,
104 const wxString& value = wxPyEmptyString,
105 const wxPoint& pos = wxDefaultPosition,
106 const wxSize& size = wxDefaultSize,
107 long style = wxSP_ARROW_KEYS,
108 int min = 0, int max = 100, int initial = 0,
109 const wxString& name = wxPySpinCtrlNameStr);
111 virtual int GetValue() const;
112 virtual void SetValue( int value );
113 %name(SetValueString) void SetValue(const wxString& text);
115 virtual void SetRange( int minVal, int maxVal );
116 virtual int GetMin() const;
117 virtual int GetMax() const;
118 void SetSelection(long from, long to);
120 static wxVisualAttributes
121 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
125 //---------------------------------------------------------------------------
127 class wxSpinEvent : public wxNotifyEvent
130 wxSpinEvent(wxEventType commandType = wxEVT_NULL, int winid = 0);
132 // get the current value of the control
133 int GetPosition() const;
134 void SetPosition(int pos);
138 %constant wxEventType wxEVT_COMMAND_SPINCTRL_UPDATED;
142 EVT_SPIN_UP = wx.PyEventBinder( wx.wxEVT_SCROLL_LINEUP, 1)
143 EVT_SPIN_DOWN = wx.PyEventBinder( wx.wxEVT_SCROLL_LINEDOWN, 1)
144 EVT_SPIN = wx.PyEventBinder( wx.wxEVT_SCROLL_THUMBTRACK, 1)
145 EVT_SPINCTRL = wx.PyEventBinder( wxEVT_COMMAND_SPINCTRL_UPDATED, 1)
149 //---------------------------------------------------------------------------