]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/stattext.cpp
Fixed premature exit of helpview sample and utility
[wxWidgets.git] / src / univ / stattext.cpp
index 6f1261c91761e5be698feb074aae3cd8bf8319ff..83ebf31eaf51cec685a486fd40f6a7f838eb51f7 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// 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
 
@@ -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();
 }