本文整理汇总了Python中pyjamas.ui.VerticalPanel.VerticalPanel类的典型用法代码示例。如果您正苦于以下问题:Python VerticalPanel类的具体用法?Python VerticalPanel怎么用?Python VerticalPanel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了VerticalPanel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
开发者ID:anandology,项目名称:pyjamas,代码行数:34,代码来源:SinkList.py
示例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)
开发者ID:fedenko,项目名称:clientbank,代码行数:25,代码来源:AccountListSink.py
示例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
开发者ID:Waqquas,项目名称:pylon,代码行数:7,代码来源:pylon_client.py
示例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
开发者ID:molhokwai,项目名称:libraries,代码行数:26,代码来源:Index0.py
示例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)
开发者ID:jdunck,项目名称:Tickery,代码行数:31,代码来源:userlist.py
示例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=[]
开发者ID:Afey,项目名称:pyjs,代码行数:32,代码来源:oldExample.py
示例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
开发者ID:christophgysin,项目名称:schoolbell,代码行数:28,代码来源:alarmwidget.py
示例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()
开发者ID:tDeranek117,项目名称:CSE-Notre-Dame,代码行数:29,代码来源:ajax.py
示例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)
开发者ID:anandology,项目名称:pyjamas,代码行数:26,代码来源:CanvasTab.py
示例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)
开发者ID:,项目名称:,代码行数:29,代码来源:
示例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())
开发者ID:mcsquaredjr,项目名称:Reports,代码行数:35,代码来源:form.py
示例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)
开发者ID:Afey,项目名称:pyjs,代码行数:28,代码来源:fileUpload.py
示例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)
开发者ID:satyam07,项目名称:taoggregator,代码行数:26,代码来源:feedpublisherwebui.py
示例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
开发者ID:Afey,项目名称:pyjs,代码行数:7,代码来源:absolutePanel.py
示例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)
开发者ID:certik,项目名称:pyjamas,代码行数:28,代码来源:FlowPanel.py
示例16: AlgorithmList
class AlgorithmList(Composite):
def __init__(self):
Composite.__init__(self)
self.vp_list=VerticalPanel()
self.Algorithms=[]
self.selectedAlgorithm=-1
self.initWidget(self.vp_list)
self.setStyleName("ks-List")
def addAlgorithm(self, info):
name = info.getName()
link = Hyperlink(name, False, TargetHistoryToken=name)
link.setStyleName("ks-AlgorithmItem")
self.vp_list.add(link)
self.Algorithms.append(info)
def find(self, AlgorithmName):
for info in self.Algorithms:
if info.getName()==AlgorithmName:
return info
return None
def setAlgorithmSelection(self, name):
if self.selectedAlgorithm <> -1:
self.vp_list.getWidget(self.selectedAlgorithm).removeStyleName("ks-AlgorithmItem-selected")
for i in range(len(self.Algorithms)):
info = self.Algorithms[i]
if (info.getName()==name):
self.selectedAlgorithm = i
widget=self.vp_list.getWidget(self.selectedAlgorithm)
widget.addStyleName("ks-AlgorithmItem-selected")
return
开发者ID:aprovodi,项目名称:mlServerCalculations,代码行数:35,代码来源:AlgorithmList.py
示例17: Dashboard
class Dashboard(Composite):
def __init__(self):
Composite.__init__(self)
self.outer = VerticalPanel()
self.outer.setSpacing("20px")
self.outer.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER)
self.display_panel = DisplayPanel()
self.screen = Screen()
self.screen.base = self
self.screen.display_panel = self.display_panel
self.control_panel = ControlPanel()
self.control_panel.base = self
self.initWidget(self.outer)
self.outer.add(self.display_panel)
self.outer.add(self.screen)
self.outer.add(self.control_panel)
self.initDashboard()
def initDashboard(self):
self.screen.resize(4,4)
self.screen.shuffle()
def incrCount(self):
self.display_panel.incrCount()
开发者ID:vijayendra,项目名称:Puzzle-Game,代码行数:28,代码来源:Puzzle.py
示例18: __init__
def __init__(self,parent):
AbsolutePanel.__init__(self)
self.roleList = ListBox()
self.roleList.setWidth('300px')
self.roleList.setVisibleItemCount(6)
self.roleList.addChangeListener(self.onListChange)
#self.roleList.addKeyboardListener(self)
self.roleCombo = ListBox()
self.roleCombo.addKeyboardListener(self)
self.roleCombo.addChangeListener(self.onComboChange)
self.addBtn = Button("Add")
self.addBtn.setEnabled(False)
self.removeBtn = Button("Remove")
self.removeBtn.setEnabled(False)
vpanel = VerticalPanel()
vpanel.add(self.roleList)
hpanel = HorizontalPanel()
hpanel.add(self.roleCombo)
hpanel.add(self.addBtn)
hpanel.add(self.removeBtn)
vpanel.add(hpanel)
self.add(vpanel)
self.clearForm()
return
开发者ID:Afey,项目名称:pyjs,代码行数:27,代码来源:components.py
示例19: Form_Row
class Form_Row(SimplePanel):
'''
Create row that will be put in the Form
'''
def __init__(self, name, widget, help=''):
SimplePanel.__init__(self)
# Container
self.mainpanel = VerticalPanel()
self.lbl = Label(name)
self.hlp = Label(help)
self.lbl.setStyleName('h3')
self.hlp.setStyleName('text-muted')
self.wdg = widget
self.mainpanel.add(self.lbl)
self.mainpanel.add(self.wdg)
self.mainpanel.add(self.hlp)
def panel(self):
return self.mainpanel
def widget(self):
return self.wdg
def help(self):
return self.hlp
开发者ID:mcsquaredjr,项目名称:Reports,代码行数:27,代码来源:form.py
示例20: __init__
def __init__(self):
AbsolutePanel.__init__(self)
self.app = CompaniesApp()
self.history = []
self.save = Button("save", self)
self.selectDepartment = Button("select", self)
self.selectEmployee = Button("select", self)
self.edit = Button("edit", self)
self.cut = Button("cut", self)
self.back = Button("back", self)
self.name = TextBox()
self.address = TextBox()
self.manager = TextBox()
self.departments = ListBox(Size=("100%"), VisibleItemCount="5")
self.employees = ListBox(Size=("100%"), VisibleItemCount="5")
self.total = TextBox()
self.errors = VerticalPanel()
self.grid = Grid()
self.allPanels = VerticalPanel()
self.allPanels.add(self.grid)
self.allPanels.add(self.errors)
self.add(self.allPanels)
self.initCompanyGUI()
开发者ID:101companies,项目名称:101repo,代码行数:30,代码来源:101Companies.py
注:本文中的pyjamas.ui.VerticalPanel.VerticalPanel类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论