]> 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 589179cd9c6c43742848594881dfce542036bca2..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)
-// Licence:     wxWindows license
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // ============================================================================
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
-    #pragma implementation "univstattext.h"
-#endif
-
 #include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
 
 #if wxUSE_STATTEXT
 
+#include "wx/stattext.h"
+
 #ifndef WX_PRECOMP
     #include "wx/dcclient.h"
-    #include "wx/stattext.h"
     #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) )
-        return FALSE;
+        return false;
 
     SetLabel(label);
-    SetBestSize(size);
+    SetInitialSize(size);
 
-    return TRUE;
+    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();
 }