// when embedding native controls in the native toolbar we must make sure the
// control does not get deleted behind our backs, so the retain count gets increased
// when embedding native controls in the native toolbar we must make sure the
// control does not get deleted behind our backs, so the retain count gets increased
// object, and second by the code 'creating' the custom HIView (which is the same as the
// already existing native control, therefore we just increase the ref count)
// when this view is removed from the native toolbar its count gets decremented again
// object, and second by the code 'creating' the custom HIView (which is the same as the
// already existing native control, therefore we just increase the ref count)
// when this view is removed from the native toolbar its count gets decremented again
- // different behaviour under Leopard
- if ( UMAGetSystemVersion() < 0x1050 )
- {
- wxASSERT_MSG( count == 1 , wxT("Reference Count of native tool was not 1 in wxToolBarTool destructor") );
- }
+ // different behaviour under Leopard
+ if ( UMAGetSystemVersion() < 0x1050 )
+ {
+ if ( count != 1 )
+ {
+ wxFAIL_MSG("Reference count of native tool was not 1 in wxToolBarTool destructor");
+ }
+ }
- wxMacCFStringHolder( GetShortHelp(), enc ),
- wxMacCFStringHolder( GetLongHelp(), enc ) );
+ wxCFStringRef( GetShortHelp(), enc ),
+ wxCFStringRef( GetLongHelp(), enc ) );
// depending whether the wxControl corresponding to this HIView has already been destroyed or
// not, ref counts differ, so we cannot assert a special value
CFIndex count = CFGetRetainCount( viewRef ) ;
// depending whether the wxControl corresponding to this HIView has already been destroyed or
// not, ref counts differ, so we cannot assert a special value
CFIndex count = CFGetRetainCount( viewRef ) ;
- wxMacCFStringHolder( labelStr, wxFont::GetDefaultEncoding() ), 0,
+ wxCFStringRef( labelStr, wxFont::GetDefaultEncoding() ), 0,
- // Leopard seems to have one refcount more, so we cannot check reliably at the moment
- if ( UMAGetSystemVersion() < 0x1050 )
- {
- wxASSERT_MSG( count == 1 , wxT("Reference Count of native control was not 1 in wxToolBar destructor") );
- }
+ // Leopard seems to have one refcount more, so we cannot check reliably at the moment
+ if ( UMAGetSystemVersion() < 0x1050 )
+ {
+ if ( count != 1 )
+ {
+ wxFAIL_MSG("Reference count of native control was not 1 in wxToolBar destructor");
+ }
+ }
if ( tool2->IsControl() )
{
CFIndex count = CFGetRetainCount( tool2->GetControl()->GetPeer()->GetControlRef() ) ;
if ( tool2->IsControl() )
{
CFIndex count = CFGetRetainCount( tool2->GetControl()->GetPeer()->GetControlRef() ) ;
wxASSERT( IsValidControlHandle(tool2->GetControl()->GetPeer()->GetControlRef() )) ;
}
err = HIToolbarRemoveItemAtIndex(refTB, idx);
wxASSERT( IsValidControlHandle(tool2->GetControl()->GetPeer()->GetControlRef() )) ;
}
err = HIToolbarRemoveItemAtIndex(refTB, idx);
if ( tool2->IsControl() )
{
CFIndex count = CFGetRetainCount( tool2->GetControl()->GetPeer()->GetControlRef() ) ;
if ( tool2->IsControl() )
{
CFIndex count = CFGetRetainCount( tool2->GetControl()->GetPeer()->GetControlRef() ) ;
HIToolbarItemRef item;
wxString labelStr = wxString::Format(wxT("%p"), tool);
err = HIToolbarItemCreate(
HIToolbarItemRef item;
wxString labelStr = wxString::Format(wxT("%p"), tool);
err = HIToolbarItemCreate(
InstallEventHandler(
HIObjectGetEventTarget(item), GetwxMacToolBarEventHandlerUPP(),
GetEventTypeCount(toolBarEventList), toolBarEventList, tool, NULL );
InstallEventHandler(
HIObjectGetEventTarget(item), GetwxMacToolBarEventHandlerUPP(),
GetEventTypeCount(toolBarEventList), toolBarEventList, tool, NULL );
HIToolbarItemSetImage( item, info2.u.imageRef );
HIToolbarItemSetCommandID( item, kHIToolbarCommandPressAction );
tool->SetToolbarItemRef( item );
HIToolbarItemSetImage( item, info2.u.imageRef );
HIToolbarItemSetCommandID( item, kHIToolbarCommandPressAction );
tool->SetToolbarItemRef( item );
- SetControlTitleWithCFString( m_controlHandle , wxMacCFStringHolder( label, wxFont::GetDefaultEncoding() );
+ SetControlTitleWithCFString( m_controlHandle , wxCFStringRef( label, wxFont::GetDefaultEncoding() );