X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a290fa5a7deebe9d96c0c0089d18e27d4bd9b624..4542739ccb3b2ad47afc66b7a3182568a182b71f:/src/univ/stattext.cpp diff --git a/src/univ/stattext.cpp b/src/univ/stattext.cpp index a5f4c03eb0..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: @@ -17,10 +17,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "univstattext.h" -#endif - #include "wx/wxprec.h" #ifdef __BORLANDC__ @@ -29,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 @@ -58,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; } @@ -91,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(); }