parameters: (self, dc, wnd, item, rect)
docstring: Draws a toolbar item button.
          
          :param `dc`: a :class:`DC` device context;
          :param `wnd`: a :class:`Window` derived window;
          :param `item`: an instance of :class:`AuiToolBarItem`;
          :param Rect `rect`: the :class:`AuiToolBarItem` rectangle.
docstring_summary: Draws a toolbar item button.
          
          :param `dc`: a :class:`DC` device context;
          :param `wnd`: a :class:`Window` derived window;
          :param `item`: an instance of :class:`AuiToolBarItem`;
          :param Rect `rect`: the :class:`AuiToolBarItem` rectangle.
docstring_tokens: Draws a toolbar item button . : param dc : a : class : DC device context ; : param wnd : a : class : Window derived window ; : param item : an instance of : class : AuiToolBarItem ; : param Rect rect : the : class : AuiToolBarItem rectangle .
function: def DrawButton(self, dc, wnd, item, rect):
          """
          Draws a toolbar item button.
          
          :param `dc`: a :class:`DC` device context;
          :param `wnd`: a :class:`Window` derived window;
          :param `item`: an instance of :class:`AuiToolBarItem`;
          :param Rect `rect`: the :class:`AuiToolBarItem` rectangle.
          """
  
          bmp_rect, text_rect = self.GetToolsPosition(dc, item, rect)
          
          if not item.GetState() & AUI_BUTTON_STATE_DISABLED:
          
              if item.GetState() & AUI_BUTTON_STATE_PRESSED:
              
                  dc.SetPen(wx.Pen(self._highlight_colour))
                  dc.SetBrush(wx.Brush(StepColour(self._highlight_colour, 150)))
                  dc.DrawRectangleRect(rect)
              
              elif item.GetState() & AUI_BUTTON_STATE_HOVER or item.IsSticky():
              
                  dc.SetPen(wx.Pen(self._highlight_colour))
                  dc.SetBrush(wx.Brush(StepColour(self._highlight_colour, 170)))
  
                  # draw an even lighter background for checked item hovers (since
                  # the hover background is the same colour as the check background)
                  if item.GetState() & AUI_BUTTON_STATE_CHECKED:
                      dc.SetBrush(wx.Brush(StepColour(self._highlight_colour, 180)))
  
                  dc.DrawRectangleRect(rect)
              
              elif item.GetState() & AUI_BUTTON_STATE_CHECKED:
              
                  # it's important to put this code in an else statment after the
                  # hover, otherwise hovers won't draw properly for checked items
                  dc.SetPen(wx.Pen(self._highlight_colour))
                  dc.SetBrush(wx.Brush(StepColour(self._highlight_colour, 170)))
                  dc.DrawRectangleRect(rect)
              
          if item.GetState() & AUI_BUTTON_STATE_DISABLED:
              bmp = item.GetDisabledBitmap()
          else:
              bmp = item.GetBitmap()
  
          if bmp.IsOk():
              dc.DrawBitmap(bmp, bmp_rect.x, bmp_rect.y, True)
  
          # set the item's text colour based on if it is disabled
          dc.SetTextForeground(wx.BLACK)
          if item.GetState() & AUI_BUTTON_STATE_DISABLED:
              dc.SetTextForeground(DISABLED_TEXT_COLOUR)
  
          if self._agwFlags & AUI_TB_TEXT and item.GetLabel() != "":
              self.DrawLabel(dc, wnd, item, text_rect)
function_tokens: def DrawButton ( self , dc , wnd , item , rect ) : bmp_rect , text_rect = self . GetToolsPosition ( dc , item , rect ) if not item . GetState ( ) & AUI_BUTTON_STATE_DISABLED : if item . GetState ( ) & AUI_BUTTON_STATE_PRESSED : dc . SetPen ( wx . Pen ( self . _highlight_colour ) ) dc . SetBrush ( wx . Brush ( StepColour ( self . _highlight_colour , 150 ) ) ) dc . DrawRectangleRect ( rect ) elif item . GetState ( ) & AUI_BUTTON_STATE_HOVER or item . IsSticky ( ) : dc . SetPen ( wx . Pen ( self . _highlight_colour ) ) dc . SetBrush ( wx . Brush ( StepColour ( self . _highlight_colour , 170 ) ) ) # draw an even lighter background for checked item hovers (since # the hover background is the same colour as the check background) if item . GetState ( ) & AUI_BUTTON_STATE_CHECKED : dc . SetBrush ( wx . Brush ( StepColour ( self . _highlight_colour , 180 ) ) ) dc . DrawRectangleRect ( rect ) elif item . GetState ( ) & AUI_BUTTON_STATE_CHECKED : # it's important to put this code in an else statment after the # hover, otherwise hovers won't draw properly for checked items dc . SetPen ( wx . Pen ( self . _highlight_colour ) ) dc . SetBrush ( wx . Brush ( StepColour ( self . _highlight_colour , 170 ) ) ) dc . DrawRectangleRect ( rect ) if item . GetState ( ) & AUI_BUTTON_STATE_DISABLED : bmp = item . GetDisabledBitmap ( ) else : bmp = item . GetBitmap ( ) if bmp . IsOk ( ) : dc . DrawBitmap ( bmp , bmp_rect . x , bmp_rect . y , True ) # set the item's text colour based on if it is disabled dc . SetTextForeground ( wx . BLACK ) if item . GetState ( ) & AUI_BUTTON_STATE_DISABLED : dc . SetTextForeground ( DISABLED_TEXT_COLOUR ) if self . _agwFlags & AUI_TB_TEXT and item . GetLabel ( ) != "" : self . DrawLabel ( dc , wnd , item , text_rect )