當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。