implement wxToolBarTool::SetLabel() for wxOSX_USE_NATIVE_TOOLBAR (#9746)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54953 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2008-08-03 11:23:51 +00:00
parent fb0400941f
commit e3e061ee13

View File

@ -208,7 +208,30 @@ public:
{
return m_index;
}
#endif
virtual void SetLabel(const wxString& label)
{
wxToolBarToolBase::SetLabel(label);
if ( m_toolbarItemRef )
{
wxFont f;
wxFontEncoding enc;
if ( GetToolBar() )
f = GetToolBar()->GetFont();
if ( f.IsOk() )
enc = f.GetEncoding();
else
enc = wxFont::GetDefaultEncoding();
// strip mnemonics from the label for compatibility with the usual
// labels in wxStaticText sense
wxString labelStr = wxStripMenuCodes(label);
HIToolbarItemSetLabel( m_toolbarItemRef, wxCFStringRef(labelStr, enc) );
}
}
#endif // wxOSX_USE_NATIVE_TOOLBAR
private:
void Init()