X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/84969af72daf3d5ffab6888dbb3c64ac868df390..b77b87881bae2e6306366d79e7fe160334b3d4a2:/src/mac/carbon/toolbar.cpp?ds=sidebyside diff --git a/src/mac/carbon/toolbar.cpp b/src/mac/carbon/toolbar.cpp index 92d048a228..d8bdac1326 100644 --- a/src/mac/carbon/toolbar.cpp +++ b/src/mac/carbon/toolbar.cpp @@ -23,7 +23,7 @@ #include "wx/bitmap.h" #if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxToolBarBase) +IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxControl) BEGIN_EVENT_TABLE(wxToolBar, wxToolBarBase) EVT_MOUSE_EVENTS( wxToolBar::OnMouse ) @@ -173,7 +173,9 @@ wxToolBarTool::wxToolBarTool(wxToolBar *tbar, : wxToolBarToolBase(tbar, id, label, bmpNormal, bmpDisabled, kind, clientData, shortHelp, longHelp) { - Init() ; + Init(); + + if (id == wxID_SEPARATOR) return; WindowRef window = (WindowRef) tbar->MacGetRootWindow() ; wxSize toolSize = tbar->GetToolSize() ; @@ -325,8 +327,6 @@ bool wxToolBar::Realize() node = node->GetNext(); } - int separatorSize = GetToolSize().x / 4 ; - node = m_tools.GetFirst(); while (node) { @@ -392,7 +392,7 @@ wxSize wxToolBar::GetToolSize() const return wxSize(m_defaultWidth + 4, m_defaultHeight + 4); } -void wxToolBar::MacHandleControlClick( WXWidget control , wxInt16 controlpart ) +void wxToolBar::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED( mouseStillDown ) ) { wxToolBarToolsList::Node *node; for ( node = m_tools.GetFirst(); node; node = node->GetNext() ) @@ -604,15 +604,11 @@ void wxToolBar::OnMouse( wxMouseEvent &event ) if ( control && ::IsControlActive( control ) ) { { - if ( controlpart == kControlIndicatorPart && !UMAHasAppearance() ) - controlpart = ::HandleControlClick( control , localwhere , modifiers , (ControlActionUPP) NULL ) ; - else - controlpart = ::HandleControlClick( control , localwhere , modifiers , (ControlActionUPP) -1 ) ; + controlpart = ::HandleControlClick( control , localwhere , modifiers , (ControlActionUPP) -1 ) ; wxTheApp->s_lastMouseDown = 0 ; - if ( controlpart && ! ( ( UMAHasAppearance() || (controlpart != kControlIndicatorPart) ) - && (IsKindOf( CLASSINFO( wxScrollBar ) ) ) ) ) // otherwise we will get the event twice + if ( control && controlpart != kControlNoPart ) // otherwise we will get the event twice { - MacHandleControlClick( control , controlpart ) ; + MacHandleControlClick( control , controlpart , false /* not down anymore */ ) ; } } }