本文整理汇总了Python中pyjamas.ui.VerticalPanel.VerticalPanel.setBorderWidth方法的典型用法代码示例。如果您正苦于以下问题:Python VerticalPanel.setBorderWidth方法的具体用法?Python VerticalPanel.setBorderWidth怎么用?Python VerticalPanel.setBorderWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.ui.VerticalPanel.VerticalPanel
的用法示例。
在下文中一共展示了VerticalPanel.setBorderWidth方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setBorderWidth [as 别名]
def __init__(self):
SimplePanel.__init__(self)
panel = VerticalPanel()
panel.setBorderWidth(1)
panel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
panel.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
part1 = Label("Part 1")
part2 = Label("Part 2")
part3 = Label("Part 3")
part4 = Label("Part 4")
panel.add(part1)
panel.add(part2)
panel.add(part3)
panel.add(part4)
panel.setCellHeight(part1, "10%")
panel.setCellHeight(part2, "70%")
panel.setCellHeight(part3, "10%")
panel.setCellHeight(part4, "10%")
panel.setCellHorizontalAlignment(part3, HasAlignment.ALIGN_RIGHT)
panel.setWidth("50%")
panel.setHeight("300px")
self.add(panel)
示例2: makeBox
# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setBorderWidth [as 别名]
def makeBox(self, label):
wrapper = VerticalPanel()
wrapper.setBorderWidth(1)
wrapper.add(HTML(label))
DOM.setAttribute(wrapper.getTable(), "cellPadding", "10")
DOM.setAttribute(wrapper.getTable(), "bgColor", "#C3D9FF")
return wrapper
示例3: border
# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setBorderWidth [as 别名]
def border(contents):
""" Draw a border around the given contents.
We return a Panel which wraps up the given contents and draws a border
around it.
"""
wrapper = VerticalPanel()
wrapper.add(contents)
wrapper.setBorderWidth(1)
return wrapper
示例4: _fill_panel
# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setBorderWidth [as 别名]
def _fill_panel(panel, content, ui, item_handler=None):
""" Fill a page based container panel with content.
"""
active = 0
for index, item in enumerate(content):
page_name = item.get_label(ui)
if page_name == "":
page_name = "Page %d" % index
if isinstance(item, Group):
if item.selected:
active = index
gp = _GroupPanel(item, ui, suppress_label=True)
page = gp.control
sub_page = gp.sub_control
# If the result is the same type with only one page, collapse it
# down into just the page.
if type(sub_page) is type(panel) and sub_page.count() == 1:
new = sub_page.getWidget(0)
if isinstance(panel, TabPanel):
sub_page.remove(sub_page.getWidget(0))
else:
sub_page.remove(sub_page.getWidget(0))
elif isinstance(page, Widget):
new = page
else:
new = Widget()
new.setLayoutData(page)
layout = new.getLayoutData()
# if layout is not None:
# layout.setAlignment(QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
else:
new = Widget()
layout = VerticalPanel()
layout.setBorderWidth(0)
item_handler(item, layout)
# Add the content.
if isinstance(panel, TabPanel):
panel.add(new, page_name)
else:
panel.add(new)
panel.selectTab( active )
示例5: onModuleLoad
# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setBorderWidth [as 别名]
def onModuleLoad(self):
""" Dynamically build our user interface when the web page is loaded.
"""
self._root = RootPanel()
self._tree = Tree()
self._rightPanel = SimplePanel()
self._curContents = None
intro = HTML('<h3>Welcome to the Pyjamas User Interface Showcase</h3>'+
'<p/>Please click on an item to start.')
self._introPanel = VerticalPanel()
self._introPanel.add(uiHelpers.indent(intro, left=20))
self._demos = [] # List of all installed demos. Each item in this list
# is a dictionary with the following entries:
#
# 'name'
#
# The name for this demo.
#
# 'section'
#
# The name of the section of the demo tree
# this demo should be part of.
#
# 'doc'
#
# The documentation for this demo.
#
# 'src'
#
# The source code for this demo.
#
# 'example'
#
# The Panel which holds the example output for
# this demo.
self.loadDemos()
self.buildTree()
self._tree.setSize("0%", "100%")
divider = VerticalPanel()
divider.setSize("1px", "100%")
divider.setBorderWidth(1)
scroller = ScrollPanel(self._rightPanel)
scroller.setSize("100%", "100%")
hPanel = HorizontalPanel()
hPanel.setSpacing(4)
hPanel.add(self._tree)
hPanel.add(divider)
hPanel.add(scroller)
hPanel.setHeight("100%")
self._root.add(hPanel)
self._tree.addTreeListener(self)
self.showDemo(None)
示例6: __init__
# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setBorderWidth [as 别名]
#.........这里部分代码省略.........
self._Refresh.rpcService.I2CRegisterValues( self._Refresh.getTotalCBCs(), I2CPanel.ReadRegisterValueListener(self._Refresh) ) #Live refresh of the status box
def onRemoteError(self, code, message, request_info):
ErrorMessage( "Unable to contact server" )
def __init__( self ) :
# This is the service that will be used to communicate with the DAQ software
self.rpcService = GlibRPCService.instance()
# The main panel that everythings will be insided
self.mainPanel = HorizontalPanel()
self.mainPanel.setSpacing(10)
self.i2cValueEntries = {} # The input boxes for all the registers
self.statusValueEntries = {} # Displays the status of the i2cValueEntries
self.stateValueEntries = {} # For load/save state
self.fileName = {} # File name of the i2c registers
# This is the list of available CBC chips. It will be populated by a call to the
# server later.
self.cbcList=ListBox(MultipleSelect=True, VisibleItemCount=10)
self.cbcList.addItem( "waiting..." ) # Default text until I hear from the server what's connected
self.cbcList.setEnabled( False )
self.cbcList.addChangeListener(self)
self.rpcService.connectedCBCNames( None, I2CPanel.ConnectedCBCListener(self.cbcList) ) # Ask the server what's connected
# This is the panel that will have the list of I2C registers. I'll split up the
# registers into subjects to make them more manageable.
self.mainSettings = DisclosurePanel("Main Control Registers")
self.channelMasks = DisclosurePanel("Channel Masks")
self.channelTrims = DisclosurePanel("Channel Trims")
self.callSettings = VerticalPanel("Load/Save States")
self.callSettings.setBorderWidth(1)
self.callSettings.add(HTML("<center>Load/Save State</center>"))
cbcListAndCallSettings=VerticalPanel()
cbcListAndCallSettings.add(self.cbcList)
cbcListAndCallSettings.add(self.callSettings)
self.mainPanel.add(cbcListAndCallSettings)
self.mainPanel.add(self.mainSettings)
self.mainPanel.add(self.channelMasks)
self.mainPanel.add(self.channelTrims)
self.callSettings.add( self.createStatesPanel())
self.mainSettings.add( self.createRegisterPanel(["FrontEndControl","TriggerLatency","HitDetectSLVS","Ipre1","Ipre2","Ipsf","Ipa","Ipaos","Vpafb","Icomp","Vpc","Vplus","VCth","TestPulsePot","SelTestPulseDel&ChanGroup","MiscTestPulseCtrl&AnalogMux","TestPulseChargePumpCurrent","TestPulseChargeMirrCascodeVolt","CwdWindow&Coincid","MiscStubLogic"]) )
self.channelMasks.add( self.createRegisterPanel(["MaskChannelFrom008downto001","MaskChannelFrom016downto009","MaskChannelFrom024downto017","MaskChannelFrom032downto025","MaskChannelFrom040downto033","MaskChannelFrom048downto041","MaskChannelFrom056downto049","MaskChannelFrom064downto057","MaskChannelFrom072downto065","MaskChannelFrom080downto073","MaskChannelFrom088downto081","MaskChannelFrom096downto089","MaskChannelFrom104downto097","MaskChannelFrom112downto105","MaskChannelFrom120downto113","MaskChannelFrom128downto121","MaskChannelFrom136downto129","MaskChannelFrom144downto137","MaskChannelFrom152downto145","MaskChannelFrom160downto153","MaskChannelFrom168downto161","MaskChannelFrom176downto169","MaskChannelFrom184downto177","MaskChannelFrom192downto185","MaskChannelFrom200downto193","MaskChannelFrom208downto201","MaskChannelFrom216downto209","MaskChannelFrom224downto217","MaskChannelFrom232downto225","MaskChannelFrom240downto233","MaskChannelFrom248downto241","MaskChannelFrom254downto249"]) )
self.channelTrims.add( self.createRegisterPanel(["Channel001","Channel002","Channel003","Channel004","Channel005","Channel006","Channel007","Channel008","Channel009","Channel010","Channel011","Channel012","Channel013","Channel014","Channel015","Channel016","Channel017","Channel018","Channel019","Channel020","Channel021","Channel022","Channel023","Channel024","Channel025","Channel026","Channel027","Channel028","Channel029","Channel030","Channel031","Channel032","Channel033","Channel034","Channel035","Channel036","Channel037","Channel038","Channel039","Channel040","Channel041","Channel042","Channel043","Channel044","Channel045","Channel046","Channel047","Channel048","Channel049","Channel050","Channel051","Channel052","Channel053","Channel054","Channel055","Channel056","Channel057","Channel058","Channel059","Channel060","Channel061","Channel062","Channel063","Channel064","Channel065","Channel066","Channel067","Channel068","Channel069","Channel070","Channel071","Channel072","Channel073","Channel074","Channel075","Channel076","Channel077","Channel078","Channel079","Channel080","Channel081","Channel082","Channel083","Channel084","Channel085","Channel086","Channel087","Channel088","Channel089","Channel090","Channel091","Channel092","Channel093","Channel094","Channel095","Channel096","Channel097","Channel098","Channel099","Channel100","Channel101","Channel102","Channel103","Channel104","Channel105","Channel106","Channel107","Channel108","Channel109","Channel110","Channel111","Channel112","Channel113","Channel114","Channel115","Channel116","Channel117","Channel118","Channel119","Channel120","Channel121","Channel122","Channel123","Channel124","Channel125","Channel126","Channel127","Channel128","Channel129","Channel130","Channel131","Channel132","Channel133","Channel134","Channel135","Channel136","Channel137","Channel138","Channel139","Channel140","Channel141","Channel142","Channel143","Channel144","Channel145","Channel146","Channel147","Channel148","Channel149","Channel150","Channel151","Channel152","Channel153","Channel154","Channel155","Channel156","Channel157","Channel158","Channel159","Channel160","Channel161","Channel162","Channel163","Channel164","Channel165","Channel166","Channel167","Channel168","Channel169","Channel170","Channel171","Channel172","Channel173","Channel174","Channel175","Channel176","Channel177","Channel178","Channel179","Channel180","Channel181","Channel182","Channel183","Channel184","Channel185","Channel186","Channel187","Channel188","Channel189","Channel190","Channel191","Channel192","Channel193","Channel194","Channel195","Channel196","Channel197","Channel198","Channel199","Channel200","Channel201","Channel202","Channel203","Channel204","Channel205","Channel206","Channel207","Channel208","Channel209","Channel210","Channel211","Channel212","Channel213","Channel214","Channel215","Channel216","Channel217","Channel218","Channel219","Channel220","Channel221","Channel222","Channel223","Channel224","Channel225","Channel226","Channel227","Channel228","Channel229","Channel230","Channel231","Channel232","Channel233","Channel234","Channel235","Channel236","Channel237","Channel238","Channel239","Channel240","Channel241","Channel242","Channel243","Channel244","Channel245","Channel246","Channel247","Channel248","Channel249","Channel250","Channel251","Channel252","Channel253","Channel254","ChannelDummy"]) )
self.mainSettings.add()
self.echo=Label()
self.mainPanel.add(self.echo)
def getPanel( self ) :
return self.mainPanel
def onChange( self, sender ) :
if sender == self.cbcList :
# Make a call to the RPC service to get the register values
self.rpcService.I2CRegisterValues( self.getTotalCBCs(), I2CPanel.ReadRegisterValueListener(self) )#fb - sends all CBCs
self.load.setEnabled(True)
self.save.setEnabled(True)
elif sender == self.save:
msg = self.saveFileName.getText()
示例7: ReducePanelIFACE
# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setBorderWidth [as 别名]
class ReducePanelIFACE(PanelIFACE):
def __init__(self, parent = None):
PanelIFACE.__init__(self, parent)
self.panel = VerticalPanel()
self.panel.setBorderWidth(1)
self.panel.setWidth("100%")
# prepare panel
self.prepareReduce = HTML("<tt> .. none yet .. </tt>", True, )
self.recipeList = ListBox()
self.recipeList.addChangeListener(getattr(self, "onRecipeSelected"))
self.recipeList.addItem("None")
HTTPRequest().asyncGet("recipes.xml",
RecipeListLoader(self))
#EO prepare panel
self.reduceCLPanel = DockPanel(Spacing = 5)
self.reduceCLPanel.add(HTML("<i>Reduce Command Line</i>:"), DockPanel.NORTH)
self.reduceCLPanel.add(self.prepareReduce, DockPanel.NORTH)
self.reduceFilesPanel = DockPanel(Spacing = 5)
self.reduceFilesPanel.add(HTML("<b>Datasets</b>:"), DockPanel.WEST)
self.reduceFiles = ListBox()
self.reduceFiles.setVisibleItemCount(5)
self.reduceFilesPanel.add(self.reduceFiles, DockPanel.WEST)
self.clearReduceFilesButton = Button("<b>Clear List</b>", listener = getattr(self, "onClearReduceFiles"))
self.reduceFilesPanel.add(self.clearReduceFilesButton, DockPanel.SOUTH)
self.recipeListPanel = DockPanel(Spacing = 5)
self.recipeListPanel.add(HTML("<b>Recipes List</b>:"),DockPanel.WEST)
self.recipeListPanel.add(self.recipeList, DockPanel.WEST)
self.runReduceButton = Button("<b>RUN REDUCE</b>", listener = getattr(self, "onRunReduce"))
self.adInfo = HTML("file info...")
# major sub panels
self.panel.add(self.reduceCLPanel)
self.panel.add(self.reduceFilesPanel)
self.panel.add(self.recipeListPanel)
self.panel.add(self.runReduceButton)
self.panel.add(self.adInfo)
def onRecipeSelected(self, event):
self.updateReduceCL()
def onClearReduceFiles(self, event):
self.reduceFiles.clear()
self.adInfo.setHTML("file info...")
self.updateReduceCL()
def updateReduceCL(self):
recipe = self.recipeList.getItemText(self.recipeList.getSelectedIndex())
if recipe=="None":
rstr = ""
else:
rstr = "-r "+recipe
rfiles = []
for i in range(0, self.reduceFiles.getItemCount()):
fname = self.reduceFiles.getItemText(i)
rfiles.append(fname)
filesstr = " ".join(rfiles)
self.prepareReduce.setHTML('<b>reduce</b> %(recipe)s %(files)s' %
{ "recipe":rstr,
"files":filesstr})
def onRunReduce(self):
recipe = self.recipeList.getItemText(self.recipeList.getSelectedIndex())
if recipe=="None":
rstr = ""
else:
rstr = "p=-r"+recipe
rfiles = []
for i in range(0, self.reduceFiles.getItemCount()):
fname = self.reduceFiles.getItemText(i)
rfiles.append(quote(self.pathdict[fname]["path"]))
filesstr = "&p=".join(rfiles)
cl = "/runreduce?%s&p=%s" % (rstr, filesstr)
# @@TEST
# cl = "/recipes.xml"
if False:
msg = repr(self.parent)+repr(dir(self.parent))
JS("alert(msg)")
if hasattr(self.parent, "roFrame"):
self.parent.roFrame.setUrl(cl)
self.parent.tabPanel.selectTab(self.parent.tabIFACEdict["rogui"])
else:
JS("window.open(cl)")
def onTreeItemSelected(self, item):
pathdict = self.pathdict
tfile = item.getText()
#check if already in
#.........这里部分代码省略.........
示例8: Trees
# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setBorderWidth [as 别名]
class Trees(Sink):
pathdict = {}
reduceFiles = None
def __init__(self, parent = None):
Sink.__init__(self, parent)
self.reduceFiles = []
if True:
HTTPRequest().asyncGet("datadir.xml",
DirDictLoader(self),
)
dock = DockPanel(HorizontalAlignment=HasAlignment.ALIGN_LEFT,
Spacing=10,
Size=("100%","100%"))
self.dock = dock
self.fProto = []
self.fTree = Tree()
self.prPanel = VerticalPanel(Size=("50%", ""))
self.treePanel = HorizontalPanel(Size=("50%", "100%"))
self.treePanel.add(self.fTree)
dock.add(self.treePanel, DockPanel.WEST)
self.treePanel.setBorderWidth(1)
self.treePanel.setWidth("100%")
self.prPanel.setBorderWidth(1)
self.prPanel.setWidth("100%")
# prepare panel
self.prepareReduce = HTML("<tt> .. none yet .. </tt>", True, )
self.recipeList = ListBox()
self.recipeList.addChangeListener(getattr(self, "onRecipeSelected"))
self.recipeList.addItem("None")
HTTPRequest().asyncGet("recipes.xml",
RecipeListLoader(self))
#EO prepare panel
self.reduceCLPanel = DockPanel(Spacing = 5)
self.reduceCLPanel.add(HTML("<i>Reduce Command Line</i>:"), DockPanel.NORTH)
self.reduceCLPanel.add(self.prepareReduce, DockPanel.NORTH)
self.reduceFilesPanel = DockPanel(Spacing = 5)
self.reduceFilesPanel.add(HTML("<b>Datasets</b>:"), DockPanel.WEST)
self.reduceFiles = ListBox()
self.reduceFiles.setVisibleItemCount(5)
self.reduceFilesPanel.add(self.reduceFiles, DockPanel.WEST)
self.clearReduceFilesButton = Button("<b>Clear List</b>", listener = getattr(self, "onClearReduceFiles"))
self.reduceFilesPanel.add(self.clearReduceFilesButton, DockPanel.SOUTH)
self.recipeListPanel = DockPanel(Spacing = 5)
self.recipeListPanel.add(HTML("<b>Recipes List</b>:"),DockPanel.WEST)
self.recipeListPanel.add(self.recipeList, DockPanel.WEST)
self.runReduceButton = Button("<b>RUN REDUCE</b>", listener = getattr(self, "onRunReduce"))
self.adInfo = HTML("file info...")
# major sub panels
self.prPanel.add(self.reduceCLPanel)
self.prPanel.add(self.reduceFilesPanel)
self.prPanel.add(self.recipeListPanel)
self.prPanel.add(self.runReduceButton)
self.prPanel.add(self.adInfo)
dock.add(self.prPanel,DockPanel.EAST)
dock.setCellWidth(self.treePanel, "50%")
dock.setCellWidth(self.prPanel, "50%")
for i in range(len(self.fProto)):
self.createItem(self.fProto[i])
self.fTree.addItem(self.fProto[i].item)
self.fTree.addTreeListener(self)
self.initWidget(self.dock)
if False: #self.parent.filexml != None:
DirDictLoader(self).onCompletion(self.parent.filexml)
def onTreeItemSelected(self, item):
pathdict = self.pathdict
tfile = item.getText()
#check if already in
for i in range(0, self.reduceFiles.getItemCount()):
fname = self.reduceFiles.getItemText(i)
if fname == tfile:
return
self.reduceFiles.addItem(tfile)
self.updateReduceCL()
filename = tfile
if filename in pathdict:
if pathdict[filename]["filetype"] == "fileEntry":
HTTPRequest().asyncGet("adinfo?filename=%s" % self.pathdict[item.getText()]["path"],
ADInfoLoader(self),
)
else:
self.adInfo.setHTML("""
<b style="font-size:200%%">%s</b>""" % pathdict[filename]["filetype"])
#.........这里部分代码省略.........