]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/ctrlcmn.cpp
implemented wxSS::GetMetric on wxGTK2 (patch 950618)
[wxWidgets.git] / src / common / ctrlcmn.cpp
index b46c4f8f8da1f3427ebae4f60e1fd0e27679edb6..437aea4a0a1efd7ae712d1ea8d0a6d6e49d5bf82 100644 (file)
@@ -5,7 +5,7 @@
 // Modified by:
 // Created:     26.07.99
 // RCS-ID:      $Id$
-// Copyright:   (c) wxWindows team
+// Copyright:   (c) wxWidgets team
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
@@ -116,6 +116,19 @@ void wxControlBase::InitCommandEvent(wxCommandEvent& event) const
     }
 }
 
+
+void wxControlBase::SetLabel( const wxString &label )
+{
+    InvalidateBestSize();
+    wxWindow::SetLabel(label);   
+}
+
+bool wxControlBase::SetFont(const wxFont& font)
+{
+    InvalidateBestSize();
+    return wxWindow::SetFont(font);
+}
+
 // ----------------------------------------------------------------------------
 // wxStaticBitmap
 // ----------------------------------------------------------------------------
@@ -127,14 +140,17 @@ wxStaticBitmapBase::~wxStaticBitmapBase()
     // this destructor is required for Darwin
 }
 
-wxSize wxStaticBitmapBase::DoGetBestClientSize() const
+wxSize wxStaticBitmapBase::DoGetBestSize() const
 {
+    wxSize best;
     wxBitmap bmp = GetBitmap();
     if ( bmp.Ok() )
-        return wxSize(bmp.GetWidth(), bmp.GetHeight());
-
-    // this is completely arbitrary
-    return wxSize(16, 16);
+        best = wxSize(bmp.GetWidth(), bmp.GetHeight());
+    else
+        // this is completely arbitrary
+        best = wxSize(16, 16);
+    CacheBestSize(best);
+    return best;
 }
 
 #endif // wxUSE_STATBMP