X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4b52555d714a166af0b2f486cdf67e5f373f86d1..77c8efc8c37da6d6a5e2e8022d21d1cd7d76371d:/src/common/ctrlcmn.cpp diff --git a/src/common/ctrlcmn.cpp b/src/common/ctrlcmn.cpp old mode 100755 new mode 100644 index fc41159953..af5c83292f --- a/src/common/ctrlcmn.cpp +++ b/src/common/ctrlcmn.cpp @@ -38,6 +38,8 @@ #include "wx/settings.h" #endif +#include "wx/private/markupparser.h" + const char wxControlNameStr[] = "control"; // ============================================================================ @@ -147,6 +149,12 @@ void wxControlBase::DoUpdateWindowUI(wxUpdateUIEvent& event) #endif // wxUSE_RADIOBTN } +wxSize wxControlBase::DoGetSizeFromTextSize(int WXUNUSED(xlen), + int WXUNUSED(ylen)) const +{ + return wxSize(-1, -1); +} + /* static */ wxString wxControlBase::GetLabelText(const wxString& label) { @@ -230,6 +238,31 @@ wxControlBase::GetCompositeControlsDefaultAttributes(wxWindowVariant WXUNUSED(va return attrs; } +// ---------------------------------------------------------------------------- +// wxControl markup support +// ---------------------------------------------------------------------------- + +#if wxUSE_MARKUP + +/* static */ +wxString wxControlBase::RemoveMarkup(const wxString& markup) +{ + return wxMarkupParser::Strip(markup); +} + +bool wxControlBase::DoSetLabelMarkup(const wxString& markup) +{ + const wxString label = RemoveMarkup(markup); + if ( label.empty() && !markup.empty() ) + return false; + + SetLabel(label); + + return true; +} + +#endif // wxUSE_MARKUP + // ---------------------------------------------------------------------------- // wxControlBase - ellipsization code // ---------------------------------------------------------------------------- @@ -561,7 +594,7 @@ wxSize wxStaticBitmapBase::DoGetBestSize() const { wxSize best; wxBitmap bmp = GetBitmap(); - if ( bmp.Ok() ) + if ( bmp.IsOk() ) best = wxSize(bmp.GetWidth(), bmp.GetHeight()); else // this is completely arbitrary