X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bfe9ffbc8f021c6e0e5b4243fdc8e1a0c3a1ee27..1e1cc1ce95dde0c66df452cf438a05c5d6cac153:/src/mac/carbon/toolbar.cpp?ds=sidebyside diff --git a/src/mac/carbon/toolbar.cpp b/src/mac/carbon/toolbar.cpp index 62b486d43d..d8bdac1326 100644 --- a/src/mac/carbon/toolbar.cpp +++ b/src/mac/carbon/toolbar.cpp @@ -5,7 +5,8 @@ // Modified by: // Created: 04/01/98 // RCS-ID: $Id$ -// Copyright: (c) Stefan Csomory +// Copyright: (c) Stefan Csomor +// Licence: The wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -22,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 ) @@ -172,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() ; @@ -324,8 +327,6 @@ bool wxToolBar::Realize() node = node->GetNext(); } - int separatorSize = GetToolSize().x / 4 ; - node = m_tools.GetFirst(); while (node) { @@ -391,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() ) @@ -603,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 */ ) ; } } }