本文整理汇总了Python中DOM.setStyleAttribute方法的典型用法代码示例。如果您正苦于以下问题:Python DOM.setStyleAttribute方法的具体用法?Python DOM.setStyleAttribute怎么用?Python DOM.setStyleAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOM
的用法示例。
在下文中一共展示了DOM.setStyleAttribute方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: preventBoxStyles
# 需要导入模块: import DOM [as 别名]
# 或者: from DOM import setStyleAttribute [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
示例2: __init__
# 需要导入模块: import DOM [as 别名]
# 或者: from DOM import setStyleAttribute [as 别名]
def __init__(self, panel):
self.panel = panel
DOM.setStyleAttribute(panel.getElement(), "position", "relative")
topElem = panel.getWidgetElement(TOP)
bottomElem = panel.getWidgetElement(BOTTOM)
self.expandToFitParentHorizontally(topElem)
self.expandToFitParentHorizontally(bottomElem)
self.expandToFitParentHorizontally(panel.getSplitElement())
self.panel.expandToFitParentUsingCssOffsets(panel.container)
# Snap the bottom wrapper to the bottom side.
DOM.setStyleAttribute(bottomElem, "bottom", "0")
示例3: __init__
# 需要导入模块: import DOM [as 别名]
# 或者: from DOM import setStyleAttribute [as 别名]
def __init__(self):
ComplexPanel.__init__(self)
self.setElement(DOM.createDiv())
DOM.setStyleAttribute(self.getElement(), "overflow", "hidden")
示例4: addScrolling
# 需要导入模块: import DOM [as 别名]
# 或者: from DOM import setStyleAttribute [as 别名]
def addScrolling(self, elem):
""" Adds as-needed scrolling to an element.
"""
DOM.setStyleAttribute(elem, "overflow", "auto")
示例5: addClipping
# 需要导入模块: import DOM [as 别名]
# 或者: from DOM import setStyleAttribute [as 别名]
def addClipping(self, elem):
""" Adds clipping to an element.
"""
DOM.setStyleAttribute(elem, "overflow", "hidden")
示例6: addAbsolutePositoning
# 需要导入模块: import DOM [as 别名]
# 或者: from DOM import setStyleAttribute [as 别名]
def addAbsolutePositoning(self, elem):
""" Sets an elements positioning to absolute.
"""
DOM.setStyleAttribute(elem, "position", "absolute")
示例7: setElemWidth
# 需要导入模块: import DOM [as 别名]
# 或者: from DOM import setStyleAttribute [as 别名]
def setElemWidth(self, elem, width):
""" Convenience method to set the width of an element.
"""
DOM.setStyleAttribute(elem, "width", width)
示例8: setTop
# 需要导入模块: import DOM [as 别名]
# 或者: from DOM import setStyleAttribute [as 别名]
def setTop(self, elem, top):
""" Convenience method to set the top offset of an element.
"""
DOM.setStyleAttribute(elem, "top", top)
示例9: setRight
# 需要导入模块: import DOM [as 别名]
# 或者: from DOM import setStyleAttribute [as 别名]
def setRight(self, elem, right):
""" Convenience method to set the right offset of an element.
"""
DOM.setStyleAttribute(elem, "right", right)
示例10: setLeft
# 需要导入模块: import DOM [as 别名]
# 或者: from DOM import setStyleAttribute [as 别名]
def setLeft(self, elem, left):
""" Convenience method to set the left offset of an element.
"""
DOM.setStyleAttribute(elem, "left", left)
示例11: setElemHeight
# 需要导入模块: import DOM [as 别名]
# 或者: from DOM import setStyleAttribute [as 别名]
def setElemHeight(self, elem, height):
""" Convenience method to set the height of an element.
"""
DOM.setStyleAttribute(elem, "height", height)
示例12: setBottom
# 需要导入模块: import DOM [as 别名]
# 或者: from DOM import setStyleAttribute [as 别名]
def setBottom(self, elem, size):
""" Convenience method to set bottom offset of an element.
"""
DOM.setStyleAttribute(elem, "bottom", size)
示例13: expandToFitParentHorizontally
# 需要导入模块: import DOM [as 别名]
# 或者: from DOM import setStyleAttribute [as 别名]
def expandToFitParentHorizontally(self, elem):
self.panel.addAbsolutePositoning(elem)
DOM.setStyleAttribute(elem, "left", "0")
DOM.setStyleAttribute(elem, "right", "0")
示例14: __init__
# 需要导入模块: import DOM [as 别名]
# 或者: from DOM import setStyleAttribute [as 别名]
def __init__(self):
text="This is a <code>ScrollPanel</code> contained at "
text+= "the center of a <code>DockPanel</code>. "
text+= "By putting some fairly large contents "
text+= "in the middle and setting its size explicitly, it becomes a "
text+= "scrollable area within the page, but without requiring the use of "
text+= "an IFRAME."
text+= "Here's quite a bit more meaningless text that will serve primarily "
text+= "to make this thing scroll off the bottom of its visible area. "
text+= "Otherwise, you might have to make it really, really small in order "
text+= "to see the nifty scroll bars!"
contents = HTML(text)
scroller = ScrollPanel(contents)
scroller.setStyleName("ks-layouts-Scroller")
dock = DockPanel()
dock.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
north0 = HTML("This is the <i>first</i> north component", True)
east = HTML("<center>This<br>is<br>the<br>east<br>component</center>", True)
south = HTML("This is the south component")
west = HTML("<center>This<br>is<br>the<br>west<br>component</center>", True)
north1 = HTML("This is the <b>second</b> north component", True)
dock.add(north0, DockPanel.NORTH)
dock.add(east, DockPanel.EAST)
dock.add(south, DockPanel.SOUTH)
dock.add(west, DockPanel.WEST)
dock.add(north1, DockPanel.NORTH)
dock.add(scroller, DockPanel.CENTER)
Logger.write("Layouts", "TODO: flowpanel")
flow = FlowPanel()
for i in range(8):
flow.add(CheckBox("Flow " + i))
horz = HorizontalPanel()
horz.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
horz.add(Button("Button"))
horz.add(HTML("<center>This is a<br>very<br>tall thing</center>", True))
horz.add(Button("Button"))
vert = VerticalPanel()
vert.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
vert.add(Button("Small"))
vert.add(Button("--- BigBigBigBig ---"))
vert.add(Button("tiny"))
menu = MenuBar()
menu0 = MenuBar(True)
menu1 = MenuBar(True)
menu.addItem("menu0", menu0)
menu.addItem("menu1", menu1)
menu0.addItem("child00")
menu0.addItem("child01")
menu0.addItem("child02")
menu1.addItem("child10")
menu1.addItem("child11")
menu1.addItem("child12")
Logger.write("Layouts", "TODO: htmlpanel")
id = HTMLPanel.createUniqueId()
text="This is an <code>HTMLPanel</code>. It allows you to add "
text+="components inside existing HTML, like this:" + "<span id='" + id
text+="'></span>" + "Notice how the menu just fits snugly in there? Cute."
html = HTMLPanel(text)
DOM.setStyleAttribute(menu.getElement(), "display", "inline")
html.add(menu, id)
panel = VerticalPanel()
panel.setSpacing(8)
panel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
panel.add(self.makeLabel("Dock Panel"))
panel.add(dock)
panel.add(self.makeLabel("Flow Panel"))
panel.add(flow)
panel.add(self.makeLabel("Horizontal Panel"))
panel.add(horz)
panel.add(self.makeLabel("Vertical Panel"))
panel.add(vert)
panel.add(self.makeLabel("HTML Panel"))
panel.add(html)
self.initWidget(panel)
self.setStyleName("ks-layouts")