#include "wx/tabctrl.h"
#include "wx/bitmap.h"
-#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxControl)
BEGIN_EVENT_TABLE(wxToolBar, wxToolBarBase)
EVT_PAINT( wxToolBar::OnPaint )
END_EVENT_TABLE()
-#endif
#include "wx/mac/uma.h"
#include "wx/geometry.h"
ControlPartCode pc = kControlNoPart ;
if ( CGRectContainsPoint( rect , pt ) )
- pc = kControlButtonPart ;
+ pc = kControlIconPart ;
cEvent.SetParameter( kEventParamControlPart , typeControlPartCode, pc ) ;
result = noErr ;
}
return result ;
}
-pascal OSStatus wxMacToolBarToolEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
+static pascal OSStatus wxMacToolBarToolEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
{
OSStatus result = eventNotHandledErr ;
DoToggleTool(tool, true);
}
}
+ else if (tool->IsToggled())
+ {
+ wxToolBarToolsList::compatibility_iterator nodePrev = node->GetPrevious();
+ while ( nodePrev )
+ {
+ wxToolBarToolBase *tool = nodePrev->GetData();
+ if ( !tool->IsButton() || (tool->GetKind() != wxITEM_RADIO) )
+ break;
+ if ( tool->Toggle(false) )
+ {
+ DoToggleTool(tool, false);
+ }
+ nodePrev = nodePrev->GetPrevious();
+ }
+ }
isRadio = TRUE;
}
else
CreateIconControl( window , &toolrect , &info , false , &controlHandle ) ;
#else
SInt16 behaviour = kControlBehaviorOffsetContents ;
- if ( CanBeToggled() )
+ if ( tool->CanBeToggled() )
behaviour += kControlBehaviorToggles ;
CreateBevelButtonControl( window , &toolrect , CFSTR("") , kControlBevelButtonNormalBevel , behaviour , &info ,
0 , 0 , 0 , &controlHandle ) ;