virtual bool SetShortHelp(const wxString& help)
{
if ( wxToolBarToolBase::SetShortHelp( help ) == false )
return false;
virtual bool SetShortHelp(const wxString& help)
{
if ( wxToolBarToolBase::SetShortHelp( help ) == false )
return false;
virtual bool SetLongHelp(const wxString& help)
{
if ( wxToolBarToolBase::SetLongHelp( help ) == false )
virtual bool SetLongHelp(const wxString& help)
{
if ( wxToolBarToolBase::SetLongHelp( help ) == false )
- if (m_macToolbar != NULL)
- {
- // if this is the installed toolbar, then deinstall it
- if (m_macUsesNativeToolbar)
- MacInstallNativeToolbar( false );
+ // We could be not using a native tool bar at all, this happens when we're
+ // created with something other than the frame as parent for example.
+ if ( !m_macToolbar )
+ return;
- CFIndex count = CFGetRetainCount( m_macToolbar ) ;
- // Leopard seems to have one refcount more, so we cannot check reliably at the moment
- if ( UMAGetSystemVersion() < 0x1050 )
+ CFIndex count = CFGetRetainCount( m_macToolbar ) ;
+ // Leopard seems to have one refcount more, so we cannot check reliably at the moment
+ if ( UMAGetSystemVersion() < 0x1050 )
+ {
+ if ( count != 1 )
// ShowHideWindowToolbar will make the wxFrame grow
// which we don't want in this case
wxSize sz = GetParent()->GetSize();
ShowHideWindowToolbar( tlw, true, false );
// Restore the orginal size
GetParent()->SetSize( sz );
// ShowHideWindowToolbar will make the wxFrame grow
// which we don't want in this case
wxSize sz = GetParent()->GetSize();
ShowHideWindowToolbar( tlw, true, false );
// Restore the orginal size
GetParent()->SetSize( sz );
m_peer->Move(0,0,0,0 );
SetSize( wxSIZE_AUTO_WIDTH, 0 );
m_peer->SetVisibility( false );
m_peer->Move(0,0,0,0 );
SetSize( wxSIZE_AUTO_WIDTH, 0 );
m_peer->SetVisibility( false );
ShowHideWindowToolbar( tlw, false, false );
ChangeWindowAttributes( tlw, 0, kWindowToolbarButtonAttribute );
ShowHideWindowToolbar( tlw, false, false );
ChangeWindowAttributes( tlw, 0, kWindowToolbarButtonAttribute );
{
int x1 = x + ( maxToolWidth - cursize.x ) / 2;
tool->SetPosition( wxPoint(x1, y) );
{
int x1 = x + ( maxToolWidth - cursize.x ) / 2;
tool->SetPosition( wxPoint(x1, y) );
wxFAIL_MSG("Reference count of native tool was illegal before removal");
}
wxASSERT( IsValidControlHandle(tool->GetControl()->GetPeer()->GetControlRef() )) ;
wxFAIL_MSG("Reference count of native tool was illegal before removal");
}
wxASSERT( IsValidControlHandle(tool->GetControl()->GetPeer()->GetControlRef() )) ;
bool wantNativeToolbar, ownToolbarInstalled;
// attempt to install the native toolbar
bool wantNativeToolbar, ownToolbarInstalled;
// attempt to install the native toolbar
MacInstallNativeToolbar( wantNativeToolbar );
(void)MacTopLevelHasNativeToolbar( &ownToolbarInstalled );
if (!ownToolbarInstalled)
MacInstallNativeToolbar( wantNativeToolbar );
(void)MacTopLevelHasNativeToolbar( &ownToolbarInstalled );
if (!ownToolbarInstalled)
HIToolbarItemRef item;
HIViewRef viewRef = (HIViewRef) tool->GetControl()->GetHandle() ;
CFDataRef data = CFDataCreate( kCFAllocatorDefault , (UInt8*) &viewRef , sizeof(viewRef) ) ;
HIToolbarItemRef item;
HIViewRef viewRef = (HIViewRef) tool->GetControl()->GetHandle() ;
CFDataRef data = CFDataCreate( kCFAllocatorDefault , (UInt8*) &viewRef , sizeof(viewRef) ) ;