本文整理汇总了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)
示例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)
示例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)