#NEWLINE# def init( self , parent ) : #NEWLINE# #INDENT# ' Finishes initializing the editor by creating the underlying toolkit\n            widget.\n        ' #NEWLINE# self . control = QtGui . QWidget ( ) #NEWLINE# layout = QtGui . QVBoxLayout ( self . control ) #NEWLINE# layout . setContentsMargins ( 0 , 0 , 0 , 0 ) #NEWLINE# self . _widget = control = AdvancedCodeWidget ( None , lexer = self . factory . lexer ) #NEWLINE# layout . addWidget ( control ) #NEWLINE# factory = self . factory #NEWLINE# code_editor = self . _widget . code #NEWLINE# if self . readonly : #NEWLINE# #INDENT# code_editor . setReadOnly ( True ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if factory . auto_set : #NEWLINE# #INDENT# code_editor . textChanged . connect ( self . update_object ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# code_editor . focus_lost . connect ( self . update_object ) #NEWLINE# #UNINDENT# #UNINDENT# if ( factory . selected_text != '' ) : #NEWLINE# #INDENT# code_editor . selectionChanged . connect ( self . _selection_changed ) #NEWLINE# #UNINDENT# if ( ( factory . line != '' ) or ( factory . column != '' ) ) : #NEWLINE# #INDENT# code_editor . cursorPositionChanged . connect ( self . _position_changed ) #NEWLINE# #UNINDENT# code_editor . line_number_widget . setVisible ( factory . show_line_numbers ) #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 ( layout . column , 'column' ) #NEWLINE# self . sync_value ( factory . selected_start_pos , 'selected_start_pos' , 'to' ) #NEWLINE# self . sync_value ( factory . selected_end_pos , 'selected_end_pos' , 'to' ) #NEWLINE# self . sync_value ( factory . dim_lines , 'dim_lines' , 'from' , is_list = True ) #NEWLINE# if ( self . factory . dim_color == '' ) : #NEWLINE# #INDENT# self . dim_color = '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# self . set_tooltip ( )