Hack to fix alpha bitmap grayout for Disable() on Gen*BitmapButton

Gen*BitmapButton have a problem when graying out transparent bitmaps for disabled state.
As a code snippet is better than a long talk :

···

------------------------------------
import wx.lib.imageutils
from wx.lib.imageutils import grayOut as old_grayOut
def grayOut(anImage):
    if anImage.HasAlpha():
        AlphaData = anImage.GetAlphaData()
    else :
        AlphaData = None

    old_grayOut(anImage)

    if AlphaData is not None:
        anImage.SetAlphaData(AlphaData)

wx.lib.imageutils.grayOut = grayOut
------------------------------------
Once this done, transparent bitmaps are correctly grayed.

Another small hack, because GenStaticBitmap do not erase transparent parts of the image.
------------------------------------
class MyGenStaticBitmap(wx.lib.statbmp.GenStaticBitmap):
    """ Customized GenStaticBitmap, fix transparency redraw bug on wx2.8/win32"""
          def OnPaint(self, event):
        dc = wx.PaintDC(self)
        colour = self.GetParent().GetBackgroundColour()
        dc.SetPen(wx.Pen(colour))
        dc.SetBrush(wx.Brush(colour ))
        dc.DrawRectangle(0, 0, *dc.GetSizeTuple())
        if self._bitmap:
            dc.DrawBitmap(self._bitmap, 0, 0, True)
------------------------------------

Regards,

Edouard