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:
style = self.GetWindowStyleFlag()
self.InvalidateBestSize()
if not style & wx.ST_NO_AUTORESIZE:
- self.SetBestFittingSize(self.GetBestSize())
+ self.SetSize(self.GetBestSize())
self.Refresh()
style = self.GetWindowStyleFlag()
self.InvalidateBestSize()
if not style & wx.ST_NO_AUTORESIZE:
- self.SetBestFittingSize(self.GetBestSize())
+ self.SetSize(self.GetBestSize())
self.Refresh()
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()