本文整理匯總了Python中pyjamas.ui.Focus.focus方法的典型用法代碼示例。如果您正苦於以下問題:Python Focus.focus方法的具體用法?Python Focus.focus怎麽用?Python Focus.focus使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pyjamas.ui.Focus
的用法示例。
在下文中一共展示了Focus.focus方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: moveFocus
# 需要導入模塊: from pyjamas.ui import Focus [as 別名]
# 或者: from pyjamas.ui.Focus import focus [as 別名]
def moveFocus(self, selection):
focusableWidget = selection.getFocusableWidget()
if focusableWidget is not None:
focusableWidget.setFocus(True)
DOM.scrollIntoView(focusableWidget.getElement())
else:
selectedElem = selection.getContentElem()
containerLeft = self.getAbsoluteLeft()
containerTop = self.getAbsoluteTop()
left = DOM.getAbsoluteLeft(selectedElem) - containerLeft
top = DOM.getAbsoluteTop(selectedElem) - containerTop
width = DOM.getIntAttribute(selectedElem, "offsetWidth")
height = DOM.getIntAttribute(selectedElem, "offsetHeight")
DOM.setIntStyleAttribute(self.focusable, "left", left)
DOM.setIntStyleAttribute(self.focusable, "top", top)
DOM.setIntStyleAttribute(self.focusable, "width", width)
DOM.setIntStyleAttribute(self.focusable, "height", height)
DOM.scrollIntoView(self.focusable)
Focus.focus(self.focusable)
示例2: setFocus
# 需要導入模塊: from pyjamas.ui import Focus [as 別名]
# 或者: from pyjamas.ui.Focus import focus [as 別名]
def setFocus(self, focused):
if (focused):
Focus.focus(self.getElement())
else:
Focus.blur(self.getElement())
示例3: setFocus
# 需要導入模塊: from pyjamas.ui import Focus [as 別名]
# 或者: from pyjamas.ui.Focus import focus [as 別名]
def setFocus(self, focused):
if focused:
Focus.focus(self.inputElem)
else:
Focus.blur(self.inputElem)
示例4: setFocus
# 需要導入模塊: from pyjamas.ui import Focus [as 別名]
# 或者: from pyjamas.ui.Focus import focus [as 別名]
def setFocus(self, focus):
if focus:
Focus.focus(self.focusable)
else:
Focus.blur(self.focusable)
示例5: setFocus
# 需要導入模塊: from pyjamas.ui import Focus [as 別名]
# 或者: from pyjamas.ui.Focus import focus [as 別名]
def setFocus(self, focused):
if (focused):
Focus.focus(self.focusable)
else:
Focus.blur(self.focusable)