X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4b26b60fac70f89cf33935f78469e27536d8b614..b77b87881bae2e6306366d79e7fe160334b3d4a2:/src/mac/scrolbar.cpp diff --git a/src/mac/scrolbar.cpp b/src/mac/scrolbar.cpp index eef2a84c54..3b08c25ecc 100644 --- a/src/mac/scrolbar.cpp +++ b/src/mac/scrolbar.cpp @@ -40,24 +40,25 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, const wxValidator& validator, const wxString& name) { - if (!parent) - return FALSE; - + if ( !wxControl::Create(parent, id, pos, size, style, validator, name) ) + return FALSE; + Rect bounds ; Str255 title ; - + MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ; - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , true , 0 , 0 , 100, - kControlScrollBarLiveProc , (long) this ) ; - + m_macControl = ::NewControl(MAC_WXHWND(parent->MacGetRootWindow()) , + &bounds , title , false , 0 , 0 , 100, + kControlScrollBarLiveProc , (long) this) ; + wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ; ::SetControlAction( (ControlHandle) m_macControl , wxMacLiveScrollbarActionUPP ) ; MacPostControlCreate() ; - return TRUE; + return TRUE; } wxScrollBar::~wxScrollBar() @@ -115,7 +116,7 @@ void wxScrollBar::MacHandleControlClick( WXWidget control , wxInt16 controlpart int maxPos = GetControl32BitMaximum( (ControlHandle) m_macControl) ; wxEventType scrollEvent = wxEVT_NULL; - int nScrollInc; + int nScrollInc = 0; // all events have already been reported during mouse down, except for THUMBRELEASE if ( !mouseStillDown && controlpart !=kControlIndicatorPart )