]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/GenericButtons.py
Another package name fix
[wxWidgets.git] / wxPython / demo / GenericButtons.py
index 7bbe9d57042f2fc43f3282edec41f6642828f0d6..7a08befcffa76514d1f96ea3c8f737df277f7fe9 100644 (file)
@@ -43,7 +43,6 @@ class TestPanel(wx.Panel):
         self.Bind(wx.EVT_BUTTON, self.OnBiggerButton, b)
         b.SetFont(wx.Font(20, wx.SWISS, wx.NORMAL, wx.BOLD, False))
         b.SetBezelWidth(5)
         self.Bind(wx.EVT_BUTTON, self.OnBiggerButton, b)
         b.SetFont(wx.Font(20, wx.SWISS, wx.NORMAL, wx.BOLD, False))
         b.SetBezelWidth(5)
-        ###b.SetBestSize()
         b.SetMinSize(wx.DefaultSize)
         b.SetBackgroundColour("Navy")
         b.SetForegroundColour(wx.WHITE)
         b.SetMinSize(wx.DefaultSize)
         b.SetBackgroundColour("Navy")
         b.SetForegroundColour(wx.WHITE)
@@ -76,7 +75,7 @@ class TestPanel(wx.Panel):
         mask = wx.Mask(bmp, wx.BLUE)
         bmp.SetMask(mask)
         b.SetBitmapSelected(bmp)
         mask = wx.Mask(bmp, wx.BLUE)
         bmp.SetMask(mask)
         b.SetBitmapSelected(bmp)
-        b.SetBestSize()
+        b.SetInitialSize()
         sizer.Add(b)
 
         # A toggle button
         sizer.Add(b)
 
         # A toggle button
@@ -96,7 +95,7 @@ class TestPanel(wx.Panel):
         bmp.SetMask(mask)
         b.SetBitmapSelected(bmp)
         b.SetToggle(True)
         bmp.SetMask(mask)
         b.SetBitmapSelected(bmp)
         b.SetToggle(True)
-        b.SetBestSize()
+        b.SetInitialSize()
         sizer.Add(b)
 
         # A bitmap button with text.
         sizer.Add(b)
 
         # A bitmap button with text.
@@ -111,9 +110,25 @@ class TestPanel(wx.Panel):
         bmp.SetMask(mask)
         b.SetBitmapSelected(bmp)
         b.SetUseFocusIndicator(False)
         bmp.SetMask(mask)
         b.SetBitmapSelected(bmp)
         b.SetUseFocusIndicator(False)
-        b.SetBestSize()
+        b.SetInitialSize()
         sizer.Add(b)
 
         sizer.Add(b)
 
+
+        # a flat text button
+        b = buttons.GenButton(self, -1, 'Flat buttons too!', style=wx.BORDER_NONE)
+        self.Bind(wx.EVT_BUTTON, self.OnButton, b)
+        sizer.Add(b, flag=wx.ALIGN_CENTER_VERTICAL)
+
+        # A flat image button
+        bmp = images.getTest2Bitmap()
+        bmp.SetMaskColour("blue")
+        b = buttons.GenBitmapButton(self, -1, bmp, style=wx.BORDER_NONE)
+        self.Bind(wx.EVT_BUTTON, self.OnButton, b)
+        sizer.Add(b)
+        ##b.SetBackgroundColour("sky blue")
+        ##b.SetBackgroundColour("pink")
+
+
         border = wx.BoxSizer(wx.VERTICAL)
         border.Add(sizer, 0, wx.ALL, 25)
         self.SetSizer(border)
         border = wx.BoxSizer(wx.VERTICAL)
         border.Add(sizer, 0, wx.ALL, 25)
         self.SetSizer(border)