parameters: (self, dc, window, text, rect, pane)
docstring: Draws the text in the pane caption.
  
          :param `dc`: a :class:`DC` device context;
          :param `window`: an instance of :class:`Window`;
          :param string `text`: the text to be displayed;
          :param Rect `rect`: the pane caption rectangle;
          :param `pane`: the pane for which the text is drawn.
docstring_summary: Draws the text in the pane caption.
docstring_tokens: Draws the text in the pane caption .
function: def DrawCaption(self, dc, window, text, rect, pane):
          """
          Draws the text in the pane caption.
  
          :param `dc`: a :class:`DC` device context;
          :param `window`: an instance of :class:`Window`;
          :param string `text`: the text to be displayed;
          :param Rect `rect`: the pane caption rectangle;
          :param `pane`: the pane for which the text is drawn.
          """
  
          dc.SetPen(wx.TRANSPARENT_PEN)
          dc.SetFont(self._caption_font)
  
          self.DrawCaptionBackground(dc, rect, pane)
  
          if pane.state & optionActive:
              dc.SetTextForeground(self._active_caption_text_colour)
          else:
              dc.SetTextForeground(self._inactive_caption_text_colour)
  
          w, h = dc.GetTextExtent("ABCDEFHXfgkj")
  
          clip_rect = wx.Rect(*rect)
          btns = pane.CountButtons()
  
          captionLeft = pane.HasCaptionLeft()
          variable = (captionLeft and [rect.height] or [rect.width])[0]
  
          variable -= 3      # text offset
          variable -= 2      # button padding
  
          caption_offset = 0
          if pane.icon:
              if captionLeft:
                  caption_offset += pane.icon.GetHeight() + 3
              else:
                  caption_offset += pane.icon.GetWidth() + 3
  
              self.DrawIcon(dc, rect, pane)
  
          variable -= caption_offset
          variable -= btns*(self._button_size + self._border_size)
          draw_text = ChopText(dc, text, variable)
  
          if captionLeft:
              dc.DrawRotatedText(draw_text, rect.x+(rect.width/2)-(h/2)-1, rect.y+rect.height-3-caption_offset, 90)
          else:
              dc.DrawText(draw_text, rect.x+3+caption_offset, rect.y+(rect.height/2)-(h/2)-1)
function_tokens: def DrawCaption ( self , dc , window , text , rect , pane ) : dc . SetPen ( wx . TRANSPARENT_PEN ) dc . SetFont ( self . _caption_font ) self . DrawCaptionBackground ( dc , rect , pane ) if pane . state & optionActive : dc . SetTextForeground ( self . _active_caption_text_colour ) else : dc . SetTextForeground ( self . _inactive_caption_text_colour ) w , h = dc . GetTextExtent ( "ABCDEFHXfgkj" ) clip_rect = wx . Rect ( * rect ) btns = pane . CountButtons ( ) captionLeft = pane . HasCaptionLeft ( ) variable = ( captionLeft and [ rect . height ] or [ rect . width ] ) [ 0 ] variable -= 3 # text offset variable -= 2 # button padding caption_offset = 0 if pane . icon : if captionLeft : caption_offset += pane . icon . GetHeight ( ) + 3 else : caption_offset += pane . icon . GetWidth ( ) + 3 self . DrawIcon ( dc , rect , pane ) variable -= caption_offset variable -= btns * ( self . _button_size + self . _border_size ) draw_text = ChopText ( dc , text , variable ) if captionLeft : dc . DrawRotatedText ( draw_text , rect . x + ( rect . width / 2 ) - ( h / 2 ) - 1 , rect . y + rect . height - 3 - caption_offset , 90 ) else : dc . DrawText ( draw_text , rect . x + 3 + caption_offset , rect . y + ( rect . height / 2 ) - ( h / 2 ) - 1 )