]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/lib/colourselect.py
Merge recent wxPython changes from 2.8 branch to HEAD
[wxWidgets.git] / wxPython / wx / lib / colourselect.py
index 787a1d925ddd061f7ceb48da17acf8cc7a13a70e..4c39ece648e4d38aac4c1f4d2e71e63effdf9e87 100644 (file)
 # o Updated for 2.5 compatability.
 #
 
+"""
+Provides a `ColourSelect` button that, when clicked, will display a
+colour selection dialog.  The selected colour is displayed on the
+button itself.
+"""
+
 #----------------------------------------------------------------------------
 
 import  wx
@@ -54,7 +60,7 @@ EVT_COLOURSELECT = wx.PyEventBinder(wxEVT_COMMAND_COLOURSELECT, 1)
 #----------------------------------------------------------------------------
 
 class ColourSelect(wx.BitmapButton):
-    def __init__(self, parent, id, label="", colour=wx.BLACK,
+    def __init__(self, parent, id=wx.ID_ANY, label="", colour=wx.BLACK,
                  pos=wx.DefaultPosition, size=wx.DefaultSize,
                  callback=None, style=0):
         if label:
@@ -104,7 +110,7 @@ class ColourSelect(wx.BitmapButton):
 
 
     def MakeBitmap(self):
-        bdr = 10
+        bdr = 8
         width, height = self.GetSize()
 
         # yes, this is weird, but it appears to work around a bug in wxMac
@@ -134,10 +140,10 @@ class ColourSelect(wx.BitmapButton):
 
     def SetBitmap(self, bmp):
         self.SetBitmapLabel(bmp)
-        self.SetBitmapSelected(bmp)
-        self.SetBitmapDisabled(bmp)
-        self.SetBitmapFocus(bmp)
-        self.SetBitmapSelected(bmp)
+        #self.SetBitmapSelected(bmp)
+        #self.SetBitmapDisabled(bmp)
+        #self.SetBitmapFocus(bmp)
+        #self.SetBitmapSelected(bmp)
         self.Refresh()