+#if wxUSE_MARKUP
+ virtual void SetLabelMarkup( const wxString& markup)
+ {
+ wxMarkupToAttrString toAttr(GetWXPeer(), markup);
+
+ DoSetAttrString(toAttr.GetNSAttributedString());
+ }
+#endif // wxUSE_MARKUP
+
+private:
+ void DoSetAttrString(NSMutableAttributedString *attrstring)
+ {
+ NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+ [paragraphStyle setLineBreakMode:m_lineBreak];
+ int style = GetWXPeer()->GetWindowStyleFlag();
+ if (style & wxALIGN_CENTER_HORIZONTAL)
+ [paragraphStyle setAlignment: NSCenterTextAlignment];
+ else if (style & wxALIGN_RIGHT)
+ [paragraphStyle setAlignment: NSRightTextAlignment];
+
+ [attrstring addAttribute:NSParagraphStyleAttributeName
+ value:paragraphStyle
+ range:NSMakeRange(0, [attrstring length])];
+ NSCell* cell = [(wxNSStaticTextView *)GetWXWidget() cell];
+ [cell setAttributedStringValue:attrstring];
+ [paragraphStyle release];
+ }
+
+ NSLineBreakMode m_lineBreak;
+};
+
+wxSize wxStaticText::DoGetBestSize() const
+{
+ return wxWindowMac::DoGetBestSize() ;
+}