Ejemplo n.º 1
0
 def onEventPreview(self, event):
     type = DOM.eventGetType(event)
     if type == "keydown":
         return (self.onKeyDownPreview(
             DOM.eventGetKeyCode(event),
             KeyboardListener.getKeyboardModifiers(event))
                 and (not self.modal or self._event_targets_popup(event)))
     elif type == "keyup":
         return (self.onKeyUpPreview(
             DOM.eventGetKeyCode(event),
             KeyboardListener.getKeyboardModifiers(event))
                 and (not self.modal or self._event_targets_popup(event)))
     elif type == "keypress":
         return (self.onKeyPressPreview(
             DOM.eventGetKeyCode(event),
             KeyboardListener.getKeyboardModifiers(event))
                 and (not self.modal or self._event_targets_popup(event)))
     elif (type == "mousedown" or type == "blur"):
         if DOM.getCaptureElement() is not None:
             return True
         if self.autoHide and not self._event_targets_popup(event):
             self.hide(True)
             return True
     elif (type == "mouseup" or type == "click" or type == "mousemove"
           or type == "dblclick"):
         if DOM.getCaptureElement() is not None:
             return True
     return not self.modal or self._event_targets_popup(event)
Ejemplo n.º 2
0
    def onBrowserEvent(self, event) :
        type = DOM.eventGetType(event)
        if type == "click":
            self.onClick(self)

        elif type == "keydown":
            modifiers = KeyboardListener.getKeyboardModifiers(event)
            if hasattr(self.keyDelegate, "onKeyDown"):
                self.keyDelegate.onKeyDown(self, DOM.eventGetKeyCode(event),
                                       modifiers)
Ejemplo n.º 3
0
    def onBrowserEvent(self, event) :
        type = DOM.eventGetType(event)
        if type == "click":
            self.onClick(self)

        elif type == "keydown":
            modifiers = KeyboardListener.getKeyboardModifiers(event)
            if hasattr(self.keyDelegate, "onKeyDown"):
                self.keyDelegate.onKeyDown(self, DOM.eventGetKeyCode(event),
                                       modifiers)
Ejemplo n.º 4
0
 def onEventPreview(self, event):
     type = DOM.eventGetType(event)
     if type == "keydown":
         return (    self.onKeyDownPreview(
                         DOM.eventGetKeyCode(event),
                         KeyboardListener.getKeyboardModifiers(event)
                         )
                 and (not self.modal or self._event_targets_popup(event))
                )
     elif type == "keyup":
         return (    self.onKeyUpPreview(
                         DOM.eventGetKeyCode(event),
                         KeyboardListener.getKeyboardModifiers(event)
                         )
                 and (not self.modal or self._event_targets_popup(event))
                )
     elif type == "keypress":
         return (    self.onKeyPressPreview(
                         DOM.eventGetKeyCode(event),
                         KeyboardListener.getKeyboardModifiers(event)
                         )
                 and (not self.modal or self._event_targets_popup(event))
                )
     elif (   type == "mousedown"
           or type == "blur"
          ):
         if DOM.getCaptureElement() is not None:
             return True
         if self.autoHide and not self._event_targets_popup(event):
             self.hide(True)
             return True
     elif (   type == "mouseup"
           or type == "click"
           or type == "mousemove"
           or type == "dblclick"
          ):
         if DOM.getCaptureElement() is not None:
             return True
     return not self.modal or self._event_targets_popup(event)