git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28627
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
b.SetFont(wx.Font(20, wx.SWISS, wx.NORMAL, wx.BOLD, False))
b.SetBezelWidth(5)
###b.SetBestSize()
b.SetFont(wx.Font(20, wx.SWISS, wx.NORMAL, wx.BOLD, False))
b.SetBezelWidth(5)
###b.SetBestSize()
- b.SetSizeHints(wx.DefaultSize)
+ b.SetMinSize(wx.DefaultSize)
b.SetBackgroundColour("Navy")
b.SetForegroundColour(wx.WHITE)
b.SetToolTipString("This is a BIG button...")
b.SetBackgroundColour("Navy")
b.SetForegroundColour(wx.WHITE)
b.SetToolTipString("This is a BIG button...")
self.log = log
wx.Panel.__init__(self, parent, -1, style=0)
self.keysink = KeySink(self)
self.log = log
wx.Panel.__init__(self, parent, -1, style=0)
self.keysink = KeySink(self)
- self.keysink.SetSizeHints((100, 65))
+ self.keysink.SetMinSize((100, 65))
self.keylog = KeyLog(self)
btn = wx.Button(self, -1, "Clear Log")
self.keylog = KeyLog(self)
btn = wx.Button(self, -1, "Clear Log")
self.SetLabel(label)
self.InheritAttributes()
self.SetLabel(label)
self.InheritAttributes()
+ self.SetBestFittingSize(size)
self.InitColours()
self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
self.InitColours()
self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
"""
if size is None:
size = wx.DefaultSize
"""
if size is None:
size = wx.DefaultSize
- wx.PyControl.SetBestSize(self, size)
+ wx.PyControl.SetBestFittingSize(self, size)
self.SetClientSize(self._CalcSize())
width = self.GetSize().width
height = self.GetBestSize().height
self.SetClientSize(self._CalcSize())
width = self.GetSize().width
height = self.GetBestSize().height
- self.SetSize((width, height))
- self.SetSizeHints((width, height))
+ self.SetBestFittingSize((width, height))
width = self.GetSize().width
height = self.GetBestSize().height
dbg('setting client size to:', (width, height))
width = self.GetSize().width
height = self.GetBestSize().height
dbg('setting client size to:', (width, height))
- self.SetSize((width, height))
- self.SetSizeHints((width, height))
+ self.SetBestFittingSize((width, height))
width = self.GetSize().width
height = self.GetBestSize().height
## dbg('setting client size to:', (width, height))
width = self.GetSize().width
height = self.GetBestSize().height
## dbg('setting client size to:', (width, height))
- self.SetSize((width, height))
- self.SetSizeHints((width, height))
+ self.SetBestFittingSize((width, height))
# Set value/type-specific formatting
self._applyFormatting()
# Set value/type-specific formatting
self._applyFormatting()
# the outside size that does include the borders. What you are
# calculating (in _CalcSize) is the client size, but the sizers
# deal with the full size and so that is the minimum size that
# the outside size that does include the borders. What you are
# calculating (in _CalcSize) is the client size, but the sizers
# deal with the full size and so that is the minimum size that
- # we need to set with SetSizeHints. The root of the problem is
+ # we need to set with SetBestFittingSize. The root of the problem is
# that in _calcSize the current client size height is returned,
# instead of a height based on the current font. So I suggest using
# _calcSize to just get the width, and then use GetBestSize to
# that in _calcSize the current client size height is returned,
# instead of a height based on the current font. So I suggest using
# _calcSize to just get the width, and then use GetBestSize to
self.SetClientSize(self._CalcSize())
width = self.GetSize().width
height = self.GetBestSize().height
self.SetClientSize(self._CalcSize())
width = self.GetSize().width
height = self.GetBestSize().height
- self.SetSize((width, height))
- self.SetSizeHints((width, height))
+ self.SetBestFittingSize((width, height))
# Set value/type-specific formatting
# Set value/type-specific formatting
width = self.GetSize().width
height = self.GetBestSize().height
## dbg('setting client size to:', (width, height))
width = self.GetSize().width
height = self.GetBestSize().height
## dbg('setting client size to:', (width, height))
- self.SetSize((width, height))
- self.SetSizeHints((width, height))
+ self.SetBestFittingSize((width, height))
wx.PyScrolledWindow.__init__(self, parent, -1,
pos=pos, size=size,
style=style, name=name)
wx.PyScrolledWindow.__init__(self, parent, -1,
pos=pos, size=size,
style=style, name=name)
+ self.SetBestFittingSize(size)
self.Bind(wx.EVT_CHILD_FOCUS, self.OnChildFocus)
self.Bind(wx.EVT_CHILD_FOCUS, self.OnChildFocus)
wx.DefaultValidator, name)
self._bitmap = bitmap
self.InheritAttributes()
wx.DefaultValidator, name)
self._bitmap = bitmap
self.InheritAttributes()
+ self.SetBestFittingSize(size)
self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
self.Bind(wx.EVT_PAINT, self.OnPaint)
self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
self.Bind(wx.EVT_PAINT, self.OnPaint)
def SetBitmap(self, bitmap):
self._bitmap = bitmap
def SetBitmap(self, bitmap):
self._bitmap = bitmap
- self.SetBestSize( (bitmap.GetWidth(), bitmap.GetHeight()) )
+ self.SetBestFittingSize( (bitmap.GetWidth(), bitmap.GetHeight()) )
wx.PyControl.SetLabel(self, label) # don't check wx.ST_NO_AUTORESIZE yet
self.defBackClr = self.GetBackgroundColour()
self.InheritAttributes()
wx.PyControl.SetLabel(self, label) # don't check wx.ST_NO_AUTORESIZE yet
self.defBackClr = self.GetBackgroundColour()
self.InheritAttributes()
+ self.SetBestFittingSize(size)
self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
self.Bind(wx.EVT_PAINT, self.OnPaint)
self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
self.Bind(wx.EVT_PAINT, self.OnPaint)
if not style & wx.ST_NO_AUTORESIZE:
best = self.GetBestSize()
self.SetSize(best)
if not style & wx.ST_NO_AUTORESIZE:
best = self.GetBestSize()
self.SetSize(best)
- self.SetSizeHints(best)
if not style & wx.ST_NO_AUTORESIZE:
best = self.GetBestSize()
self.SetSize(best)
if not style & wx.ST_NO_AUTORESIZE:
best = self.GetBestSize()
self.SetSize(best)
- self.SetSizeHints(best)