wxToolBar::~wxToolBar()
{
+ size_t index = 0 ;
+ for ( index = 0 ; index < m_macToolHandles.Count() ; ++index )
+ {
+ // Delete the control as we get ghosts otherwise
+ ::DisposeControl( (ControlHandle) m_macToolHandles[index] );
+ }
+
// we must refresh the frame size when the toolbar is deleted but the frame
// is not - otherwise toolbar leaves a hole in the place it used to occupy
}
bool wxToolBar::Realize()
{
- if (m_tools.Number() == 0)
+ if (m_tools.GetCount() == 0)
return FALSE;
Point localOrigin ;
controlstyle.flags = kControlUseFontMask ;
controlstyle.font = kControlFontSmallSystemFont ;
- wxNode *node = m_tools.First();
+ wxToolBarToolsList::Node *node = m_tools.GetFirst();
int noButtons = 0;
int x = 0 ;
int y = 0 ;
while (node)
{
- wxToolBarTool *tool = (wxToolBarTool *)node->Data();
- wxBitmapRefData * bmap = (wxBitmapRefData*) ( tool->GetNormalBitmap().GetRefData()) ;
+ wxToolBarTool *tool = (wxToolBarTool *)node->GetData();
if( !tool->IsSeparator() )
{
if (toolbarrect.top + y + m_yMargin + kwxMacToolBarTopMargin - m_y - localOrigin.v > maxHeight) {
maxHeight = toolbarrect.top + y + m_yMargin + kwxMacToolBarTopMargin - m_y - localOrigin.v ;
}
- node = node->Next();
+ node = node->GetNext();
}
if ( GetWindowStyleFlag() & wxTB_HORIZONTAL )
void wxToolBar::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
{
- int index = 0 ;
+ size_t index = 0 ;
for ( index = 0 ; index < m_macToolHandles.Count() ; ++index )
{
if ( m_macToolHandles[index] == (void*) control )
{
- wxToolBarTool *tool = (wxToolBarTool *)m_tools.Nth( index )->Data();
+ wxToolBarTool *tool = (wxToolBarTool *)m_tools.Item( index )->GetData();
if ( tool->CanBeToggled() )
{
tool->Toggle( GetControl32BitValue( (ControlHandle) control ) ) ;
void wxToolBar::MacSuperChangedPosition()
{
- if (m_tools.Number() > 0)
+ if (m_tools.GetCount() > 0)
{
Point localOrigin ;
controlstyle.flags = kControlUseFontMask ;
controlstyle.font = kControlFontSmallSystemFont ;
- wxNode *node = m_tools.First();
+ wxToolBarToolsList::Node *node = m_tools.GetFirst();
int noButtons = 0;
int x = 0 ;
wxSize toolSize = GetToolSize() ;
WindowRef rootwindow = (WindowRef) MacGetRootWindow() ;
while (node)
{
- wxToolBarTool *tool = (wxToolBarTool *)node->Data();
- wxBitmapRefData * bmap = (wxBitmapRefData*) ( tool->GetNormalBitmap().GetRefData()) ;
+ wxToolBarTool *tool = (wxToolBarTool *)node->GetData();
if( !tool->IsSeparator() )
{
if (toolbarrect.top + m_yMargin + kwxMacToolBarTopMargin - m_y - localOrigin.v > maxHeight)
maxHeight = toolbarrect.top + kwxMacToolBarTopMargin + m_yMargin - m_y - localOrigin.v ;
- node = node->Next();
+ node = node->GetNext();
}
}
MacClientToRootWindow( &x , &y ) ;
Point pt = { y ,x } ;
- int index = 0 ;
+ size_t index = 0 ;
for ( index = 0 ; index < m_macToolHandles.Count() ; ++index )
{
if ( m_macToolHandles[index] )
GetControlBounds((ControlHandle) m_macToolHandles[index], &bounds ) ;
if ( PtInRect( pt , &bounds ) )
{
- return (wxToolBarTool*) (m_tools.Nth( index )->Data() ) ;
+ return (wxToolBarTool*) (m_tools.Item( index )->GetData() ) ;
}
}
}
dc.YLOG2DEVMAC(m_height) , dc.XLOG2DEVMAC(m_width) } ;
UMADrawThemePlacard( &toolbarrect , IsEnabled() ? kThemeStateActive : kThemeStateInactive) ;
{
- int index = 0 ;
+ size_t index = 0 ;
for ( index = 0 ; index < m_macToolHandles.Count() ; ++index )
{
if ( m_macToolHandles[index] )