当前位置: 首页>>代码示例>>Python>>正文


Python DOM.getEventsSunk方法代码示例

本文整理汇总了Python中pyjamas.DOM.getEventsSunk方法的典型用法代码示例。如果您正苦于以下问题:Python DOM.getEventsSunk方法的具体用法?Python DOM.getEventsSunk怎么用?Python DOM.getEventsSunk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyjamas.DOM的用法示例。


在下文中一共展示了DOM.getEventsSunk方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: attachToElement

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getEventsSunk [as 别名]
 def attachToElement(self, element, widget):
     events = DOM.getEventsSunk(widget.getElement())
     widget.unsinkEvents(events)
     widget.setElement(element)
     widget.sinkEvents(events)
     self.adopt(widget, None)
     self.children.append(widget)
开发者ID:Afey,项目名称:pyjs,代码行数:9,代码来源:TemplatePanel.py

示例2: sinkEvents

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getEventsSunk [as 别名]
 def sinkEvents(self, eventBitsToAdd):
     """Request that the given events be delivered to the event handler for this
     element.  The event bits passed are added (using inclusive OR) to the events
     already "sunk" for the element associated with the UIObject.  The event bits
     are a combination of values from class L{Event}."""
     if self.element:
         DOM.sinkEvents(self.getElement(), eventBitsToAdd | DOM.getEventsSunk(self.getElement()))
开发者ID:andreyvit,项目名称:pyjamas,代码行数:9,代码来源:UIObject.py

示例3: __init__

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getEventsSunk [as 别名]
    def __init__(self, width=0, height=0):
        Widget.__init__(self)
        self.context = None
        
        self.setElement(DOM.createDiv())
        canvas = DOM.createElement("canvas")
        self.setWidth(width)
        self.setHeight(height)
        
        canvas.width=width
        canvas.height=height
        
        DOM.appendChild(self.getElement(), canvas)
        self.setStyleName("gwt-Canvas")
        
        self.init()
        
        self.context.fillStyle = "black"
        self.context.strokeStyle = "black"

        self.focusable = None
        self.focusable = Focus.createFocusable()
        
        self.focusListeners = []
        self.clickListeners = []
        self.mouseListeners = []
        self.keyboardListeners = []
        
        DOM.appendChild(self.getElement(), self.focusable)
        DOM.sinkEvents(canvas, Event.ONCLICK | Event.MOUSEEVENTS | DOM.getEventsSunk(canvas))
        DOM.sinkEvents(self.focusable, Event.FOCUSEVENTS | Event.KEYEVENTS)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:33,代码来源:Canvas2D.py

示例4: initElement

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getEventsSunk [as 别名]
    def initElement(self, element, **ka):
        self.inputElem = element
        self.labelElem = DOM.createLabel()
        element = ka.pop("Element", None) or DOM.createSpan()
        ButtonBase.__init__(self, element, **ka)

        self.unsinkEvents(Event.FOCUSEVENTS | Event.ONCLICK)
        DOM.sinkEvents(self.inputElem, Event.FOCUSEVENTS | Event.ONCLICK | DOM.getEventsSunk(self.inputElem))

        DOM.appendChild(self.getElement(), self.inputElem)
        DOM.appendChild(self.getElement(), self.labelElem)

        uid = "check%d" % self.getUniqueID()
        DOM.setAttribute(self.inputElem, "id", uid)
        DOM.setAttribute(self.labelElem, "htmlFor", uid)
开发者ID:anandology,项目名称:pyjamas,代码行数:17,代码来源:CheckBox.py

示例5: initElement

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getEventsSunk [as 别名]
    def initElement(self, element, **kwargs):
        self.inputElem = element
        self.labelElem = DOM.createLabel()
        if kwargs.has_key('Element'):
            element = kwargs.pop('Element')
        else:
            element = DOM.createSpan()
        ButtonBase.__init__(self, element, **kwargs)

        self.unsinkEvents(Event.FOCUSEVENTS| Event.ONCLICK)
        DOM.sinkEvents(self.inputElem, Event.FOCUSEVENTS | Event.ONCLICK | DOM.getEventsSunk(self.inputElem))

        DOM.appendChild(self.getElement(), self.inputElem)
        DOM.appendChild(self.getElement(), self.labelElem)

        uid = "check%d" % self.getUniqueID()
        DOM.setAttribute(self.inputElem, "id", uid)
        DOM.setAttribute(self.labelElem, "htmlFor", uid)
开发者ID:certik,项目名称:pyjamas,代码行数:20,代码来源:CheckBox.py

示例6: sinkEvents

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getEventsSunk [as 别名]
 def sinkEvents(self, eventBitsToAdd):
     """ Unlike other widgets the CheckBox sinks on its inputElement,
         not its wrapper
     """
     eventBitsToAdd |= DOM.getEventsSunk(self.inputElem)
     DOM.sinkEvents(self.inputElem, eventBitsToAdd)
开发者ID:Afey,项目名称:pyjs,代码行数:8,代码来源:CheckBox.py


注:本文中的pyjamas.DOM.getEventsSunk方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。