X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/312ebad4cd1fad97a79aaed7102611df88806410..b16de7461ac6d97b0b04a5ce4e73447925e93416:/src/mac/carbon/spinbutt.cpp diff --git a/src/mac/carbon/spinbutt.cpp b/src/mac/carbon/spinbutt.cpp index 20c43cef8f..2b900c19fd 100644 --- a/src/mac/carbon/spinbutt.cpp +++ b/src/mac/carbon/spinbutt.cpp @@ -9,12 +9,7 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "spinbutt.h" -#pragma implementation "spinbuttbase.h" -#endif - -#include "wx/defs.h" +#include "wx/wxprec.h" #if wxUSE_SPINBTN @@ -29,12 +24,8 @@ // wxWin macros // ---------------------------------------------------------------------------- -#if !USE_SHARED_LIBRARY - IMPLEMENT_DYNAMIC_CLASS(wxSpinButton, wxControl) - IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxScrollEvent) -#endif - -extern ControlActionUPP wxMacLiveScrollbarActionUPP ; +IMPLEMENT_DYNAMIC_CLASS(wxSpinButton, wxControl) +IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxScrollEvent) wxSpinButton::wxSpinButton() : wxSpinButtonBase() @@ -58,11 +49,11 @@ bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, c Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ; - m_peer = new wxMacControl() ; + m_peer = new wxMacControl(this) ; verify_noerr ( CreateLittleArrowsControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , 0 , m_min , m_max , 1 , m_peer->GetControlRefAddr() ) ); - m_peer->SetActionProc( wxMacLiveScrollbarActionUPP ) ; + m_peer->SetActionProc( GetwxMacLiveScrollbarActionProc() ) ; MacPostControlCreate(pos,size) ; return true; @@ -87,7 +78,12 @@ int wxSpinButton::GetMax() const int wxSpinButton::GetValue() const { - return m_value; + int n = m_value; + + if (n < m_min) n = m_min; + if (n > m_max) n = m_max; + + return n; } void wxSpinButton::SetValue(int val)