本文整理汇总了Python中pyjamas.ui.VerticalPanel.VerticalPanel.setStyleName方法的典型用法代码示例。如果您正苦于以下问题:Python VerticalPanel.setStyleName方法的具体用法?Python VerticalPanel.setStyleName怎么用?Python VerticalPanel.setStyleName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.ui.VerticalPanel.VerticalPanel
的用法示例。
在下文中一共展示了VerticalPanel.setStyleName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setStyleName [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: showDialog
# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setStyleName [as 别名]
def showDialog(self, event):
contents = VerticalPanel()
contents.setSpacing(4)
contents.add(HTML('You can place any contents you like in a dialog box.'))
contents.add(Button("Close", getattr(self, "onClose")))
contents.setStyleName("Contents")
self._dialog = DialogBox()
self._dialog.setHTML('<b>Welcome to the dialog box</b>')
self._dialog.setWidget(contents)
left = (Window.getClientWidth() - 200) / 2
top = (Window.getClientHeight() - 100) / 2
self._dialog.setPopupPosition(left, top)
self._dialog.show()
示例3: get_upload_panel
# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setStyleName [as 别名]
def get_upload_panel(self):
# Create a FormPanel and point it at a service.
self.form = FormPanel()
self.form.setAction("/upload")
# Add an event handler to the form.
handler = UploadFormHandler()
handler.form = self.form
self.form.addFormHandler(handler)
# Because we're going to add a FileUpload widget, we'll need to set the
# form to use the POST method, and multipart MIME encoding.
self.form.setEncoding(FormPanel.ENCODING_MULTIPART)
self.form.setMethod(FormPanel.METHOD_POST)
panel = VerticalPanel()
panel.setSpacing(8)
panel.setStyleName("panel") # same name as in OpenPowerSystem.css.
self.form.setWidget(panel)
info = HTML(r'Upload CIM RDF/XML instance file.')
panel.add(info)
# Create a list box for choice of profile.
self.profiles = [("UCTE (CIM 14)", "ucte"),
("CPSM (CIM13)", "cpsm"),
("CDPSM (CIM 14)", "cdpsm"),
("Dynamics (CIM 14)", "dynamics")]
self.profile = ListBox(VisibleItemCount=1)
self.profile.setName("profileType")
for n, v in self.profiles:
self.profile.addItem(n, v)
panel.add(self.profile)
# Create a FileUpload widget.
rdfxml_file = FileUpload()
rdfxml_file.setName("uploadFormElement")
panel.add(rdfxml_file)
# Add a 'submit' button.
upload = Button("Upload", handler)
panel.add(upload)
return self.form
示例4: __init__
# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setStyleName [as 别名]
def __init__(self):
Composite.__init__(self)
panel = VerticalPanel()
headerPanel = VerticalPanel()
self.subject = HTML()
self.sender = HTML()
self.recipient = HTML()
self.body = HTML()
self.scroller = ScrollPanel(self.body)
self.body.setWordWrap(True)
headerPanel.add(self.subject)
headerPanel.add(self.sender)
headerPanel.add(self.recipient)
headerPanel.setWidth("100%")
innerPanel = DockPanel()
innerPanel.add(headerPanel, DockPanel.NORTH)
innerPanel.add(self.scroller, DockPanel.CENTER)
innerPanel.setCellHeight(self.scroller, "100%")
panel.add(innerPanel)
innerPanel.setSize("100%", "100%")
self.scroller.setSize("100%", "100%")
self.initWidget(panel)
self.setStyleName("mail-Detail")
headerPanel.setStyleName("mail-DetailHeader")
innerPanel.setStyleName("mail-DetailInner")
self.subject.setStyleName("mail-DetailSubject")
self.sender.setStyleName("mail-DetailSender")
self.recipient.setStyleName("mail-DetailRecipient")
self.body.setStyleName("mail-DetailBody")
Logger("Mail detail", " ")
示例5: onModuleLoad
# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setStyleName [as 别名]
class MovieRatings:
def onModuleLoad(self):
# Setup JSON RPC
self.remote = DataService()
### Initialize member variables
self.mainPanel = HorizontalPanel()
self.rightPanel = VerticalPanel()
self.moviesPanel = VerticalPanel()
self.topRatedPanel = VerticalPanel()
self.categoriesPanel = VerticalPanel()
self.moviesFlexTable = FlexTable()
self.topRatedMoviesFlexTable = FlexTable()
self.topCategoryMoviesFlexTable = FlexTable()
self.lessThanFiveLabel = Label('There are less than 5 movies. Add more movies!')
self.moviesListLabel = Label('Movies List')
self.addPanel = VerticalPanel()
self.newMovieCategoryTextBox = TextBox()
self.newMovieNameTextBox = TextBox()
self.newMovieRatingListBox = ListBox(False)
self.addMovieButton = Button('Add', self.addMovieButton_Click)
self.movies = []
self.topRatedMovies = []
self.categories = {}
self.MAX_RATING = 10
### Add Movie Panel
# Add ratings to list box
for i in range(self.MAX_RATING + 1):
self.newMovieRatingListBox.addItem(str(i))
# Add label and textbox to horizontal panel
self.labelPanel = HorizontalPanel()
self.labelPanel.add(Label("Add a movie:"))
self.categoryPanel = HorizontalPanel()
self.categoryPanel.add(Label("Category: "))
self.categoryPanel.add(self.newMovieCategoryTextBox)
self.namePanel = HorizontalPanel()
self.namePanel.add(Label("Movie Name: "))
self.namePanel.add(self.newMovieNameTextBox)
self.ratingPanel = HorizontalPanel()
self.ratingPanel.add(Label("Movie Rating: "))
self.ratingPanel.add(self.newMovieRatingListBox)
self.labelPanel.addStyleName("addLabel")
self.labelPanel.setSpacing(5)
self.categoryPanel.addStyleName("addPanel")
self.categoryPanel.setSpacing(5)
self.namePanel.addStyleName("addPanel")
self.namePanel.setSpacing(5)
self.ratingPanel.addStyleName("addPanel")
self.ratingPanel.setSpacing(5)
self.newMovieCategoryTextBox.addStyleName("addPanel-input")
self.newMovieNameTextBox.addStyleName("addPanel-input")
self.newMovieRatingListBox.addStyleName("addPanel-input")
self.addPanel.add(self.labelPanel)
self.addPanel.add(self.categoryPanel)
self.addPanel.add(self.namePanel)
self.addPanel.add(self.ratingPanel)
self.addPanel.add(self.addMovieButton)
self.addPanel.addStyleName("addPanel")
self.addMovieButton.addStyleName('addButton')
self.addPanel.add(self.addMovieButton)
self.addPanel.addStyleName('addPanel')
### Movies table
self.moviesFlexTable.setText(0, 1, "Category")
self.moviesFlexTable.setText(0, 2, "Title")
self.moviesFlexTable.setText(0, 3, "Rating")
self.moviesFlexTable.addStyleName("movieList")
self.moviesFlexTable.getRowFormatter().addStyleName(0, "listHeader")
self.moviesFlexTable.setCellPadding(6)
self.moviesFlexTable.getCellFormatter().setStyleName(0, 1, "listHeaderColumn")
self.moviesFlexTable.getCellFormatter().setStyleName(0, 2, "listHeaderColumn")
self.moviesListLabel.addStyleName("listLabel")
self.moviesPanel.add(self.moviesListLabel)
self.moviesPanel.add(self.moviesFlexTable)
self.moviesPanel.setStyleName("moviesPanel")
### Top rated movies table
self.topRatedMoviesFlexTable.setText(0, 0, "Category")
self.topRatedMoviesFlexTable.setText(0, 1, "Title")
self.topRatedMoviesFlexTable.setText(0, 2, "Rating")
self.topRatedMoviesFlexTable.addStyleName("topMoviesList")
self.topRatedMoviesFlexTable.getRowFormatter().addStyleName(0, "listHeader")
self.topRatedMoviesFlexTable.setCellPadding(6)
self.topRatedMoviesFlexTable.getCellFormatter().setStyleName(0, 0, "listHeaderColumn")
self.topRatedMoviesFlexTable.getCellFormatter().setStyleName(0, 1, "listHeaderColumn")
self.topRatedLabel = Label("Top 5 Rated Movies")
#.........这里部分代码省略.........
示例6: TextArea
# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setStyleName [as 别名]
outputArea = TextArea()
def convert(sender):
resdict = resgen_core.processconf(inputArea.getText())
hData = resgen_core.processhorz(resdict, hTemplate, footdict)
outputArea.setText(hData)
if __name__ == '__main__':
b = Button("Convert", convert)
p = HorizontalPanel()
p.add(inputArea)
p.add(outputArea)
q = VerticalPanel()
q.setStyleName("panel")
q.add(b)
q.add(p)
q.setHeight("100%")
q.setWidth("100%")
p.setHeight("80%")
p.setWidth("100%")
inputArea.setHeight("100%")
inputArea.setWidth("100%")
outputArea.setHeight("100%")
outputArea.setWidth("100%")
inputArea.setText(confDefault)