]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/stattext.cpp
why was this class made a wxControlContainer (rev. 1.7), this doesn't seem to make...
[wxWidgets.git] / src / univ / stattext.cpp
index 51e32968ceefeca957ce7b971d509db81f76f351..83ebf31eaf51cec685a486fd40f6a7f838eb51f7 100644 (file)
@@ -1,12 +1,12 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
-// Name:        univ/stattext.cpp
+// Name:        src/univ/stattext.cpp
 // Purpose:     wxStaticText
 // Author:      Vadim Zeitlin
 // Modified by:
 // Created:     14.08.00
 // RCS-ID:      $Id$
 // Copyright:   (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
 // Purpose:     wxStaticText
 // Author:      Vadim Zeitlin
 // Modified by:
 // Created:     14.08.00
 // RCS-ID:      $Id$
 // Copyright:   (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
-// Licence:     wxWidgets licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // ============================================================================
 /////////////////////////////////////////////////////////////////////////////
 
 // ============================================================================
 // headers
 // ----------------------------------------------------------------------------
 
 // headers
 // ----------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "univstattext.h"
-#endif
-
 #include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
 #include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
 
 #if wxUSE_STATTEXT
 
 
 #if wxUSE_STATTEXT
 
+#include "wx/stattext.h"
+
 #ifndef WX_PRECOMP
     #include "wx/dcclient.h"
 #ifndef WX_PRECOMP
     #include "wx/dcclient.h"
-    #include "wx/stattext.h"
     #include "wx/validate.h"
 #endif
 
     #include "wx/validate.h"
 #endif
 
@@ -57,12 +54,12 @@ bool wxStaticText::Create(wxWindow *parent,
                           const wxString &name)
 {
     if ( !wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name) )
                           const wxString &name)
 {
     if ( !wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name) )
-        return FALSE;
-        
+        return false;
+
     SetLabel(label);
     SetLabel(label);
-    SetBestSize(size);
+    SetInitialSize(size);
 
 
-    return TRUE;
+    return true;
 }
 
 // ----------------------------------------------------------------------------
 }
 
 // ----------------------------------------------------------------------------
@@ -91,6 +88,14 @@ wxSize wxStaticText::DoGetBestClientSize() const
 
 void wxStaticText::DoDraw(wxControlRenderer *renderer)
 {
 
 void wxStaticText::DoDraw(wxControlRenderer *renderer)
 {
+    if ( UseBgCol() )
+    {
+        wxDC& dc = renderer->GetDC();
+        dc.SetBrush(GetBackgroundColour());
+        dc.SetPen(*wxTRANSPARENT_PEN);
+        dc.DrawRectangle(renderer->GetRect());
+    }
+
     renderer->DrawLabel();
 }
 
     renderer->DrawLabel();
 }