#NEWLINE# def onEventPreview( self , event ) : #NEWLINE# #INDENT# etype = DOM . eventGetType ( event ) #NEWLINE# if ( etype == 'keydown' ) : #NEWLINE# #INDENT# return ( self . onKeyDownPreview ( DOM . eventGetKeyCode ( event ) , KeyboardListener . getKeyboardModifiers ( event ) ) and ( ( not self . modal ) or self . _event_targets_popup ( event ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( etype == 'keyup' ) : #NEWLINE# #INDENT# return ( self . onKeyUpPreview ( DOM . eventGetKeyCode ( event ) , KeyboardListener . getKeyboardModifiers ( event ) ) and ( ( not self . modal ) or self . _event_targets_popup ( event ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( etype == 'keypress' ) : #NEWLINE# #INDENT# return ( self . onKeyPressPreview ( DOM . eventGetKeyCode ( event ) , KeyboardListener . getKeyboardModifiers ( event ) ) and ( ( not self . modal ) or self . _event_targets_popup ( event ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( etype == 'mousedown' ) or ( etype == 'blur' ) ) : #NEWLINE# #INDENT# if ( DOM . getCaptureElement ( ) is not None ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# if ( self . autoHide and ( not self . _event_targets_popup ( event ) ) ) : #NEWLINE# #INDENT# self . hide ( True ) #NEWLINE# return True #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( etype == 'mouseup' ) or ( etype == 'click' ) or ( etype == 'mousemove' ) or ( type == 'dblclick' ) ) : #NEWLINE# #INDENT# if ( DOM . getCaptureElement ( ) is not None ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return ( ( not self . modal ) or self . _event_targets_popup ( event ) )