#NEWLINE# def _on_paint( self , event = None ) : #NEWLINE# #INDENT# ' Handles the control being re-painted.\n        ' #NEWLINE# wdc = wx . PaintDC ( self ) #NEWLINE# ( wdx , wdy ) = self . GetClientSizeTuple ( ) #NEWLINE# bitmap = self . _bitmap #NEWLINE# bdx = bitmap . GetWidth ( ) #NEWLINE# bdy = bitmap . GetHeight ( ) #NEWLINE# wdc . DrawBitmap ( wdy , ( ( wdx - bdx ) / 2 ) , ( ( wdy - bdy ) / 2 ) , True ) #NEWLINE# pens = [ self . _selectedPenLight , self . _selectedPenDark ] #NEWLINE# bd = self . _button_down #NEWLINE# if self . _mouse_over : #NEWLINE# #INDENT# wdc . SetBrush ( wx . TRANSPARENT_BRUSH ) #NEWLINE# wdc . SetPen ( pens [ bd ] ) #NEWLINE# wdc . DrawLine ( 0 , 0 , wdx , 0 ) #NEWLINE# wdc . DrawLine ( 0 , 1 , 0 , wdy ) #NEWLINE# wdc . SetPen ( pens [ ( 1 - bd ) ] ) #NEWLINE# wdc . DrawLine ( ( wdx - 1 ) , 1 , ( wdx - 1 ) , wdy ) #NEWLINE# wdc . DrawLine ( 1 , ( wdy - 1 ) , ( wdx - 1 ) , ( wdy - 1 ) ) #NEWLINE# #UNINDENT# if ( self . _selected is True ) : #NEWLINE# #INDENT# wdc . SetBrush ( wx . TRANSPARENT_BRUSH ) #NEWLINE# wdc . SetPen ( pens [ bd ] ) #NEWLINE# wdc . DrawLine ( 1 , 1 , ( wdx - 1 ) , 1 ) #NEWLINE# wdc . DrawLine ( 1 , 1 , 1 , ( wdy - 1 ) ) #NEWLINE# wdc . DrawLine ( 2 , 2 , ( wdx - 2 ) , 2 ) #NEWLINE# wdc . DrawLine ( 2 , 2 , 2 , ( wdy - 2 ) ) #NEWLINE# wdc . SetPen ( pens [ ( 1 - bd ) ] ) #NEWLINE# wdc . DrawLine ( ( wdx - 2 ) , 2 , ( wdx - 2 ) , ( wdy - 1 ) ) #NEWLINE# wdc . DrawLine ( 2 , ( wdy - 2 ) , ( wdx - 2 ) , ( wdy - 2 ) ) #NEWLINE# wdc . DrawLine ( ( wdx - 3 ) , 3 , ( wdx - 3 ) , ( wdy - 2 ) ) #NEWLINE# wdc . DrawLine ( 3 , ( wdy - 3 ) , ( wdx - 3 ) , ( wdy - 3 ) )