Add markup support to wxOSX/Cocoa wxStaticText and wxButton.

Add wxMarkupToAttrString helper that converts wx markup to OS X attribute
strings and use it in wxStaticText and wxButton.

This required adding new SetLabelMarkup() method to wxWidgetCocoaImpl, it
seems to make sense to have it there as it could be implemented by more
controls in the future.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67069 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-02-27 12:48:46 +00:00
parent 83586c2aae
commit f672c96951
8 changed files with 210 additions and 8 deletions

View File

@@ -104,6 +104,20 @@ void wxStaticText::DoSetLabel(const wxString& label)
m_peer->SetLabel(m_label , GetFont().GetEncoding() );
}
#if wxUSE_MARKUP && wxOSX_USE_COCOA
bool wxStaticText::DoSetLabelMarkup(const wxString& markup)
{
if ( !wxStaticTextBase::DoSetLabelMarkup(markup) )
return false;
m_peer->SetLabelMarkup(markup);
return true;
}
#endif // wxUSE_MARKUP && wxOSX_USE_COCOA
wxString wxStaticText::DoGetLabel() const
{
return m_label;