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


Python PopupPanel.onEventPreview方法代码示例

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


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

示例1: onEventPreview

# 需要导入模块: from pyjamas.ui.PopupPanel import PopupPanel [as 别名]
# 或者: from pyjamas.ui.PopupPanel.PopupPanel import onEventPreview [as 别名]
 def onEventPreview(self, event):
     type = DOM.eventGetType(event)
     if type == "click":
         target = DOM.eventGetTarget(event)
         parentMenuElement = self.item.getParentMenu().getElement()
         if DOM.isOrHasChild(parentMenuElement, target):
             return False
     return PopupPanel.onEventPreview(self, event)
开发者ID:Afey,项目名称:pyjs,代码行数:10,代码来源:MenuBarPopupPanel.py

示例2: onEventPreview

# 需要导入模块: from pyjamas.ui.PopupPanel import PopupPanel [as 别名]
# 或者: from pyjamas.ui.PopupPanel.PopupPanel import onEventPreview [as 别名]
 def onEventPreview(self, event):
     # preventDefault on mousedown events, outside of the
     # dialog, to stop text-selection on dragging
     type = DOM.eventGetType(event)
     if type == "mousedown":
         target = DOM.eventGetTarget(event)
         elem = self.caption.getElement()
         event_targets_popup = target and DOM.isOrHasChild(elem, target)
         if event_targets_popup:
             DOM.eventPreventDefault(event)
     return PopupPanel.onEventPreview(self, event)
开发者ID:nielsonsantana,项目名称:emath,代码行数:13,代码来源:PopupPagina.py

示例3: onEventPreview

# 需要导入模块: from pyjamas.ui.PopupPanel import PopupPanel [as 别名]
# 或者: from pyjamas.ui.PopupPanel.PopupPanel import onEventPreview [as 别名]
    def onEventPreview(self, event):
        type = DOM.eventGetType(event)
        if type == "click":
            target = DOM.eventGetTarget(event)
            parentMenuElement = self.item.getElement()
            if DOM.isOrHasChild(parentMenuElement, target):
                if self.item.onBrowserEvent(event):
                    self.hide()
                return True

        return PopupPanel.onEventPreview(self, event)
开发者ID:Afey,项目名称:pyjs,代码行数:13,代码来源:ContextMenuPopupPanel.py


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