git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54954
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
m_toolbarItemRef = ref;
if ( m_toolbarItemRef )
{
m_toolbarItemRef = ref;
if ( m_toolbarItemRef )
{
- wxFont f;
- wxFontEncoding enc;
- if ( GetToolBar() )
- f = GetToolBar()->GetFont();
- if ( f.IsOk() )
- enc = f.GetEncoding();
- else
- enc = wxFont::GetDefaultEncoding();
+ wxFontEncoding enc = GetToolBarFontEncoding();
HIToolbarItemSetHelpText(
m_toolbarItemRef,
HIToolbarItemSetHelpText(
m_toolbarItemRef,
if ( m_toolbarItemRef )
{
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);
// strip mnemonics from the label for compatibility with the usual
// labels in wxStaticText sense
wxString labelStr = wxStripMenuCodes(label);
- HIToolbarItemSetLabel( m_toolbarItemRef, wxCFStringRef(labelStr, enc) );
+ HIToolbarItemSetLabel(
+ m_toolbarItemRef,
+ wxCFStringRef(labelStr, GetToolBarFontEncoding()) );
}
}
#endif // wxOSX_USE_NATIVE_TOOLBAR
private:
}
}
#endif // wxOSX_USE_NATIVE_TOOLBAR
private:
+#if wxOSX_USE_NATIVE_TOOLBAR
+ wxFontEncoding GetToolBarFontEncoding() const
+ {
+ wxFont f;
+ wxFontEncoding enc;
+ if ( GetToolBar() )
+ f = GetToolBar()->GetFont();
+ return f.IsOk() ? f.GetEncoding() : wxFont::GetDefaultEncoding();
+ }
+#endif // wxOSX_USE_NATIVE_TOOLBAR
+
void Init()
{
m_controlHandle = NULL;
void Init()
{
m_controlHandle = NULL;