no real changes, just refactor to remove some code duplication in wxToolBarTool
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54954 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -178,14 +178,7 @@ public:
|
|||||||
m_toolbarItemRef = ref;
|
m_toolbarItemRef = ref;
|
||||||
if ( m_toolbarItemRef )
|
if ( m_toolbarItemRef )
|
||||||
{
|
{
|
||||||
wxFont f;
|
wxFontEncoding enc = GetToolBarFontEncoding();
|
||||||
wxFontEncoding enc;
|
|
||||||
if ( GetToolBar() )
|
|
||||||
f = GetToolBar()->GetFont();
|
|
||||||
if ( f.IsOk() )
|
|
||||||
enc = f.GetEncoding();
|
|
||||||
else
|
|
||||||
enc = wxFont::GetDefaultEncoding();
|
|
||||||
|
|
||||||
HIToolbarItemSetHelpText(
|
HIToolbarItemSetHelpText(
|
||||||
m_toolbarItemRef,
|
m_toolbarItemRef,
|
||||||
@@ -215,25 +208,29 @@ public:
|
|||||||
|
|
||||||
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
|
// strip mnemonics from the label for compatibility with the usual
|
||||||
// labels in wxStaticText sense
|
// labels in wxStaticText sense
|
||||||
wxString labelStr = wxStripMenuCodes(label);
|
wxString labelStr = wxStripMenuCodes(label);
|
||||||
|
|
||||||
HIToolbarItemSetLabel( m_toolbarItemRef, wxCFStringRef(labelStr, enc) );
|
HIToolbarItemSetLabel(
|
||||||
|
m_toolbarItemRef,
|
||||||
|
wxCFStringRef(labelStr, GetToolBarFontEncoding()) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // wxOSX_USE_NATIVE_TOOLBAR
|
#endif // wxOSX_USE_NATIVE_TOOLBAR
|
||||||
|
|
||||||
private:
|
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()
|
void Init()
|
||||||
{
|
{
|
||||||
m_controlHandle = NULL;
|
m_controlHandle = NULL;
|
||||||
|
Reference in New Issue
Block a user