Example #1
0
 def __init__(self, element, **kwargs):
     self.setElement(element)
     Widget.__init__(self, **kwargs)
     FocusHandler.__init__(self)
     KeyboardHandler.__init__(self)
     ClickHandler.__init__(self)
     MouseHandler.__init__(self)
    def onBrowserEvent(self, event):

        # farm out the event to convenience handlers.
        # detect existence by checking for the listener lists of each
        # type of handler.  there's probably a better way to do this...
        if hasattr(self, "_clickListeners"):
            ClickHandler.onBrowserEvent(self, event)
        if hasattr(self, "_keyboardListeners"):
            KeyboardHandler.onBrowserEvent(self, event)
        if hasattr(self, "_mouseListeners"):
            MouseHandler.onBrowserEvent(self, event)
        if hasattr(self, "_mouseWheelListeners"):
            MouseWheelHandler.onBrowserEvent(self, event)
        if hasattr(self, "_focusListeners"):
            FocusHandler.onBrowserEvent(self, event)
        if hasattr(self, "_dragListeners"):
            DragHandler.onBrowserEvent(self, event)
        if hasattr(self, "_changeListeners"):
            ChangeHandler.onBrowserEvent(self, event)
        if hasattr(self, "_inputListeners"):
            InputHandler.onBrowserEvent(self, event)
        if hasattr(self, "_dropListeners"):
            DropHandler.onBrowserEvent(self, event)

        if self.contextMenu is None:
            return True

        type = DOM.eventGetType(event)
        if type == "contextmenu":
            DOM.eventCancelBubble(event, True)
            DOM.eventPreventDefault(event)
            self.contextMenu.onContextMenu(self)
            return False

        return True
Example #3
0
 def __init__(self, element, **kwargs):
     self.setElement(element)
     Widget.__init__(self, **kwargs)
     FocusHandler.__init__(self)
     KeyboardHandler.__init__(self)
     ClickHandler.__init__(self)
     MouseHandler.__init__(self)
Example #4
0
    def onBrowserEvent(self, event):

        # farm out the event to convenience handlers.
        # detect existence by checking for the listener lists of each
        # type of handler.  there's probably a better way to do this...
        if hasattr(self, "_clickListeners"):
            ClickHandler.onBrowserEvent(self, event)
        if hasattr(self, "_keyboardListeners"):
            KeyboardHandler.onBrowserEvent(self, event)
        if hasattr(self, "_mouseListeners"):
            MouseHandler.onBrowserEvent(self, event)
        if hasattr(self, "_mouseWheelListeners"):
            MouseWheelHandler.onBrowserEvent(self, event)
        if hasattr(self, "_focusListeners"):
            FocusHandler.onBrowserEvent(self, event)
        if hasattr(self, "_dragListeners"):
            DragHandler.onBrowserEvent(self, event)
        if hasattr(self, "_dropListeners"):
            DropHandler.onBrowserEvent(self, event)

        if self.contextMenu is None:
            return True

        type = DOM.eventGetType(event)
        if type == "contextmenu":
            DOM.eventCancelBubble(event, True)
            DOM.eventPreventDefault(event)
            self.contextMenu.onContextMenu(self)
            return False

        return True
Example #5
0
    def __init__(self, Parent, *args, **kwargs):
        self.Parent = Parent
        self.focussed = False
        RootPanelCls.__init__(self, *args, **kwargs)
        ClickHandler.__init__(self)
        KeyboardHandler.__init__(self)

        self.addClickListener(self)
Example #6
0
    def __init__(self, Parent, *args, **kwargs):
        self.Parent = Parent
        self.focussed = False
        RootPanelCls.__init__(self, *args, **kwargs)
        ClickHandler.__init__(self)
        KeyboardHandler.__init__(self)

        self.addClickListener(self)
Example #7
0
 def __init__(self, Parent, *args, **kwargs):
     self.Parent = Parent
     self.focussed = False
     self.Parent.setFocus(False)
     RootPanelCls.__init__(self, *args, **kwargs)
     KeyboardHandler.__init__(self)
     
     self.addKeyboardListener(self)
Example #8
0
    def __init__(self, **kwargs):
        """ pass in Widget={the widget} so that Applier will call setWidget.  
        """

        SimplePanel.__init__(self, Focus.createFocusable(), **kwargs)
        FocusHandler.__init__(self)
        KeyboardHandler.__init__(self)
        ClickHandler.__init__(self)
        MouseHandler.__init__(self)
Example #9
0
    def __init__(self, **kwargs):
        """ pass in Widget={the widget} so that Applier will call setWidget.  
        """

        SimplePanel.__init__(self, Focus.createFocusable(), **kwargs)
        FocusHandler.__init__(self)
        KeyboardHandler.__init__(self)
        ClickHandler.__init__(self)
        MouseHandler.__init__(self)
Example #10
0
 def onBrowserEvent(self, event):
     if DOM.eventGetType(event) in DROP_EVENTS and not self.block.original:
         mb = getWorkspace().getMovingBlock()
         if not DOM.isOrHasChild(
                 mb.getElement(),
                 self.getElement()) and mb.blockType in self.accepts:
             DropHandler.onBrowserEvent(self, event)
     elif DOM.eventGetType(event) in KEYBOARD_EVENTS:
         KeyboardHandler.onBrowserEvent(self, event)
Example #11
0
 def __init__(self, title, okClick=None, cancelClick=None, options=-1, hasBackground=True):
     DialogBox.__init__(self, autoHide=False, modal=hasBackground, centered=True, StyleName='dialog')
     KeyboardHandler.__init__(self)
     self.addKeyboardListener(self)#n�o funciona fora do input
     self.title = title
     self.okClick = okClick
     self.cancelClick = cancelClick
     self.options = options
     self.hasBackground = hasBackground
     self.center = VerticalPanel(StyleName='dialog_center')
     self.draw()
 def __init__(self, *args, **kwargs):
     RootPanelCls.__init__(self, *args, **kwargs)
     ClickHandler.__init__(self)
     KeyboardHandler.__init__(self)
     MouseHandler.__init__(self)
     DOM.setStyleAttribute(doc().body, 'margin', '0px')