X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..20c81bed846981e90769826b94a91eebb91158f1:/src/univ/stattext.cpp diff --git a/src/univ/stattext.cpp b/src/univ/stattext.cpp index 6f1261c917..83ebf31eaf 100644 --- a/src/univ/stattext.cpp +++ b/src/univ/stattext.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: univ/stattext.cpp +// Name: src/univ/stattext.cpp // Purpose: wxStaticText // Author: Vadim Zeitlin // Modified by: @@ -25,9 +25,10 @@ #if wxUSE_STATTEXT +#include "wx/stattext.h" + #ifndef WX_PRECOMP #include "wx/dcclient.h" - #include "wx/stattext.h" #include "wx/validate.h" #endif @@ -54,9 +55,9 @@ bool wxStaticText::Create(wxWindow *parent, { if ( !wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name) ) return false; - + SetLabel(label); - SetBestSize(size); + SetInitialSize(size); return true; } @@ -87,6 +88,14 @@ wxSize wxStaticText::DoGetBestClientSize() const void wxStaticText::DoDraw(wxControlRenderer *renderer) { + if ( UseBgCol() ) + { + wxDC& dc = renderer->GetDC(); + dc.SetBrush(GetBackgroundColour()); + dc.SetPen(*wxTRANSPARENT_PEN); + dc.DrawRectangle(renderer->GetRect()); + } + renderer->DrawLabel(); }