]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/lib/stattext.py
Re-add the wxQTMediaBackend class, by copying the code for it from the
[wxWidgets.git] / wxPython / wx / lib / stattext.py
index 1f47005e3661880dafc01e5c419eec1c8927bf0b..54d7c64e93c7bbccc8ff5cc5abb760d86d7b6cd5 100644 (file)
@@ -36,7 +36,7 @@ class GenStaticText(wx.PyControl):
 
         wx.PyControl.SetLabel(self, label) # don't check wx.ST_NO_AUTORESIZE yet
         self.InheritAttributes()
-        self.SetBestFittingSize(size)
+        self.SetInitialSize(size)
 
         self.Bind(wx.EVT_PAINT, self.OnPaint)
         if BUFFERED:
@@ -56,7 +56,7 @@ class GenStaticText(wx.PyControl):
         style = self.GetWindowStyleFlag()
         self.InvalidateBestSize()
         if not style & wx.ST_NO_AUTORESIZE:
-            self.SetBestFittingSize(self.GetBestSize())
+            self.SetInitialSize(self.GetBestSize())
         self.Refresh()
 
 
@@ -69,7 +69,7 @@ class GenStaticText(wx.PyControl):
         style = self.GetWindowStyleFlag()
         self.InvalidateBestSize()
         if not style & wx.ST_NO_AUTORESIZE:
-            self.SetBestFittingSize(self.GetBestSize())
+            self.SetInitialSize(self.GetBestSize())
         self.Refresh()
 
 
@@ -137,7 +137,10 @@ class GenStaticText(wx.PyControl):
             dc.SetBackground(backBrush)
             dc.Clear()
 
-        dc.SetTextForeground(self.GetForegroundColour())
+        if self.IsEnabled():
+             dc.SetTextForeground(self.GetForegroundColour())
+         else:
+             dc.SetTextForeground(wx.SystemSettings.GetColour(wx.SYS_COLOUR_GRAYTEXT))
         dc.SetFont(self.GetFont())
         label = self.GetLabel()
         style = self.GetWindowStyleFlag()