- // notice that DT_HIDEPREFIX doesn't work on old (pre-Windows 2000)
- // systems but by happy coincidence ODS_NOACCEL is not used under them
- // neither so DT_HIDEPREFIX should never be used there
- DrawButtonText(hdc, &rectBtn, GetLabel(), colFg,
- state & ODS_NOACCEL ? DT_HIDEPREFIX : 0);
+ wxTextColoursChanger changeFg(hdc, colFg, CLR_INVALID);
+ wxBkModeChanger changeBkMode(hdc, wxBRUSHSTYLE_TRANSPARENT);
+
+#if wxUSE_MARKUP
+ if ( m_markupText )
+ {
+ wxDCTemp dc((WXHDC)hdc);
+ dc.SetTextForeground(wxColour(colFg));
+ dc.SetFont(GetFont());
+
+ m_markupText->Render(dc, wxRectFromRECT(rectBtn),
+ state & ODS_NOACCEL
+ ? wxMarkupText::Render_Default
+ : wxMarkupText::Render_ShowAccels);
+ }
+ else // Plain text label
+#endif // wxUSE_MARKUP
+ {
+ // notice that DT_HIDEPREFIX doesn't work on old (pre-Windows 2000)
+ // systems but by happy coincidence ODS_NOACCEL is not used under
+ // them neither so DT_HIDEPREFIX should never be used there
+ DrawButtonText(hdc, &rectBtn, this,
+ state & ODS_NOACCEL ? DT_HIDEPREFIX : 0);
+ }