本文整理汇总了Python中pyjamas.ui.HorizontalPanel.HorizontalPanel类的典型用法代码示例。如果您正苦于以下问题:Python HorizontalPanel类的具体用法?Python HorizontalPanel怎么用?Python HorizontalPanel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HorizontalPanel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
class Site:
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,代码行数:30,代码来源:ajax.py
示例2: __init__
def __init__(self, SW, SH):
HorizontalPanel.__init__(self)
self.SW = SW
self.SH = SH
self.context = GWTCanvas(SW, SH, SW, SH)
self.context.addStyleName("gwt-canvas")
self.add(self.context)
开发者ID:ThatSnail,项目名称:OthelloBot,代码行数:7,代码来源:widget.py
示例3: onModuleLoad
def onModuleLoad(self):
self.TEXT_WAITING = "Waiting for response..."
self.TEXT_ERROR = "Server Error"
self.remote = JSONProxy("../api", ["hello"])
self.status = Label()
self.text_box = TextBox()
self.button_send = Button("Send", self)
buttons = HorizontalPanel()
buttons.add(self.button_send)
buttons.setSpacing(8)
info = """<h2>JSON-RPC Example</h2>
<p>This example demonstrates the calling of server services with
<a href="http://json-rpc.org/">JSON-RPC</a>.
</p>
<p>Enter your name below.</p>"""
panel = VerticalPanel()
panel.add(HTML(info))
panel.add(self.text_box)
#panel.add(method_panel)
panel.add(buttons)
panel.add(self.status)
RootPanel().add(panel)
开发者ID:nealie,项目名称:brubeck,代码行数:29,代码来源:JSONRPCExample.py
示例4: __init__
def __init__(self, tabBar=None, *kwargs):
TabPanel.__init__(self, tabBar, *kwargs)
self.parent_buoy = None
self.tabs = [{'hovertype' : ListBox(), 'name' : 'Cost'},
{'hovertype' : ListBox(), 'name' : 'Speed'}]
self.cost = self.tabs[0]['hovertype']
items = ['cheap','next to cheap','average','above average','expensive','if you have to ask']
self.cost.setVisibleItemCount(len(items))
for item in items:
self.cost.addItem(item)
self.cost.addChangeListener(self)
self.speed = self.tabs[1]['hovertype']
items = ['very slow','slow','average','above average','fast','quick','hyper','turbo','lightening','light']
self.speed.setVisibleItemCount(len(items))
for item in items:
self.speed.addItem(item)
self.speed.addChangeListener(self)
for tab in self.tabs:
h = HorizontalPanel()
h.add(tab['hovertype'])
self.add(h, tab['name'])
开发者ID:anandology,项目名称:pyjamas,代码行数:25,代码来源:Navigate.py
示例5: _createButtonPanel
def _createButtonPanel(self):
hp = HorizontalPanel()
self.okBtn = Button('OK', self.onOk, StyleName=self.baseStyleName + '-button')
self.cancelBtn = Button('Cancel', self.onCancel, StyleName=self.baseStyleName + '-button')
hp.add(self.okBtn)
hp.add(self.cancelBtn)
return hp
开发者ID:satyam07,项目名称:taoggregator,代码行数:7,代码来源:commoncontrols.py
示例6: __init__
def __init__(self):
""" Constructs a new EditPanel.
"""
self.TEXT_WAITING = "Waiting for response..."
self.TEXT_ERROR = "Server Error"
# self.remote_py = RegionNamesServicePython()
self.panel = VerticalPanel()
top_panel = HorizontalPanel()
top_panel.setSpacing(8)
self.panel.add(top_panel)
refresh = Button("Refresh", self)
top_panel.add(refresh)
self.status = Label()
top_panel.add(self.status)
edit_panel = HorizontalPanel()
self.panel.add(edit_panel)
self.tree = Tree()
self.tree.addTreeListener(self)
edit_panel.add(self.tree)
upload_item = TreeItem("Upload")
self.tree.add(upload_item)
map_item = TreeItem("Map")
self.tree.add(map_item)
开发者ID:ResearchEngr,项目名称:openpowersystem,代码行数:31,代码来源:edit_panel.py
示例7: __init__
def __init__(self):
DockPanel.__init__(self)
self.setSize('100%', '100%')
self.geocoder = Geocoder()
# widgets
topPanel = HorizontalPanel()
self.add(topPanel, DockPanel.NORTH)
self.address = TextBox()
self.address.setText("Sydney, NSW")
self.address.addChangeListener(self.codeAddress)
topPanel.add(self.address)
button = Button("Geocode")
button.addClickListener(self.codeAddress)
topPanel.add(button)
# now, the map
mapPanel = SimplePanel()
mapPanel.setSize('600', '400')
self.add(mapPanel, DockPanel.CENTER)
options = MapOptions(zoom=8, center=LatLng(-34.397, 150.644),
mapTypeId=MapTypeId.ROADMAP)
self.map = Map(mapPanel.getElement(), options)
开发者ID:Afey,项目名称:pyjs,代码行数:32,代码来源:GeocodingSimple.py
示例8: InitialiseScreen
def InitialiseScreen(self):
hpanel = HorizontalPanel()
self.add(hpanel)
vpanelMenu = VerticalPanel()
hpanel.add(vpanelMenu)
self.addbutton = Button("Add Triangle")
vpanelMenu.add(self.addbutton)
self.addbutton.addClickListener(getattr(self, "addtriangle"))
self.canvas = GWTCanvas(self.CANVAS_WIDTH, self.CANVAS_HEIGHT)
vpanelCanvas = VerticalPanel()
self.canvas.setWidth(self.CANVAS_WIDTH)
self.canvas.setHeight(self.CANVAS_HEIGHT)
hpanel.add(vpanelCanvas)
vpanelCanvas.add(self.canvas)
self.canvas.addMouseListener(self)
self.selecteditem = None
self.selectedhandle = None
self.mouseisdown = False
dc = DocumentCollection.documentcollection
DocumentCollection.documentcollection.edgelistener = self.EdgeListener
if len(dc.documentsbyclass[model.Drawing.__name__]) == 0:
drawing = model.Drawing(None)
dc.AddDocumentObject(drawing)
EdgePoster([a.asDict() for a in drawing.history.GetAllEdges()])
else:
for k,v in dc.documentsbyclass[model.Drawing.__name__].iteritems():
drawing = v
self.drawingid = drawing.id
self.Draw()
开发者ID:mlockett42,项目名称:pypddemo,代码行数:29,代码来源:pypddemo.py
示例9: _add_statusbar
def _add_statusbar ( self ):
""" Adds a statusbar to the dialog.
"""
if self.ui.view.statusbar is not None:
control = HorizontalPanel()
# control.setSizeGripEnabled(self.ui.view.resizable)
listeners = []
for item in self.ui.view.statusbar:
# Create the status widget with initial text
name = item.name
item_control = Label()
item_control.setText(self.ui.get_extended_value(name))
# Add the widget to the control with correct size
# width = abs(item.width)
# stretch = 0
# if width <= 1.0:
# stretch = int(100 * width)
# else:
# item_control.setMinimumWidth(width)
control.add(item_control)
# Set up event listener for updating the status text
col = name.find('.')
obj = 'object'
if col >= 0:
obj = name[:col]
name = name[col+1:]
obj = self.ui.context[obj]
set_text = self._set_status_text(item_control)
obj.on_trait_change(set_text, name, dispatch='ui')
listeners.append((obj, set_text, name))
self.master.add(control)
self.ui._statusbar = listeners
开发者ID:rwl,项目名称:traitsbackendpyjamas,代码行数:35,代码来源:ui_base.py
示例10: __init__
def __init__(self, row, column=0):
super(Game, self).__init__(StyleName='game')
self.sinkEvents(Event.ONCONTEXTMENU) # to disable right click
self.row = row
self.column = column or row
self.level = 1
self.toppers = [[], [], []] # storage for top scorers for 3 levels.
self.remote = DataService()
self.remote_handler = RemoteHandler(self)
self.remote.get_scores(self.remote_handler)
# contents of Game
menubar = MineMenuBar(self)
score_board = HorizontalPanel(StyleName='score-board')
self.grid_panel = SimplePanel(StyleName='grid-panel')
self.add(menubar)
self.add(score_board)
self.add(self.grid_panel)
# contents of score_board
self.counter = Label('000', StyleName='digit counter')
self.face = Smiley(self)
self.timer = Label('000', StyleName='digit timer')
for one in (self.counter, self.face, self.timer):
score_board.add(one)
score_board.setCellWidth(self.face, '100%')
self.create_grid()
self.start()
开发者ID:anandology,项目名称:pyjamas,代码行数:32,代码来源:minesweeper.py
示例11: __init__
def __init__(self, labelname, contenthtml, labelnamesuffix=': ', ensure_labelnamesuffix=True):
HorizontalPanel.__init__(self)
if ensure_labelnamesuffix and not labelname.endswith(labelnamesuffix):
labelname += labelnamesuffix
self.add(Label(labelname, StyleName=Styles.CONTENTITEM_COMPONENT_LABEL))
self.add(HTML(contenthtml, StyleName=Styles.CONTENTITEM_COMPONENT_CONTENT))
return
开发者ID:satyam07,项目名称:taoggregator,代码行数:7,代码来源:feedpublisherwebui.py
示例12: __init__
def __init__(self, chart):
self.chart = chart
self.canvas = chart.canvas
self.b2 = Button("Compositing", self)
self.b3 = Button("Paths & shapes", self)
self.b4 = Button("Arcs & circles", self)
self.b1 = Button("Bezier curves", self)
self.b6 = Button("Colors", self)
self.b7 = Button("Translating", self)
self.b8 = Button("Scaling", self)
self.b5 = Button("Rotating", self)
self.b10 = Button("Transparency", self)
self.b11 = Button("Lines", self)
self.b9 = Button("Animations", self)
hp = HorizontalPanel()
vp = VerticalPanel()
vp.setHorizontalAlignment(HasAlignment.ALIGN_LEFT)
vp.add(Label("MENU"))
vp.setSpacing(6)
vp.add(self.b2)
vp.add(self.b3)
vp.add(self.b4)
vp.add(self.b1)
vp.add(self.b6)
vp.add(self.b7)
vp.add(self.b8)
vp.add(self.b5)
vp.add(self.b10)
vp.add(self.b11)
vp.add(self.b9)
hp.add(vp)
Composite.__init__(self, hp)
开发者ID:anandology,项目名称:pyjamas,代码行数:35,代码来源:SuiteDemo.py
示例13: HorizontalToolbar
class HorizontalToolbar(SimplePanel):
def __init__(self, onRequestMore=None, onCollapseAll=None, onExpandAll=None, onSort=None):
super(HorizontalToolbar, self).__init__(StyleName=Styles.TOOLBAR_HORIZONTAL)
self.content = HorizontalPanel()
self.requestMoreButton = Button('More', onRequestMore, StyleName=Styles.TOOLBAR_BUTTON)
self.content.add(self.requestMoreButton)
self.itemsShowingLabel = Label(StyleName=Styles.TOOLBAR_TEXT)
self.content.add(self.itemsShowingLabel)
self.setNumberOfItemsShowingText(0, 0)
self.collapseAllButton = Button('Collapse All', onCollapseAll, StyleName=Styles.TOOLBAR_BUTTON)
self.content.add(self.collapseAllButton)
self.expandAllButton = Button('Expand All', onExpandAll, StyleName=Styles.TOOLBAR_BUTTON)
self.content.add(self.expandAllButton)
if onSort:
self.content.add(SortPanel(onSort))
self.setWidget(self.content)
return
def setNumberOfItemsShowingText(self, number, total):
self.itemsShowingLabel.setText('Showing %s of %s total items.' % (number, total))
return
开发者ID:satyam07,项目名称:taoggregator,代码行数:25,代码来源:feedpublisherwebui.py
示例14: __init__
def __init__(self, theorem, **kwargs):
DialogWindow.__init__(self, modal=True, close=True)
self.theorem=theorem
v = VerticalPanel()
v.setWidth(300)
# v.setHeight(500)
self.setText("save")
self.setPopupPosition(100, 100)
self.setStyleAttribute("background-color", "#ffffff")
self.setStyleAttribute("color", "red")
self.setStyleAttribute("border-width", "5px")
self.setStyleAttribute("border-style", "solid")
self.im=Image()
self.im.setUrl(latex_to_url(self.theorem.formula.to_latex()))
v.add(self.im)
h=HorizontalPanel()
self.radio=RadioButton("group1", "Existing folder:")
h.add(self.radio)
self.list = ListBox()
self.list.setVisibleItemCount(1)
for f in Theorem.get_all_folders():
self.list.addItem(f)
h.add(self.list)
v.add(h)
h=HorizontalPanel()
h.add(RadioButton("group1", "New folder:"))
self.radio.setChecked(True)
self.textbox=TextBox()
h.add(self.textbox)
v.add(h)
v.add(Button("Done",self.done_click))
self.add(v)
开发者ID:vizafogo123,项目名称:pokpok,代码行数:33,代码来源:SaveDialog.py
示例15: __init__
def __init__(self, owner):
Composite.__init__(self)
self.owner = owner
self.bar = DockPanel()
self.gotoFirst = Button("<<", self)
self.gotoNext = Button(">", self)
self.gotoPrev = Button("<", self)
self.status = HTML()
self.initWidget(self.bar)
self.bar.setStyleName("navbar")
self.status.setStyleName("status")
buttons = HorizontalPanel()
buttons.add(self.gotoFirst)
buttons.add(self.gotoPrev)
buttons.add(self.gotoNext)
self.bar.add(buttons, DockPanel.EAST)
self.bar.setCellHorizontalAlignment(buttons, HasAlignment.ALIGN_RIGHT)
self.bar.add(self.status, DockPanel.CENTER)
self.bar.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
self.bar.setCellHorizontalAlignment(self.status, HasAlignment.ALIGN_RIGHT)
self.bar.setCellVerticalAlignment(self.status, HasAlignment.ALIGN_MIDDLE)
self.bar.setCellWidth(self.status, "100%")
self.gotoPrev.setEnabled(False)
self.gotoFirst.setEnabled(False)
开发者ID:Afey,项目名称:pyjs,代码行数:27,代码来源:DynaTableWidget.py
示例16: __init__
def __init__(self, app):
self.app = app
DialogWindow.__init__(
self, modal=False,
minimize=True, maximize=True, close=True,
)
self.closeButton = Button("Close", self)
self.saveButton = Button("Save", self)
self.setText("Sample DialogWindow with embedded image")
self.msg = HTML("", True)
global _editor_id
_editor_id += 1
editor_id = "editor%d" % _editor_id
#self.ht = HTML("", ID=editor_id)
self.txt = TextArea(Text="", VisibleLines=30, CharacterWidth=80,
ID=editor_id)
dock = DockPanel()
dock.setSpacing(4)
hp = HorizontalPanel(Spacing="5")
hp.add(self.saveButton)
hp.add(self.closeButton)
dock.add(hp, DockPanel.SOUTH)
dock.add(self.msg, DockPanel.NORTH)
dock.add(self.txt, DockPanel.CENTER)
dock.setCellHorizontalAlignment(hp, HasAlignment.ALIGN_RIGHT)
dock.setCellWidth(self.txt, "100%")
dock.setWidth("100%")
self.setWidget(dock)
self.editor_id = editor_id
self.editor_created = False
开发者ID:brodybits,项目名称:pyjs,代码行数:35,代码来源:TinyMCEditor.py
示例17: __init__
def __init__(self, left = 50, top = 50):
DialogBox.__init__(self, modal = False)
self.setPopupPosition(left, top)
self.setText("Preferences")
ftable = FlexTable()
ftableFormatter = ftable.getFlexCellFormatter()
row = 0
try:
self.fileLocation = getCookie("fileLocation")
except:
self.fileLocation = None
row += 1
ftable.setWidget(row, 0, Label("Sheet loaded on startup", wordWrap=False))
self.fileLocationInput = TextBox()
self.fileLocationInput.addChangeListener(self.checkValid)
self.fileLocationInput.addKeyboardListener(self)
self.fileLocationInput.setVisibleLength(30)
self.fileLocationInput.setText(self.fileLocation)
ftable.setWidget(row, 1, self.fileLocationInput)
row += 1
hpanel = HorizontalPanel()
self.saveBtn = Button("Save", self.onSave)
self.saveBtn.setEnabled(False)
hpanel.add(self.saveBtn)
self.cancelBtn = Button("Cancel", self.onCancel)
hpanel.add(self.cancelBtn)
ftable.setWidget(row, 0, hpanel)
ftableFormatter.setColSpan(row, 0, 2)
self.setWidget(ftable)
开发者ID:Afey,项目名称:pyjs,代码行数:34,代码来源:PreferencesDlg.py
示例18: __init__
def __init__(self, token_index, target_word):
HorizontalPanel.__init__(self)
self.token_index = token_index
self.table = FlexTable()
self.label = Label(target_word)
self.textbox = TextBox()
self.add(self.label)
self.add(self.textbox)
开发者ID:lukeorland,项目名称:Choban,代码行数:8,代码来源:BIO.py
示例19: __init__
def __init__(self):
HorizontalPanel.__init__(self)
History.newItem("test")
show = Button("Show deep link", self.showDL)
setDL = Button("Set deep link to 'pyjamas'", self.setDL)
self.add(setDL)
self.add(show)
开发者ID:Afey,项目名称:pyjs,代码行数:8,代码来源:deepLink.py
示例20: __init__
def __init__(self):
self.mainPanel = VerticalPanel()
self.contest = HorizontalPanel()
self.contest.setStyleName('words')
self.selection = HorizontalPanel()
self.selection.setStyleName('words')
self.button = Button('test', self.test)
self.x = 1
开发者ID:kurifu,项目名称:Old-CMUSV-Voting,代码行数:8,代码来源:pjBallot.py
注:本文中的pyjamas.ui.HorizontalPanel.HorizontalPanel类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论