#if wxUSE_TOOLBAR
-#include "wx/wx.h"
-#include "wx/bitmap.h"
#include "wx/toolbar.h"
+#ifndef WX_PRECOMP
+ #include "wx/wx.h"
+#endif
+
#include "wx/mac/uma.h"
#include "wx/geometry.h"
~wxToolBarTool()
{
ClearControl();
- if ( m_controlHandle )
- DisposeControl( m_controlHandle );
#if wxMAC_USE_NATIVE_TOOLBAR
if ( m_toolbarItemRef )
void ClearControl()
{
m_control = NULL;
+ if ( m_controlHandle )
+ {
+ DisposeControl( m_controlHandle );
+ m_controlHandle = NULL ;
+ }
#if wxMAC_USE_NATIVE_TOOLBAR
m_toolbarItemRef = NULL;
if (err != noErr)
{
wxString errMsg = wxString::Format( wxT("HIToolbarRemoveItemAtIndex failed [%ld]"), (long)err );
- wxASSERT_MSG( 0, errMsg.c_str() );
+ wxFAIL_MSG( errMsg.c_str() );
}
}
if (err != noErr)
{
wxString errMsg = wxString::Format( wxT("HIToolbarInsertItemAtIndex failed [%ld]"), (long)err );
- wxASSERT_MSG( 0, errMsg.c_str() );
+ wxFAIL_MSG( errMsg.c_str() );
}
tool->SetIndex( currentPosition );
else
{
wxString errMsg = wxString::Format( wxT("wxToolBar::DoInsertTool - failure [%ld]"), (long)err );
- wxASSERT_MSG( false, errMsg.c_str() );
+ wxFAIL_MSG( errMsg.c_str() );
}
return (err == noErr);
case wxTOOL_STYLE_SEPARATOR:
if ( tool->GetControlHandle() )
{
- DisposeControl( (ControlRef) tool->GetControlHandle() );
-
#if wxMAC_USE_NATIVE_TOOLBAR
if ( removeIndex != -1 && m_macHIToolbarRef )
{