本文整理汇总了Python中ui.VerticalPanel.setHorizontalAlignment方法的典型用法代码示例。如果您正苦于以下问题:Python VerticalPanel.setHorizontalAlignment方法的具体用法?Python VerticalPanel.setHorizontalAlignment怎么用?Python VerticalPanel.setHorizontalAlignment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ui.VerticalPanel
的用法示例。
在下文中一共展示了VerticalPanel.setHorizontalAlignment方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from ui import VerticalPanel [as 别名]
# 或者: from ui.VerticalPanel import setHorizontalAlignment [as 别名]
def __init__(self):
Composite.__init__(self)
self.signOutLink = HTML("<a href='javascript:;'>Sign Out</a>")
self.aboutLink = HTML("<a href='javascript:;'>About</a>")
outer = HorizontalPanel()
inner = VerticalPanel()
outer.setHorizontalAlignment(HasAlignment.ALIGN_RIGHT)
inner.setHorizontalAlignment(HasAlignment.ALIGN_RIGHT)
links = HorizontalPanel()
links.setSpacing(4)
links.add(self.signOutLink)
links.add(self.aboutLink)
outer.add(inner)
inner.add(HTML("<b>Welcome back, [email protected]</b>"))
inner.add(links)
self.signOutLink.addClickListener(self)
self.aboutLink.addClickListener(self)
self.initWidget(outer)
inner.setStyleName("mail-TopPanel")
links.setStyleName("mail-TopPanelLinks")
示例2: __init__
# 需要导入模块: from ui import VerticalPanel [as 别名]
# 或者: from ui.VerticalPanel import setHorizontalAlignment [as 别名]
def __init__(self):
self.curImage=0
self.image=Image()
self.loadingImage = Image(self.baseURL() + "images/blanksearching.gif")
self.nextButton = Image(self.baseURL() + "rembrandt/forward.gif")
self.prevButton = Image(self.baseURL() + "rembrandt/back.gif")
self.sImages=["rembrandt/JohannesElison.jpg", "rembrandt/LaMarcheNocturne.jpg", "rembrandt/SelfPortrait1628.jpg", "rembrandt/SelfPortrait1640.jpg", "rembrandt/TheArtistInHisStudio.jpg", "rembrandt/TheReturnOfTheProdigalSon.jpg"]
for i in range(len(self.sImages)):
self.sImages[i]=self.baseURL() + self.sImages[i]
self.image.addLoadListener(self)
self.prevButton.addClickListener(self)
self.nextButton.addClickListener(self)
topPanel = DockPanel()
topPanel.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
topPanel.add(self.prevButton, DockPanel.WEST)
topPanel.add(self.nextButton, DockPanel.EAST)
topPanel.add(self.loadingImage, DockPanel.CENTER)
panel = VerticalPanel()
panel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
panel.add(HTML("<h2>A Bit of Rembrandt</h2>", True))
panel.add(topPanel)
panel.add(self.image)
panel.setWidth("100%")
self.setWidget(panel)
self.image.setStyleName("ks-images-Image")
self.nextButton.setStyleName("ks-images-Button")
self.prevButton.setStyleName("ks-images-Button")
self.loadImage(0)
示例3: createImage
# 需要导入模块: from ui import VerticalPanel [as 别名]
# 或者: from ui.VerticalPanel import setHorizontalAlignment [as 别名]
def createImage(self, imageUrl):
image = Image(imageUrl)
image.setStyleName("ks-images-Image")
p = VerticalPanel()
p.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
p.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
p.add(image)
return p
示例4: __init__
# 需要导入模块: from ui import VerticalPanel [as 别名]
# 或者: from ui.VerticalPanel import setHorizontalAlignment [as 别名]
def __init__(self):
Sink.__init__(self)
self.sStrings = [["foo0", "bar0", "baz0", "toto0", "tintin0"],
["foo1", "bar1", "baz1", "toto1", "tintin1"],
["foo2", "bar2", "baz2", "toto2", "tintin2"],
["foo3", "bar3", "baz3", "toto3", "tintin3"],
["foo4", "bar4", "baz4", "toto4", "tintin4"]]
self.combo = ListBox()
self.list = ListBox()
self.echo = Label()
self.combo.setVisibleItemCount(1)
self.combo.addChangeListener(self)
self.list.setVisibleItemCount(10)
self.list.setMultipleSelect(True)
for i in range(len(self.sStrings)):
self.combo.addItem("List %d" % i)
self.combo.setSelectedIndex(0)
self.fillList(0)
self.list.addChangeListener(self)
horz = HorizontalPanel()
horz.setVerticalAlignment(HasAlignment.ALIGN_TOP)
horz.setSpacing(8)
horz.add(self.combo)
horz.add(self.list)
panel = VerticalPanel()
panel.setHorizontalAlignment(HasAlignment.ALIGN_LEFT)
panel.add(horz)
panel.add(self.echo)
self.initWidget(panel)
self.echoSelection()
示例5: __init__
# 需要导入模块: from ui import VerticalPanel [as 别名]
# 或者: from ui.VerticalPanel import setHorizontalAlignment [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")