X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/969d9b6fa963c0f14298e0ec8aa88b6d6292a6f8..f78e4942ec0f3f6abd2992502e2d6c5c2e8e55f6:/wxPython/wx/lib/buttons.py diff --git a/wxPython/wx/lib/buttons.py b/wxPython/wx/lib/buttons.py index 68260c0572..acc7ee46a4 100644 --- a/wxPython/wx/lib/buttons.py +++ b/wxPython/wx/lib/buttons.py @@ -66,18 +66,23 @@ class GenButton(wx.PyControl): pos = wx.DefaultPosition, size = wx.DefaultSize, style = 0, validator = wx.DefaultValidator, name = "genbutton"): - if style == 0: - style = wx.NO_BORDER - wx.PyControl.__init__(self, parent, ID, pos, size, style, validator, name) + cstyle = style + if cstyle == 0: + cstyle = wx.NO_BORDER + wx.PyControl.__init__(self, parent, ID, pos, size, cstyle, validator, name) self.up = True - self.bezelWidth = 2 self.hasFocus = False - self.useFocusInd = True + if style & wx.NO_BORDER: + self.bezelWidth = 0 + self.useFocusInd = False + else: + self.bezelWidth = 2 + self.useFocusInd = True self.SetLabel(label) self.InheritAttributes() - self.SetBestSize(size) + self.SetBestFittingSize(size) self.InitColours() self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown) @@ -100,7 +105,7 @@ class GenButton(wx.PyControl): """ if size is None: size = wx.DefaultSize - wx.PyControl.SetBestSize(self, size) + wx.PyControl.SetBestFittingSize(self, size) def DoGetBestSize(self):