]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/_spin.i
grid/dbgrid was not getting built for inclusion with this project
[wxWidgets.git] / wxPython / src / _spin.i
index 8802d40d7d4f2aea44fbb5203ad69c59e9bfb6ba..29b9ca22abf776e84f21ca98a4db3b98cefdcd50 100644 (file)
 
 //---------------------------------------------------------------------------
 
-%{
-    DECLARE_DEF_STRING(SPIN_BUTTON_NAME);
-    wxChar* wxSpinCtrlNameStr = _T("wxSpinCtrl");
-    DECLARE_DEF_STRING(SpinCtrlNameStr);
-%}
+MAKE_CONST_WXSTRING(SPIN_BUTTON_NAME);
+MAKE_CONST_WXSTRING2(SpinCtrlNameStr, _T("wxSpinCtrl"));
 
 //---------------------------------------------------------------------------
 %newgroup
@@ -44,8 +41,8 @@ enum {
 class wxSpinButton : public wxControl
 {
 public:
-    %addtofunc wxSpinButton         "self._setOORInfo(self)"
-    %addtofunc wxSpinButton()       ""
+    %pythonAppend wxSpinButton         "self._setOORInfo(self)"
+    %pythonAppend wxSpinButton()       ""
 
     wxSpinButton(wxWindow* parent, wxWindowID id = -1,
                  const wxPoint& pos = wxDefaultPosition,
@@ -71,6 +68,9 @@ public:
 
     // is this spin button vertically oriented?
     bool IsVertical() const;
+
+    static wxVisualAttributes
+    GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
 };
 
 
@@ -83,8 +83,8 @@ public:
 class wxSpinCtrl : public wxControl
 {
 public:
-    %addtofunc wxSpinCtrl         "self._setOORInfo(self)"
-    %addtofunc wxSpinCtrl()       ""
+    %pythonAppend wxSpinCtrl         "self._setOORInfo(self)"
+    %pythonAppend wxSpinCtrl()       ""
 
     wxSpinCtrl(wxWindow *parent,
                wxWindowID id = -1,
@@ -112,14 +112,23 @@ public:
     virtual void SetRange( int minVal, int maxVal );
     virtual int GetMin() const;
     virtual int GetMax() const;
-#ifdef __WXGTK__
-    %extend {
-        void SetSelection(long from, long to) {
-        }
-    }
-#else
     void SetSelection(long from, long to);
-#endif
+
+    static wxVisualAttributes
+    GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
+};
+
+
+//---------------------------------------------------------------------------
+
+class wxSpinEvent : public wxNotifyEvent
+{
+public:
+    wxSpinEvent(wxEventType commandType = wxEVT_NULL, int winid = 0);
+
+    // get the current value of the control
+    int GetPosition() const;
+    void SetPosition(int pos);
 };
 
 
@@ -127,7 +136,10 @@ public:
 
 
 %pythoncode {
-EVT_SPINCTRL = wx.PyEventBinder( wxEVT_COMMAND_SPINCTRL_UPDATED, 1)
+EVT_SPIN_UP   = wx.PyEventBinder( wx.wxEVT_SCROLL_LINEUP, 1)
+EVT_SPIN_DOWN = wx.PyEventBinder( wx.wxEVT_SCROLL_LINEDOWN, 1)
+EVT_SPIN      = wx.PyEventBinder( wx.wxEVT_SCROLL_THUMBTRACK, 1)
+EVT_SPINCTRL  = wx.PyEventBinder( wxEVT_COMMAND_SPINCTRL_UPDATED, 1)
 }