本文整理汇总了Python中pyjamas.ui.VerticalPanel.VerticalPanel类的典型用法代码示例。如果您正苦于以下问题:Python VerticalPanel类的具体用法?Python VerticalPanel怎么用?Python VerticalPanel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了VerticalPanel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SinkList
class SinkList(Composite):
def __init__(self):
Composite.__init__(self)
self.vp_list=VerticalPanel()
self.sinks=[]
self.selectedSink=-1
self.initWidget(self.vp_list)
self.setStyleName("ks-List")
def addSink(self, info):
name = info.getName()
link = Hyperlink(name, False, TargetHistoryToken=name)
link.setStyleName("ks-SinkItem")
self.vp_list.add(link)
self.sinks.append(info)
def find(self, sinkName):
for info in self.sinks:
if info.getName()==sinkName:
return info
return None
def setSinkSelection(self, name):
if self.selectedSink <> -1:
self.vp_list.getWidget(self.selectedSink).removeStyleName("ks-SinkItem-selected")
for i in range(len(self.sinks)):
info = self.sinks[i]
if (info.getName()==name):
self.selectedSink = i
widget=self.vp_list.getWidget(self.selectedSink)
widget.addStyleName("ks-SinkItem-selected")
return
示例2: __init__
def __init__(self, hendler = None):
VerticalPanel.__init__(self,
#HorizontalAlignment=HasAlignment.ALIGN_CENTER,
#VerticalAlignment=HasAlignment.ALIGN_MIDDLE,
Width="100%",
#Height="100%",
Spacing=5)
self.remote = DataService(['getaccounts'])
self.grid = Grid(1, 3,
BorderWidth=1,
CellPadding=4,
CellSpacing=1,
StyleName="grid")
self.grid.setText(0, 0, u"Number")
self.grid.setText(0, 1, u"Type")
self.grid.setText(0, 2, u"Balance")
formatter = self.grid.getRowFormatter()
formatter.setStyleName(0, "grid-header")
self.add(Label(u"Accounts"))
self.add(self.grid)
示例3: get_case_panel
def get_case_panel(self):
panel = VerticalPanel()
title = HTML("""Case""")
panel.add(title)
tree = self.get_case_tree()
panel.add(tree)
return panel
示例4: themesPanel
def themesPanel(self, themes=None):
Window.alert('line:111')
themes = None
if not themes: themes=['0','1', 'cms', 'pypress']
vPanel = VerticalPanel()
for i in range(len(themes)):
"""
a_n = location.getPathName().split('/')[1]
lambda1 = lambda x: w_l.pathname.replace('/'+a_n+'/', '/'+x+'/')+'?theme='+x
lambda2 = lambda x: w_l.pathname.replace('/'+a_n+'/', '/a/')+'?theme='+x
href = {
'cms' : lambda1,
'pypress' : lambda1,
'o' : lambda2,
'1' : lambda2
}.get(themes[i], lambda2)(themes[i])
"""
a=Button('theme '+themes[i],
lambda x: location.setSearchDict({'theme': x.getID()}),
StyleName='link')
a.setID(themes[i])
vPanel.add(a)
return vPanel
示例5: __init__
def __init__(self, userListPanel, tabPanel, topPanel):
VerticalPanel.__init__(self, StyleName='large-avatar-panel')
self.userListPanel = userListPanel
self.tabPanel = tabPanel
self.topPanel = topPanel
upperPanel = HorizontalPanel(StyleName='large-avatar-upper-panel',
Spacing=8)
self.image = Image(StyleName='large-avatar')
self.upperText = HTML(StyleName='large-avatar-upper-text')
upperPanel.add(self.image)
upperPanel.add(self.upperText)
self.add(upperPanel)
self.lowerText = HTML(StyleName='large-avatar-lower-text')
self.add(self.lowerText)
self.followButton = None
self.user = None
insertPanel = HorizontalPanel(Spacing=3)
insertPanel.add(Label('Use name: '))
if tabPanel.tabName == 'simple':
b1 = Button('upper', SimpleInserter(self, 'upper'))
b2 = Button('lower', SimpleInserter(self, 'lower'))
insertPanel.add(b1)
insertPanel.add(b2)
else:
b1 = Button('or', QueryInserter(self, 'or'))
b2 = Button('and', QueryInserter(self, 'and'))
b3 = Button('except', QueryInserter(self, 'except'))
insertPanel.add(b1)
insertPanel.add(b2)
insertPanel.add(b3)
self.add(insertPanel)
示例6: onModuleLoad
def onModuleLoad(self):
self.remote = DataService()
vPanel = VerticalPanel()
# create div to hold map
mapPanel = SimplePanel()
mapPanel.setSize('700px','400px')
# initiate getting gps data from web2py
self.remote.getPoints(self)
# create slider div
slider = SimplePanel()
self.slider = slider
# add map and slide to main panel
vPanel.add(mapPanel)
vPanel.add(slider)
# add everything to page's GreedyPyJs div
root = RootPanelCls(DOM.getElementById("GreedPyJs"))
root.add(vPanel)
# Create initial google map
self.map = GMap2(mapPanel.getElement())
self.map.setCenter(GLatLng(37.4419, -122.1419), 13)
# create place to hold gps positions
# these will be in tuples: (date, latitude, longitude)
self.positions=[]
示例7: make_panel
def make_panel(self):
message = Label(
'The configuration has been changed.\n'
'You must apply the changes in order for them to take effect.')
DOM.setStyleAttribute(message.getElement(), "whiteSpace", 'pre')
msgbox = Grid(1, 2, StyleName='changes')
msgbox.setWidget(0, 0, Image('icons/exclam.png'))
msgbox.setWidget(0, 1, message)
msgbox.getCellFormatter().setStyleName(0, 0, 'changes-image')
msgbox.getCellFormatter().setStyleName(0, 1, 'changes-text')
button = Button('apply changes')
button.addClickListener(self.apply_clicked)
self.changes = VerticalPanel()
self.changes.setHorizontalAlignment('right')
self.changes.setVisible(False)
self.changes.add(msgbox)
self.changes.add(button)
panel = VerticalPanel()
panel.setSpacing(10)
panel.add(self.table)
panel.add(self.status)
panel.add(self.changes)
return panel
示例8: __init__
def __init__(self):
# Record the image url for easy access
self.IMAGES_URL = "http://www.cse.nd.edu/~cmc/teaching/cse30332_sp15/images"
# The title label is intially empty but will be filled with the top
# recommended movie by the time the page is viewed
self.title_l = Label("", StyleName="teststyle")
self.up_b = Button("UP", post_vote)
self.down_b = Button("DOWN", post_vote)
self.rating_l = Label("", StyleName="teststyle")
self.img = Image("")
# Construct three vertical panels to make he display slightly columnar
self.leftVertPanel = VerticalPanel()
self.midlVertPanel = VerticalPanel()
self.riteVertPanel = VerticalPanel()
self.horizontalizer = HorizontalPanel()
# Add the buttons to the correct vertical panels!!!
self.midlVertPanel.add(self.title_l)
self.midlVertPanel.add(self.img)
self.midlVertPanel.add(self.rating_l)
self.riteVertPanel.add(self.down_b)
self.leftVertPanel.add(self.up_b)
# Add all the panels to the horizontal panel
self.horizontalizer.add(self.leftVertPanel)
self.horizontalizer.add(self.midlVertPanel)
self.horizontalizer.add(self.riteVertPanel)
# Add the horizontal panel to the vertical one
RootPanel().add(self.horizontalizer)
# Get the first recommendation
get_recommendation()
示例9: __init__
def __init__(self):
Sink.__init__(self)
colour_grid = ColourGridCanvas()
rotated = RotatedCanvas()
spheres = SpheresCanvas()
#pattern = PatternCanvas()
spiro = SpiroCanvas()
self.solar = SolarCanvas()
row0 = HorizontalPanel()
row0.setSpacing(8)
row0.add(colour_grid)
row0.add(rotated)
row0.add(spheres)
#row0.add(pattern)
row1 = HorizontalPanel()
row1.setSpacing(8)
row1.add(self.solar)
row1.add(spiro)
panel = VerticalPanel()
panel.add(row0)
panel.add(row1)
self.setWidget(panel)
示例10: __init__
def __init__(self):
self.form = FormPanel()
self.form.setAction("/Accession/searchByName/")
# 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)
# Create a panel to hold all of the form widgets.
vpanel = VerticalPanel()
self.form.setWidget(vpanel)
self.colour_input = AutoCompleteByURLTextBox('/Accession/autoComplete')
hpanel = HorizontalPanel()
hpanel.add(HTML("Enter an ecotype name: "))
hpanel.add(self.colour_input)
hpanel.setSpacing(8)
# Add a 'submit' button.
hpanel.add(Button("Submit", self))
vpanel.add(hpanel)
# Add an event handler to the form.
self.form.addFormHandler(self)
self.setWidget(self.form)
示例11: __init__
def __init__(self, start_date, can_delete=True):
# We need to use old form of inheritance because of pyjamas
SimplePanel.__init__(self)
self.vpanel = VerticalPanel()
desc_panel = VerticalPanel()
self.desc_box = TextBox()
self.desc_box.setVisibleLength(44)
self.desc_box.setStyleName('form-control')
desc_lbl = Label('impediment description')
desc_lbl.setStyleName('text-muted')
desc_panel.add(self.desc_box)
desc_panel.add(desc_lbl)
# Set to False if loaded from database
self.can_delete = can_delete
status_panel = VerticalPanel()
self.status_lst = ListBox(Height='34px')
self.status_lst.setStyleName('form-control input-lg')
self.status_lst.addItem('Open')
self.status_lst.addItem('Closed')
# we put date here
self.status_lbl = Label('')
self.set_start_date(start_date)
self.status_lbl.setStyleName('text-muted')
status_panel = VerticalPanel()
status_panel.add(self.status_lst)
status_panel.add(self.status_lbl)
self.comment = Text_Area_Row('', 'why it exists or is being closed')
hpanel = HorizontalPanel()
hpanel.add(desc_panel)
hpanel.add(Label(Width='10px'))
hpanel.add(status_panel)
self.vpanel.add(hpanel)
self.vpanel.add(self.comment.panel())
示例12: __init__
def __init__(self):
SimplePanel.__init__(self)
self.form = FormPanel()
self.form.setEncoding(FormPanel.ENCODING_MULTIPART)
self.form.setMethod(FormPanel.METHOD_POST)
self.form.setAction("http://nonexistent.com")
self.form.setTarget("results")
vPanel = VerticalPanel()
hPanel = HorizontalPanel()
hPanel.setSpacing(5)
hPanel.add(Label("Upload file:"))
self.field = FileUpload()
self.field.setName("file")
hPanel.add(self.field)
hPanel.add(Button("Submit", getattr(self, "onBtnClick")))
vPanel.add(hPanel)
results = NamedFrame("results")
vPanel.add(results)
self.form.add(vPanel)
self.add(self.form)
示例13: __init__
def __init__(self):
VerticalPanel.__init__(self)
self.remoteproxy = JsonTaoggregatorService()
self.totalitemcount = 0
self.idToCallbackMap = {}
createToolbar = lambda: HorizontalToolbar(self.onRequestMore, self.onCollapseAll, self.onExpandAll)
topbar = createToolbar()
self.add(topbar)
self.contentpanel = ContentPanel(self.onCIPublish,
lambda sen, ci: self.onCIAdjustLike(sen, ci, 1),
lambda sen, ci: self.onCIAdjustLike(sen, ci, -1),
self.onSort,
self.onFilter)
self.add(self.contentpanel)
botbar = createToolbar()
self.add(botbar)
self.horiztoolbars = [topbar, botbar]
self.lastOnSortArgs = None
self.lastOnFilterArgs = None
self.requestDownloadedContentCount()
self.onRequestMore(None)
示例14: makeBox
def makeBox(self, label):
wrapper = VerticalPanel(BorderWidth=1)
wrapper.add(HTML(label))
DOM.setAttribute(wrapper.getTable(), "cellPadding", "10")
DOM.setAttribute(wrapper.getTable(), "bgColor", "#C3D9FF")
return wrapper
示例15: work
class FlowPanelDemo:
"""Demos the flow panel. Because of how the Flow Panel works, all elements have to be inline elements.
Divs, tables, etc. can't be used, unless specified with CSS that they are inline or inline-block.
Because of how Vertical Panels work (with tables), we use CSS to display tables as inline-blocks.
IE, excluding IE8, doesn't support inline-blocks, so we have to use a CSS hack
(see http://blog.mozilla.com/webdev/2009/02/20/cross-browser-inline-block/ for more on the hack)
However, we use spans instead of divs for the Label by providing an 'element' argument."""
def __init__(self):
self.root = RootPanel()
#Flow panel taking up 70% of the page. CSS centers it.
self.flow = FlowPanel(Width="70%", StyleName='flow-panel')
for x in range(0, 10):
self.panel = VerticalPanel()
#Label each image with its number in the sequence
title = Label("Item %s" % x, element=DOM.createElement('span'), StyleName="title item")
#Add a neat-o image.
image = Image('images/pyjamas.png', Width="200px", Height="200px", StyleName="cat-image cat-item")
#Add to the Vertical Panel the image title
self.panel.add(title)
self.panel.add(image)
self.flow.add(self.panel)
self.root.add(self.flow)