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


Python DOM.setIntStyleAttribute方法代码示例

本文整理汇总了Python中pyjamas.DOM.setIntStyleAttribute方法的典型用法代码示例。如果您正苦于以下问题:Python DOM.setIntStyleAttribute方法的具体用法?Python DOM.setIntStyleAttribute怎么用?Python DOM.setIntStyleAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyjamas.DOM的用法示例。


在下文中一共展示了DOM.setIntStyleAttribute方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setIntStyleAttribute [as 别名]
    def __init__(self, **ka):
        ka['StyleName'] = ka.get('StyleName', "gwt-Tree")

        self.root = None
        self.childWidgets = Set()
        self.curSelection = None
        self.focusable = None
        self.focusListeners = []
        self.mouseListeners = []
        self.imageBase = pygwt.getModuleBaseURL()
        self.keyboardListeners = []
        self.listeners = []
        self.lastEventType = ""

        element = ka.pop('Element', None) or DOM.createDiv()
        self.setElement(element)
        DOM.setStyleAttribute(self.getElement(), "position", "relative")
        self.focusable = Focus.createFocusable()
        # Hide focus outline in Mozilla/Webkit/Opera
        DOM.setStyleAttribute(self.focusable, "outline", "0px")
        # Hide focus outline in IE 6/7
        DOM.setElemAttribute(self.focusable, "hideFocus", "true");

        DOM.setStyleAttribute(self.focusable, "fontSize", "0")
        DOM.setStyleAttribute(self.focusable, "position", "absolute")
        DOM.setIntStyleAttribute(self.focusable, "zIndex", -1)
        DOM.appendChild(self.getElement(), self.focusable)

        self.root = RootTreeItem()
        self.root.setTree(self)

        Widget.__init__(self, **ka)

        self.sinkEvents(Event.ONMOUSEDOWN | Event.ONCLICK | Event.KEYEVENTS)
        DOM.sinkEvents(self.focusable, Event.FOCUSEVENTS)
开发者ID:anandology,项目名称:pyjamas,代码行数:37,代码来源:Tree.py

示例2: preventBoxStyles

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setIntStyleAttribute [as 别名]
 def preventBoxStyles(self, elem):
     """ Adds zero or none CSS values for padding, margin and
         border to prevent stylesheet overrides. Returns the
         element for convenience to support builder pattern.
     """
     DOM.setIntStyleAttribute(elem, "padding", 0)
     DOM.setIntStyleAttribute(elem, "margin", 0)
     DOM.setStyleAttribute(elem, "border", "none")
     return elem
开发者ID:certik,项目名称:pyjamas,代码行数:11,代码来源:splitpanel.py

示例3: insertItem

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setIntStyleAttribute [as 别名]
    def insertItem(self, item, index=None):
        if (item.getParentItem() is not None) or (item.getTree() is not None):
            item.remove()
        item.setTree(self.getTree())

        item.setParentItem(None)
        if index is None:
            self.children.append(item)
        else:
            self.children.insert(index, item)

        DOM.setIntStyleAttribute(item.getElement(), "marginLeft", 0)
开发者ID:anthonyrisinger,项目名称:translate-pyjs-org.appspot.com,代码行数:14,代码来源:TreeItem.py

示例4: moveFocus

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setIntStyleAttribute [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

示例5: __init__

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setIntStyleAttribute [as 别名]
    def __init__(self, target = None, **kwargs):
        global FormPanel_formId

        if hasattr(target, "getName"):
            target = target.getName()

        if kwargs.has_key('Element'):
            element = kwargs.pop('Element')
        else:
            element = DOM.createForm()

        self.formHandlers = []
        self.iframe = None
        self.__formAction = None

        FormPanel_formId += 1
        formName = "FormPanel_" + str(FormPanel_formId)
        DOM.setAttribute(element, "target", formName)
        DOM.setInnerHTML(element, """<iframe name='%s' src="javascript:''">"""\
                                  % formName)
        self.iframe = DOM.getFirstChild(element)

        DOM.setIntStyleAttribute(self.iframe, "width", 0)
        DOM.setIntStyleAttribute(self.iframe, "height", 0)
        DOM.setIntStyleAttribute(self.iframe, "border", 0)

        if target is not None:
            kwargs['Target'] = target

        SimplePanel.__init__(self, element, **kwargs)

        try:
            self.sinkEvents(Event.ONLOAD)
        except:
            # MSHTML doesn't have form.onload,
            # it has onreadystatechange.
            pass
开发者ID:Afey,项目名称:pyjs,代码行数:39,代码来源:FormPanel.py

示例6: setFontSize

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setIntStyleAttribute [as 别名]
def setFontSize(uio, fontSize):
    DOM.setIntStyleAttribute( uio.getElement(), "fontSize", fontSize)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:4,代码来源:GChartUtil.py


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