#NEWLINE# def init( self , parent ) : #NEWLINE# #INDENT# ' Finishes initializing the editor by creating the underlying toolkit\n            widget.\n        ' #NEWLINE# factory = self . factory #NEWLINE# self . _editor = editor = PythonEditor ( parent , show_line_numbers = factory . show_line_numbers ) #NEWLINE# self . control = control = editor . control #NEWLINE# control . SetSize ( wx . Size ( 300 , 124 ) ) #NEWLINE# control . CmdKeyClear ( ord ( 'B' ) , stc . STC_SCMOD_CTRL ) #NEWLINE# control . CmdKeyClear ( ord ( 'N' ) , stc . STC_SCMOD_CTRL ) #NEWLINE# wx . EVT_KILL_FOCUS ( control , self . wx_update_object ) #NEWLINE# stc . EVT_STC_CALLTIP_CLICK ( control , control . GetId ( ) , self . _calltip_clicked ) #NEWLINE# if ( factory . auto_scroll and ( factory . selected_line != '' ) ) : #NEWLINE# #INDENT# wx . EVT_SIZE ( control , self . _update_selected_line ) #NEWLINE# #UNINDENT# if factory . auto_set : #NEWLINE# #INDENT# editor . on_trait_change ( self . update_object , 'changed' , dispatch = 'ui' ) #NEWLINE# #UNINDENT# if ( factory . key_bindings is not None ) : #NEWLINE# #INDENT# editor . on_trait_change ( self . key_pressed , 'key_pressed' , dispatch = 'ui' ) #NEWLINE# #UNINDENT# if self . readonly : #NEWLINE# #INDENT# control . SetReadOnly ( True ) #NEWLINE# #UNINDENT# control . SetLexer ( stc . STC_LEX_CONTAINER ) #NEWLINE# control . Bind ( stc . EVT_STC_STYLENEEDED , self . _style_needed ) #NEWLINE# try : #NEWLINE# #INDENT# self . lexer = getattr ( stc , ( 'STC_LEX_' + self . factory . lexer . upper ( ) ) ) #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# self . lexer = stc . STC_LEX_NULL #NEWLINE# #UNINDENT# control . MarkerDefine ( MARK_MARKER , stc . STC_MARK_BACKGROUND , background = factory . mark_color_ ) #NEWLINE# control . MarkerDefine ( SEARCH_MARKER , stc . STC_MARK_BACKGROUND , background = factory . search_color_ ) #NEWLINE# control . MarkerDefine ( SELECTED_MARKER , stc . STC_MARK_BACKGROUND , background = factory . selected_color_ ) #NEWLINE# self . update_editor ( ) #NEWLINE# self . sync_value ( factory . mark_lines , 'mark_lines' , 'from' , is_list = True ) #NEWLINE# self . sync_value ( factory . selected_line , 'selected_line' , 'from' ) #NEWLINE# self . sync_value ( factory . selected_text , 'selected_text' , 'to' ) #NEWLINE# self . sync_value ( factory . line , 'line' ) #NEWLINE# self . sync_value ( factory . column , 'column' ) #NEWLINE# self . sync_value ( factory . calltip_clicked , 'calltip_clicked' ) #NEWLINE# self . sync_value ( factory . dim_lines , 'dim_lines' , 'from' , is_list = True ) #NEWLINE# if ( self . factory . dim_color == '' ) : #NEWLINE# #INDENT# self . dim_color = 'dark grey' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . sync_value ( factory . dim_color , 'dim_color' , 'from' ) #NEWLINE# #UNINDENT# self . sync_value ( factory . squiggle_lines , 'squiggle_lines' , 'from' , is_list = True ) #NEWLINE# if ( factory . squiggle_color == '' ) : #NEWLINE# #INDENT# self . squiggle_color = 'red' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . sync_value ( factory . squiggle_color , 'squiggle_color' , 'from' ) #NEWLINE# #UNINDENT# if ( ( factory . line != '' ) or ( factory . column != '' ) or ( factory . selected_text != '' ) ) : #NEWLINE# #INDENT# stc . EVT_STC_UPDATEUI ( control , control . GetId ( ) , self . _position_changed ) #NEWLINE# #UNINDENT# self . set_tooltip ( )