DisposeControl( m_controlHandle );
else
{
- // the embedded control is not under the responsibility of the tool, it will be disposed of in the
+ // the embedded control is not under the responsibility of the tool, it gets disposed of in the
// proper wxControl destructor
- wxASSERT( IsValidControlHandle(GetControl()->GetPeer()->GetControlRef() )) ;
}
m_controlHandle = NULL ;
}
HIToolbarItemSetHelpText(
m_toolbarItemRef,
- wxMacCFStringHolder( GetShortHelp(), enc ),
- wxMacCFStringHolder( GetLongHelp(), enc ) );
+ wxCFStringRef( GetShortHelp(), enc ),
+ wxCFStringRef( GetLongHelp(), enc ) );
}
}
if ( m_controlHandle != NULL )
{
-#if TARGET_API_MAC_OSX
if ( enable )
EnableControl( m_controlHandle );
else
DisableControl( m_controlHandle );
-#else
- if ( enable )
- ActivateControl( m_controlHandle );
- else
- DeactivateControl( m_controlHandle );
-#endif
}
}
if ( mac_x != former_mac_x || mac_y != former_mac_y )
{
- UMAMoveControl( m_controlHandle, mac_x, mac_y );
+ ::MoveControl( m_controlHandle, mac_x, mac_y );
}
}
else if ( IsControl() )
int former_mac_y = contrlRect.top;
if ( mac_x != former_mac_x || mac_y != former_mac_y )
- UMAMoveControl( m_controlHandle, mac_x, mac_y );
+ ::MoveControl( m_controlHandle, mac_x, mac_y );
}
}
{
wxString labelStr = wxString::Format( wxT("%p"), this );
err = HIToolbarCreate(
- wxMacCFStringHolder( labelStr, wxFont::GetDefaultEncoding() ), 0,
+ wxCFStringRef( labelStr, wxFont::GetDefaultEncoding() ), 0,
(HIToolbarRef*) &m_macHIToolbarRef );
if (m_macHIToolbarRef != NULL)
HIToolbarItemRef item;
wxString labelStr = wxString::Format(wxT("%p"), tool);
err = HIToolbarItemCreate(
- wxMacCFStringHolder(labelStr, wxFont::GetDefaultEncoding()),
+ wxCFStringRef(labelStr, wxFont::GetDefaultEncoding()),
kHIToolbarItemCantBeRemoved | kHIToolbarItemAnchoredLeft | kHIToolbarItemAllowDuplicates, &item );
if (err == noErr)
{
InstallEventHandler(
HIObjectGetEventTarget(item), GetwxMacToolBarEventHandlerUPP(),
GetEventTypeCount(toolBarEventList), toolBarEventList, tool, NULL );
- HIToolbarItemSetLabel( item, wxMacCFStringHolder(label, m_font.GetEncoding()) );
+ HIToolbarItemSetLabel( item, wxCFStringRef(label, m_font.GetEncoding()) );
HIToolbarItemSetImage( item, info2.u.imageRef );
HIToolbarItemSetCommandID( item, kHIToolbarCommandPressAction );
tool->SetToolbarItemRef( item );
#if 0
SetBevelButtonTextPlacement( m_controlHandle, kControlBevelButtonPlaceBelowGraphic );
- UMASetControlTitle( m_controlHandle, label, wxFont::GetDefaultEncoding() );
+ SetControlTitleWithCFString( m_controlHandle , wxCFStringRef( label, wxFont::GetDefaultEncoding() );
#endif
InstallControlEventHandler(
ControlRef container = (ControlRef) GetHandle();
wxASSERT_MSG( container != NULL, wxT("No valid Mac container control") );
- UMAShowControl( controlHandle );
+ SetControlVisibility( controlHandle, true, true );
::EmbedControl( controlHandle, container );
}
bool drawMetalTheme = MacGetTopLevelWindow()->MacGetMetalAppearance();
-#if wxMAC_USE_CORE_GRAPHICS
if ( !drawMetalTheme )
{
HIThemePlacardDrawInfo info;
// leave the background as it is (striped or metal)
}
-#else
-
- const bool drawBorder = true;
-
- if (drawBorder)
- {
- wxMacPortSetter helper( &dc );
-
- if ( !drawMetalTheme )
- {
- Rect toolbarrect = { dc.YLOG2DEVMAC(0), dc.XLOG2DEVMAC(0),
- dc.YLOG2DEVMAC(h), dc.XLOG2DEVMAC(w) };
-
-#if 0
- if ( toolbarrect.left < 0 )
- toolbarrect.left = 0;
- if ( toolbarrect.top < 0 )
- toolbarrect.top = 0;
-#endif
-
- UMADrawThemePlacard( &toolbarrect, IsEnabled() ? kThemeStateActive : kThemeStateInactive );
- }
- else
- {
-#if TARGET_API_MAC_OSX
- HIRect hiToolbarrect = CGRectMake(
- dc.YLOG2DEVMAC(0), dc.XLOG2DEVMAC(0),
- dc.YLOG2DEVREL(h), dc.XLOG2DEVREL(w) );
- CGContextRef cgContext;
- Rect bounds;
-
- GetPortBounds( (CGrafPtr) dc.m_macPort, &bounds );
- QDBeginCGContext( (CGrafPtr) dc.m_macPort, &cgContext );
-
- CGContextTranslateCTM( cgContext, 0, bounds.bottom - bounds.top );
- CGContextScaleCTM( cgContext, 1, -1 );
-
- HIThemeBackgroundDrawInfo drawInfo;
- drawInfo.version = 0;
- drawInfo.state = kThemeStateActive;
- drawInfo.kind = kThemeBackgroundMetal;
- HIThemeApplyBackground( &hiToolbarrect, &drawInfo, cgContext, kHIThemeOrientationNormal );
-
-#ifndef __LP64__
- QDEndCGContext( (CGrafPtr) dc.m_macPort, &cgContext );
-#endif
-#endif
- }
- }
-#endif
-
event.Skip();
}