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


Python Focus.focus方法代码示例

本文整理汇总了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)
开发者ID:anandology,项目名称:pyjamas,代码行数:24,代码来源:Tree.py

示例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())
开发者ID:Afey,项目名称:pyjs,代码行数:7,代码来源:RichTextAreaImpl.py

示例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)
开发者ID:certik,项目名称:pyjamas,代码行数:7,代码来源:CheckBox.py

示例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)
开发者ID:anandology,项目名称:pyjamas,代码行数:7,代码来源:Tree.py

示例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)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:7,代码来源:Canvas2D.py


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