本文整理汇总了Python中pyjamas.DOM.releaseCapture方法的典型用法代码示例。如果您正苦于以下问题:Python DOM.releaseCapture方法的具体用法?Python DOM.releaseCapture怎么用?Python DOM.releaseCapture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.DOM
的用法示例。
在下文中一共展示了DOM.releaseCapture方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: cleanupCaptureState
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import releaseCapture [as 别名]
def cleanupCaptureState(self):
"""
Resets internal state if this button can no longer service events.
This can occur when the widget becomes detached or disabled.
"""
if self.isCapturing or self.isFocusing:
DOM.releaseCapture(self.getElement())
self.isCapturing = False
self.isFocusing = False
self.onClickCancel()
示例2: hide
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import releaseCapture [as 别名]
def hide(self, autoClosed=False):
self.showing = False
self.hideGlass()
DOM.removeEventPreview(self)
RootPanel().remove(self)
self.onHideImpl(self.getElement())
DOM.releaseCapture(self.getElement())
for listener in self.glassListeners:
if hasattr(listener, 'onGlassHide'):
listener.onGlassHide(self, autoClosed)
else:
listener(self, autoClosed)
示例3: onBrowserEvent
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import releaseCapture [as 别名]
def onBrowserEvent(self, event):
typ = DOM.eventGetType(event)
if typ == "mousedown":
target = DOM.eventGetTarget(event)
if DOM.isOrHasChild(self.splitElem, target):
self.startResizingFrom(DOM.eventGetClientX(event) -
self.getAbsoluteLeft(),
DOM.eventGetClientY(event) - self.getAbsoluteTop())
DOM.setCapture(self.getElement())
DOM.eventPreventDefault(event)
elif typ == "mouseup":
DOM.releaseCapture(self.getElement())
self.stopResizing()
elif typ == 'mousemove':
if self.isResizing:
#assert DOM.getCaptureElement() is not None
self.onSplitterResize(DOM.eventGetClientX(event) -
self.getAbsoluteLeft(),
DOM.eventGetClientY(event) - self.getAbsoluteTop())
DOM.eventPreventDefault(event)
示例4: onLostFocus
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import releaseCapture [as 别名]
def onLostFocus(self, sender):
self.removeStyleName("gwt-VerticalSlider-focussed")
self.dragging = False
DOM.releaseCapture(self.getElement())
示例5: onMouseUp
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import releaseCapture [as 别名]
def onMouseUp(self, sender, x, y):
self.dragging = False
DOM.releaseCapture(self.caption.getElement())
示例6: onBrowserEvent
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import releaseCapture [as 别名]
def onBrowserEvent(self, event):
# Should not act on button if disabled.
if not self.isEnabled():
# This can happen when events are bubbled up from
# non-disabled children
return
event_type = DOM.eventGetType(event)
if event_type == "click":
# If clicks are currently disallowed, keep it from bubbling or
# being passed to the superclass.
if not self.allowClick:
DOM.eventStopPropagation(event)
return
elif event_type == "mousedown":
if DOM.eventGetButton(event) == Event.BUTTON_LEFT:
self.setFocus(True)
self.onClickStart()
DOM.setCapture(self.getElement())
self.isCapturing = True
# Prevent dragging (on some browsers)
DOM.eventPreventDefault(event)
elif event_type == "mouseup":
if self.isCapturing:
self.isCapturing = False
DOM.releaseCapture(self.getElement())
if self.isHovering() and \
DOM.eventGetButton(event) == Event.BUTTON_LEFT:
self.onClick()
elif event_type == "mousemove":
if self.isCapturing:
# Prevent dragging (on other browsers)
DOM.eventPreventDefault(event)
elif event_type == "mouseout":
to = DOM.eventGetToElement(event)
if (DOM.isOrHasChild(self.getElement(), DOM.eventGetTarget(event))
and (to is None or not DOM.isOrHasChild(self.getElement(), to))):
if self.isCapturing:
self.onClickCancel()
self.setHovering(False)
elif event_type == "mouseover":
if DOM.isOrHasChild(self.getElement(), DOM.eventGetTarget(event)):
self.setHovering(True)
if self.isCapturing:
self.onClickStart()
elif event_type == "blur":
if self.isFocusing:
self.isFocusing = False
self.onClickCancel()
elif event_type == "losecapture":
if self.isCapturing:
self.isCapturing = False
self.onClickCancel()
ButtonBase.onBrowserEvent(self, event)
# Synthesize clicks based on keyboard events AFTER the normal
# key handling.
if (DOM.eventGetTypeInt(event) & Event.KEYEVENTS) == 0:
return
keyCode = DOM.eventGetKeyCode(event)
if event_type == "keydown":
if keyCode == ' ':
self.isFocusing = True
self.onClickStart()
elif event_type == "keyup":
if self.isFocusing and keyCode == ' ':
self.isFocusing = False
self.onClick()
elif event_type == "keypress":
if keyCode == '\n' or keyCode == '\r':
self.onClickStart()
self.onClick()
示例7: onLoseFocus
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import releaseCapture [as 别名]
def onLoseFocus(self, sender):
self.dragging = False
DOM.releaseCapture(self.getElement())
VerticalDemoSlider.onLoseFocus(self, sender)
示例8: onLoseFocus
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import releaseCapture [as 别名]
def onLoseFocus(self, sender):
self.dragging = False
DOM.releaseCapture(self.getElement())
示例9: dragEndCleanup
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import releaseCapture [as 别名]
def dragEndCleanup(self):
DOM.releaseCapture(capturingWidget.getElement())