]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/spinbutt.cpp
correcting window variant
[wxWidgets.git] / src / mac / carbon / spinbutt.cpp
index 7e8de83b09c60c7d45c2692c9f66947f6f5aaf5b..98272dc92a3a5d67841a1be83321332f34a6430b 100644 (file)
@@ -54,9 +54,11 @@ bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, c
     
     Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
         
+    m_peer = new wxMacControl() ;
     verify_noerr ( CreateLittleArrowsControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , 0 , m_min , m_max , 1 ,
-     (ControlRef*) &m_macControl ) ) ;
-    SetControlAction( (ControlRef) m_macControl , wxMacLiveScrollbarActionUPP ) ;
+     m_peer->GetControlRefAddr() ) );
+    
+    m_peer->SetActionProc( wxMacLiveScrollbarActionUPP ) ;
     MacPostControlCreate(pos,size) ;
     
     return TRUE;
@@ -93,8 +95,8 @@ void wxSpinButton::SetRange(int minVal, int maxVal)
 {
     m_min = minVal;
     m_max = maxVal;
-    SetControl32BitMaximum( (ControlRef) m_macControl , maxVal ) ;
-    SetControl32BitMinimum((ControlRef) m_macControl , minVal ) ;
+    m_peer->SetMaximum( maxVal ) ;
+    m_peer->SetMinimum( minVal ) ;
 }
 
 void wxSpinButton::MacHandleValueChanged( int inc )
@@ -137,7 +139,7 @@ void wxSpinButton::MacHandleValueChanged( int inc )
     {
         m_value = oldValue ;
     }
-    SetControl32BitValue( (ControlRef) m_macControl , m_value ) ;
+    m_peer->SetValue( m_value ) ;
     
     /* always send a thumbtrack event */
     if (scrollEvent != wxEVT_SCROLL_THUMBTRACK)