#NEWLINE# def DrawPaneButton( self , dc , window , button , button_state , _rect , pane ) : #NEWLINE# #INDENT# '\n        Draws a pane button in the pane caption area.\n\n        :param `dc`: a :class:`DC` device context;\n        :param `window`: an instance of :class:`Window`;\n        :param integer `button`: the button to be drawn;\n        :param integer `button_state`: the pane button state;\n        :param Rect `_rect`: the pane caption rectangle;\n        :param `pane`: the pane for which the button is drawn.\n        ' #NEWLINE# if ( not old_x ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( button == AUI_BUTTON_CLOSE ) : #NEWLINE# #INDENT# if ( pane . state & optionActive ) : #NEWLINE# #INDENT# bmp = self . _active_close_bitmap #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# bmp = self . _inactive_close_bitmap #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( button == AUI_BUTTON_PIN ) : #NEWLINE# #INDENT# if ( pane . state & optionActive ) : #NEWLINE# #INDENT# bmp = self . _active_pin_bitmap #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# bmp = self . _inactive_pin_bitmap #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( button == AUI_BUTTON_MAXIMIZE_RESTORE ) : #NEWLINE# #INDENT# if pane . IsMaximized ( ) : #NEWLINE# #INDENT# if ( pane . state & optionActive ) : #NEWLINE# #INDENT# bmp = self . _active_restore_bitmap #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# bmp = self . _inactive_restore_bitmap #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( pane . state & optionActive ) : #NEWLINE# #INDENT# bmp = self . _active_maximize_bitmap #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# bmp = self . _inactive_maximize_bitmap #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( button == AUI_BUTTON_MINIMIZE ) : #NEWLINE# #INDENT# if ( pane . state & optionActive ) : #NEWLINE# #INDENT# bmp = self . _active_minimize_bitmap #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# bmp = self . _inactive_minimize_bitmap #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# isVertical = pane . HasCaptionLeft ( ) #NEWLINE# rect = wx . Rect ( * _rect ) #NEWLINE# if isVertical : #NEWLINE# #INDENT# old_x = rect . x #NEWLINE# rect . x = ( ( rect . x + ( rect . width / 2 ) ) - ( bmp . GetWidth ( ) / 2 ) ) #NEWLINE# rect . width = ( ( ( old_x + rect . width ) - rect . x ) - 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# old_y = rect . y #NEWLINE# rect . y = ( ( rect . y + ( rect . height / 2 ) ) - ( bmp . GetHeight ( ) / 2 ) ) #NEWLINE# rect . height = ( ( ( old_y + rect . height ) - rect . y ) - 1 ) #NEWLINE# #UNINDENT# if ( button_state == AUI_BUTTON_STATE_PRESSED ) : #NEWLINE# #INDENT# rect . x += 1 #NEWLINE# rect . y += 1 #NEWLINE# #UNINDENT# if ( button_state in [ AUI_BUTTON_STATE_HOVER , AUI_BUTTON_STATE_PRESSED ] ) : #NEWLINE# #INDENT# if ( pane . state & optionActive ) : #NEWLINE# #INDENT# dc . SetBrush ( wx . Brush ( StepColour ( self . _active_caption_colour , 120 ) ) ) #NEWLINE# dc . SetPen ( wx . Pen ( StepColour ( self . _active_caption_colour , 70 ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# dc . SetBrush ( wx . Brush ( StepColour ( self . _inactive_caption_colour , 120 ) ) ) #NEWLINE# dc . SetPen ( wx . Pen ( StepColour ( self . _inactive_caption_colour , 70 ) ) ) #NEWLINE# #UNINDENT# if ( wx . Platform != '__WXMAC__' ) : #NEWLINE# #INDENT# dc . DrawRectangle ( rect . x , rect . y , 15 , 15 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# bmp = DarkenBitmap ( bmp , self . _active_caption_colour , StepColour ( self . _active_caption_colour , 110 ) ) #NEWLINE# #UNINDENT# #UNINDENT# if isVertical : #NEWLINE# #INDENT# bmp = wx . ImageFromBitmap ( bmp ) . Rotate90 ( clockwise = False ) . ConvertToBitmap ( ) #NEWLINE# #UNINDENT# dc . DrawBitmap ( bmp , rect . x , rect . y , True )