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()
ProcessCommand(event);
}
-void wxScrollBar::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
+void wxScrollBar::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown )
{
if ( (ControlHandle) m_macControl == NULL )
return ;
wxEventType scrollEvent = wxEVT_NULL;
int nScrollInc;
+ // all events have already been reported during mouse down, except for THUMBRELEASE
+ if ( !mouseStillDown && controlpart !=kControlIndicatorPart )
+ return ;
+
switch( controlpart )
{
case kControlUpButtonPart :
break ;
case kControlIndicatorPart :
nScrollInc = 0 ;
- scrollEvent = wxEVT_SCROLL_THUMBTRACK;
+ if ( mouseStillDown )
+ scrollEvent = wxEVT_SCROLL_THUMBTRACK;
+ else
+ scrollEvent = wxEVT_SCROLL_THUMBRELEASE;
break ;
default :
wxFAIL_MSG(wxT("illegal scrollbar selector"));