def OnPaint(self, event):
        """
        Handles the ``wx.EVT_PAINT`` event for L{RoundButton}.

        :param `event`: a `wx.PaintEvent` event to be processed.
        """

        dc = wx.BufferedPaintDC(self)
        
        am = AM.ArtManager()
        
        gc = wx.GraphicsContext.Create(dc)
        dc.SetBackground(wx.Brush(self.GetParent().GetBackgroundColour()))
        dc.Clear()
        
        clientRect = self.GetClientRect()
        boundaryRect = clientRect

        x, y, width, height = clientRect
        colour = self.GetForegroundColour()
        textColour = am.DarkColour(wx.WHITE, 3.0) if am.IsDark(colour) else am.LightColour(wx.BLACK, 3.0)
                    
        pressed = False
        if wx.Window.GetCapture() != self:
            if self._mouseAction == HOVER:
                colour = am.LightColour(colour, 10.0)
        else:
            colour = am.DarkColour(colour, 10.0)
            textColour = am.DarkColour(textColour, 10.0)
            pressed = True

        r = min(boundaryRect.GetWidth(), boundaryRect.GetHeight()) // 2
        xCenter = x + width // 2
        yCenter = y + height // 2
        
        gc.SetPen( wx.TRANSPARENT_PEN )
        
        def drawCircle( x, y, r ):
            gc.DrawEllipse( x - r, y - r, r * 2, r * 2 )
        
        # Draw the metal ring
        gc.SetBrush( gc.CreateRadialGradientBrush(
                        xCenter, yCenter - r,
                        xCenter, yCenter - r,
                        r * 2,
                        wx.WHITE, wx.Colour(33,33,33) ) )
        drawCircle( xCenter, yCenter, r )
        
        rSmaller = r * 0.80
        gc.SetBrush( gc.CreateRadialGradientBrush(
                        xCenter, yCenter + rSmaller,
                        xCenter, yCenter + rSmaller,
                        rSmaller * 2,
                        wx.WHITE, wx.Colour(33,33,33) ) )
        drawCircle( xCenter, yCenter, rSmaller )
        
        # Draw the body of the button.
        rSmaller *= 0.93
        if pressed:
            shrink = 0.025
            yCenter -= r * shrink / 2.0
            
        dc.SetFont( self.GetFont() )
        cRegular = colour
        gc.SetBrush( gc.CreateRadialGradientBrush(
                        xCenter, yCenter + rSmaller * 0.9,
                        xCenter, yCenter + rSmaller,
                        rSmaller * 2,
                        am.LightColour(colour, 75.0), cRegular ) )
        drawCircle( xCenter, yCenter, rSmaller )
        self._buttonRadius = rSmaller
        
        # Draw the flare at the top of the button (a shaded ellipse with a linear gradient).
        gc.SetBrush( gc.CreateLinearGradientBrush(
                        xCenter - rSmaller, yCenter - rSmaller,
                        xCenter - rSmaller, yCenter,
                        am.LightColour(colour, 40.0), am.LightColour(colour, 30.0)) )
                        
        # Magic constants to get things to look right.
        rWidth = rSmaller * (2.0 * 0.7 * 0.9)
        rHeight = rSmaller * (0.8 * 0.9)
        gc.DrawEllipse( xCenter - rWidth / 2, yCenter - rSmaller, rWidth, rHeight )
        
        # Draw an outline around the button body.
        # Also covers up the gap between the flare and the top edge of the button.
        gc.SetPen( wx.Pen(wx.Colour(50,50,50), r * 0.025) )
        gc.SetBrush( wx.TRANSPARENT_BRUSH )
        gc.DrawEllipse( xCenter - rSmaller, yCenter - rSmaller, rSmaller * 2, rSmaller * 2 )
        
        dc.SetTextForeground( textColour )

        label = self.GetLabel().strip()
        if not label:
            return
        lines = label.split('\n') 
        textWidth, textHeight = dc.GetTextExtent( label[0] )
        
        yText = yCenter - textHeight * len(lines) / 2.0
        for line in lines:
            dc.DrawText( line, xCenter - dc.GetTextExtent(line)[0] // 2, yText )
            yText += textHeight

        Handles the ``wx.EVT_PAINT`` event for L{RoundButton}.

        :param `event`: a `wx.PaintEvent` event to be processed.
        
recipes/Python/577951_wxPythDramatic_shaded_3D_buttons_that_look_like_/recipe-577951.py