/////////////////////////////////////////////////////////////////////////////
-// Name: univ/stattext.cpp
+// Name: src/univ/stattext.cpp
// Purpose: wxStaticText
// Author: Vadim Zeitlin
// Modified by:
#if wxUSE_STATTEXT
+#include "wx/stattext.h"
+
#ifndef WX_PRECOMP
#include "wx/dcclient.h"
- #include "wx/stattext.h"
#include "wx/validate.h"
#endif
{
if ( !wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name) )
return false;
-
+
SetLabel(label);
- SetBestSize(size);
+ SetInitialSize(size);
return true;
}
void wxStaticText::DoDraw(wxControlRenderer *renderer)
{
+ if ( UseBgCol() )
+ {
+ wxDC& dc = renderer->GetDC();
+ dc.SetBrush(GetBackgroundColour());
+ dc.SetPen(*wxTRANSPARENT_PEN);
+ dc.DrawRectangle(renderer->GetRect());
+ }
+
renderer->DrawLabel();
}