#NEWLINE# def themed_checkbox_editor( style = None , show_checkbox = True , **traits ) : #NEWLINE# #INDENT# ' Simplifies creation of a ThemedCheckboxEditor by setting up the\n        themes and images automatically based on the value of the *style* and\n        *show_checkbox* arguments.\n    ' #NEWLINE# tce = ThemedCheckboxEditor ( ** traits ) #NEWLINE# if ( not show_checkbox ) : #NEWLINE# #INDENT# tce . set ( image = None , on_image = None , hover_off_image = None , hover_on_image = None ) #NEWLINE# #UNINDENT# if isinstance ( style , basestring ) : #NEWLINE# #INDENT# group = style [ 0 : 1 ] . upper ( ) #NEWLINE# if ( ( len ( group ) == 0 ) or ( group not in 'BCGJTY' ) ) : #NEWLINE# #INDENT# group = 'B' #NEWLINE# #UNINDENT# row = style [ 1 : 2 ] . upper ( ) #NEWLINE# all_rows = '0123456789ABCDEFGHIJKL' #NEWLINE# if ( ( len ( row ) == 0 ) or ( row not in all_rows ) ) : #NEWLINE# #INDENT# row = 'H' #NEWLINE# #UNINDENT# column = style [ 2 : 3 ] . upper ( ) #NEWLINE# all_columns = '12345789AB' #NEWLINE# if ( ( len ( column ) == 0 ) or ( column not in all_columns ) ) : #NEWLINE# #INDENT# column = '5' #NEWLINE# #UNINDENT# tce . theme = ( '@%s%s%s' % ( group , row , column ) ) #NEWLINE# if ( style [ ( - 1 ) : ] == '.' ) : #NEWLINE# #INDENT# return tce #NEWLINE# #UNINDENT# alt_row = '44456349A78FFFGHEFKLIJ' [ all_rows . index ( row ) ] #NEWLINE# alt_column = '66666CCCCC' [ all_columns . index ( column ) ] #NEWLINE# tce . set ( on_theme = ( '@%s%s%s' % ( group , alt_row , column ) ) , hover_on_theme = ( '@%s%s%s' % ( group , alt_row , alt_column ) ) , hover_off_theme = ( '@%s%s%s' % ( group , row , alt_column ) ) ) #NEWLINE# #UNINDENT# return tce