parameters: (self, dc, rect)
docstring: Gradient fill from colour 1 to colour 2 from left to right.
  
          :param `dc`: an instance of :class:`DC`;
          :param `rect`: the :class:`CaptionBar` client rectangle.
docstring_summary: Gradient fill from colour 1 to colour 2 from left to right.
docstring_tokens: Gradient fill from colour 1 to colour 2 from left to right .
function: def DrawHorizontalGradient(self, dc, rect):
          """
          Gradient fill from colour 1 to colour 2 from left to right.
  
          :param `dc`: an instance of :class:`DC`;
          :param `rect`: the :class:`CaptionBar` client rectangle.
          """
  
          if rect.height < 1 or rect.width < 1:
              return
  
          dc.SetPen(wx.TRANSPARENT_PEN)
  
          # calculate gradient coefficients
          col2 = self._style.GetSecondColour()
          col1 = self._style.GetFirstColour()
  
          r1, g1, b1 = int(col1.Red()), int(col1.Green()), int(col1.Blue())
          r2, g2, b2 = int(col2.Red()), int(col2.Green()), int(col2.Blue())
  
          flrect = float(rect.width)
  
          rstep = float((r2 - r1)) / flrect
          gstep = float((g2 - g1)) / flrect
          bstep = float((b2 - b1)) / flrect
  
          rf, gf, bf = 0, 0, 0
          
          for x in range(rect.x, rect.x + rect.width):
              currCol = (r1 + rf, g1 + gf, b1 + bf)
                  
              dc.SetBrush(wx.Brush(currCol, wx.SOLID))
              dc.DrawRectangle(rect.x + (x - rect.x), rect.y, 1, rect.height)
              rf = rf + rstep
              gf = gf + gstep
              bf = bf + bstep
function_tokens: def DrawHorizontalGradient ( self , dc , rect ) : if rect . height < 1 or rect . width < 1 : return dc . SetPen ( wx . TRANSPARENT_PEN ) # calculate gradient coefficients col2 = self . _style . GetSecondColour ( ) col1 = self . _style . GetFirstColour ( ) r1 , g1 , b1 = int ( col1 . Red ( ) ) , int ( col1 . Green ( ) ) , int ( col1 . Blue ( ) ) r2 , g2 , b2 = int ( col2 . Red ( ) ) , int ( col2 . Green ( ) ) , int ( col2 . Blue ( ) ) flrect = float ( rect . width ) rstep = float ( ( r2 - r1 ) ) / flrect gstep = float ( ( g2 - g1 ) ) / flrect bstep = float ( ( b2 - b1 ) ) / flrect rf , gf , bf = 0 , 0 , 0 for x in range ( rect . x , rect . x + rect . width ) : currCol = ( r1 + rf , g1 + gf , b1 + bf ) dc . SetBrush ( wx . Brush ( currCol , wx . SOLID ) ) dc . DrawRectangle ( rect . x + ( x - rect . x ) , rect . y , 1 , rect . height ) rf = rf + rstep gf = gf + gstep bf = bf + bstep