X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/30a224112742357fa240cf0e196bbc05b60ff242..f8c10795d589c024dc7fc3640087a48a1ec612ce:/src/msw/stattext.cpp diff --git a/src/msw/stattext.cpp b/src/msw/stattext.cpp index 466fb5484d..cc4b995d2d 100644 --- a/src/msw/stattext.cpp +++ b/src/msw/stattext.cpp @@ -126,27 +126,6 @@ WXDWORD wxStaticText::MSWGetStyle(long style, WXDWORD *exstyle) const return msStyle; } -WXHBRUSH wxStaticText::DoMSWControlColor(WXHDC pDC, wxColour colBg) -{ - // If this control has a non-standard fg colour but still has the standard - // bg then we need to also give it a non-standard bg otherwise the fg - // setting has no effect. - WXHBRUSH hbr = wxControl::DoMSWControlColor(pDC, colBg); - if (!hbr && m_hasFgCol) - { - hbr = MSWGetBgBrushForChild(pDC, this); - if (!hbr) - { - HDC hdc = (HDC)pDC; - wxColour bg = GetBackgroundColour(); - ::SetBkColor(hdc, wxColourToRGB(bg)); - wxBrush *brush = wxTheBrushList->FindOrCreateBrush(bg, wxSOLID); - hbr = (WXHBRUSH)brush->GetResourceHandle(); - } - } - return hbr; -} - wxSize wxStaticText::DoGetBestSize() const { wxClientDC dc(wx_const_cast(wxStaticText *, this)); @@ -164,7 +143,9 @@ wxSize wxStaticText::DoGetBestSize() const widthTextMax += 2; #endif // __WXWINCE__ - return wxSize(widthTextMax, heightTextTotal); + wxSize best(widthTextMax, heightTextTotal); + CacheBestSize(best); + return best; } void wxStaticText::DoSetSize(int x, int y, int w, int h, int sizeFlags)