本文整理汇总了Python中pyjamas.ui.HorizontalPanel.HorizontalPanel.setCellHorizontalAlignment方法的典型用法代码示例。如果您正苦于以下问题:Python HorizontalPanel.setCellHorizontalAlignment方法的具体用法?Python HorizontalPanel.setCellHorizontalAlignment怎么用?Python HorizontalPanel.setCellHorizontalAlignment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.ui.HorizontalPanel.HorizontalPanel
的用法示例。
在下文中一共展示了HorizontalPanel.setCellHorizontalAlignment方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pyjamas.ui.HorizontalPanel import HorizontalPanel [as 别名]
# 或者: from pyjamas.ui.HorizontalPanel.HorizontalPanel import setCellHorizontalAlignment [as 别名]
def __init__( self ) :
numberOfLoopsPanel=HorizontalPanel()
numberOfLoopsPanel.add( HTML("Maximum number of loops") )
self.maximumNumberOfLoops=TextBox()
self.maximumNumberOfLoops.setText(10)
numberOfLoopsPanel.add( self.maximumNumberOfLoops )
numberOfLoopsPanel.setCellHorizontalAlignment( self.maximumNumberOfLoops, HasHorizontalAlignment.ALIGN_RIGHT )
numberOfLoopsPanel.setWidth("100%")
aimPointPanel=HorizontalPanel()
aimPointPanel.add( HTML("Aim point") )
self.aimPoint=TextBox()
self.aimPoint.setText(127)
aimPointPanel.add( self.aimPoint )
aimPointPanel.setCellHorizontalAlignment( self.aimPoint, HasHorizontalAlignment.ALIGN_RIGHT )
aimPointPanel.setWidth("100%")
self.start=Button("Start")
self.echo=HTML("Initiating...")
self.mainPanel = VerticalPanel()
self.mainPanel.add( numberOfLoopsPanel )
self.mainPanel.add( aimPointPanel )
self.mainPanel.add( self.start )
self.mainPanel.add( self.echo )
示例2: __init__
# 需要导入模块: from pyjamas.ui.HorizontalPanel import HorizontalPanel [as 别名]
# 或者: from pyjamas.ui.HorizontalPanel.HorizontalPanel import setCellHorizontalAlignment [as 别名]
def __init__(self, listener):
VerticalPanel.__init__(self, StyleName = "login")
self.listener = listener
self.remote = DataService(['login'])
form_panel = VerticalPanel(ID = "container", StyleName = "form")
self.error_message = Label(StyleName = "error-message")
grid = Grid(2, 2,
CellPadding=0,
CellSpacing=0,
StyleName = "form-grid")
grid.setWidget(0, 0, Label(JS('gettext("Username:")'),
StyleName = "label"))
self.tb = TextBox(Name="username")
grid.setWidget(0, 1, self.tb)
grid.setWidget(1, 0, Label(JS('gettext("Password:")'),
StyleName = "label"))
self.ptb = PasswordTextBox(Name="password")
grid.setWidget(1, 1, self.ptb)
form_panel.add(Label(JS('gettext("User Login")'), StyleName = "form-title"))
form_panel.add(self.error_message)
form_panel.add(grid)
button_box = HorizontalPanel(Width="100%")
register_button = PseudoLink(JS('gettext("Create an account")'),
self.onRegisterButtonClick)
submit_button = Button(JS('gettext("Login")'),
self.onSubmitButtonClick)
button_box.add(register_button)
button_box.add(submit_button)
button_box.setCellHorizontalAlignment(submit_button,
HasAlignment.ALIGN_RIGHT)
form_panel.add(button_box)
self.add(form_panel)
示例3: __init__
# 需要导入模块: from pyjamas.ui.HorizontalPanel import HorizontalPanel [as 别名]
# 或者: from pyjamas.ui.HorizontalPanel.HorizontalPanel import setCellHorizontalAlignment [as 别名]
def __init__(self, listener):
VerticalPanel.__init__(self, StyleName = "register")
self.listener = listener
self.form_panel = VerticalPanel(ID = "container", StyleName = "form")
self.form_panel.add(Label(JS('gettext("Create an account")')))
button_box = HorizontalPanel(Width="100%")
submit_button = Button(JS('gettext("Create the account")'), self.onSubmitButtonClick)
cancel_button = PseudoLink(JS('gettext("Cancel")'), self.onCancelButtonClick)
button_box.add(cancel_button)
button_box.add(submit_button)
button_box.setCellHorizontalAlignment(submit_button,
HasAlignment.ALIGN_RIGHT)
self.form_panel.add(button_box)
self.add(self.form_panel)
示例4: createRegisterPanel
# 需要导入模块: from pyjamas.ui.HorizontalPanel import HorizontalPanel [as 别名]
# 或者: from pyjamas.ui.HorizontalPanel.HorizontalPanel import setCellHorizontalAlignment [as 别名]
def createRegisterPanel( self, registerNames ) :
"""
Creates panels and buttons for everything given in registerNames, and returns the main panel.
"""
flowPanel=FlowPanel()
for buttonName in registerNames :
newPanel=HorizontalPanel()
label=Label(buttonName)
newPanel.add( label )
newTextBox=TextBox()
newTextBox.setEnabled(False)
newTextBox.setWidth(80)
statusBox=TextBox()
statusBox.setEnabled(False)
statusBox.setWidth(30)
newPanel.add(newTextBox)
newPanel.add(statusBox)
newPanel.setCellHorizontalAlignment( newTextBox, HasHorizontalAlignment.ALIGN_RIGHT )
newPanel.setCellHorizontalAlignment( statusBox, HasHorizontalAlignment.ALIGN_RIGHT )
newPanel.setCellWidth( statusBox, "20px" )
newPanel.setWidth("100%")
#newPanel.setStyleName("areaStyle");
#newPanel.setBorderWidth(5);
newTextBox.setText("select chip...")
newTextBox.addChangeListener(self)
newTextBox.setTitle(buttonName) # This isn't displayed, but it's useful to have stored
self.i2cValueEntries[buttonName]=newTextBox
self.statusValueEntries[buttonName]=statusBox
statusBox.setTitle(buttonName)
statusBox.setText("...")
flowPanel.add(newPanel)
return flowPanel
示例5: onModuleLoad
# 需要导入模块: from pyjamas.ui.HorizontalPanel import HorizontalPanel [as 别名]
# 或者: from pyjamas.ui.HorizontalPanel.HorizontalPanel import setCellHorizontalAlignment [as 别名]
def onModuleLoad(self):
# Window.setTitle("CBC Test Stand")
StyleSheetCssFile("styleSheet.css")
self.TEXT_WAITING = "Waiting for response..."
self.TEXT_ERROR = "Server Error"
self.status = Label()
# This is the remote service
self.I2CPanel = I2CPanel()
self.SCurveRunPanel = SCurveRunPanel()
self.OccupancyCheckPanel = OccupancyCheckPanel()
self.CalibrateChannelTrimsPanel = CalibrateChannelTrimsPanel()
# mainPanel will have all of the working stuff in it
self.mainPanel = DockPanel()
# self.mainPanel.setSpacing(10)
titleBar = HorizontalPanel()
titleBar.add(HTML(r"CBC Test Stand (v1.1)", StyleName="titleStyle"))
self.stopTakingDataButton = Button("Stop taking data")
self.stopTakingDataButton.addClickListener(self)
self.dataTakingPercentage = HTML("0%")
self.dataTakingStatus = HTML("Initiating...")
titleBar.add(self.dataTakingPercentage)
titleBar.add(self.dataTakingStatus)
titleBar.add(self.stopTakingDataButton)
titleBar.setCellHorizontalAlignment(self.dataTakingStatus, HasHorizontalAlignment.ALIGN_RIGHT)
titleBar.setCellHorizontalAlignment(self.dataTakingPercentage, HasHorizontalAlignment.ALIGN_RIGHT)
titleBar.setCellHorizontalAlignment(self.stopTakingDataButton, HasHorizontalAlignment.ALIGN_RIGHT)
titleBar.setWidth("100%")
self.mainPanel.add(titleBar, DockPanel.NORTH)
selectionPanel = VerticalPanel()
# Register to get updates about the status of data taking, so that
# I can update the information in the title bar
self.dataRunManager = DataRunManager.instance()
self.dataRunManager.registerEventHandler(self)
self.activePanelButton = None
self.activePanel = None
self.registersButton = Label("I2C Registers", StyleName="areaStyle")
self.occupanciesButton = Label("Test Occupancies", StyleName="areaStyle")
self.scurveButton = Label("S-Curve Run", StyleName="areaStyle")
self.calibrateTrimsButton = Label("Calibrate Trims", StyleName="areaStyle")
self.registersButton.addClickListener(self)
self.occupanciesButton.addClickListener(self)
self.scurveButton.addClickListener(self)
self.calibrateTrimsButton.addClickListener(self)
selectionPanel.add(self.registersButton)
selectionPanel.add(self.occupanciesButton)
selectionPanel.add(self.scurveButton)
selectionPanel.add(self.calibrateTrimsButton)
self.mainPanel.add(selectionPanel, DockPanel.WEST)
self.mainPanel.add(self.status, DockPanel.SOUTH)
RootPanel().add(self.mainPanel)
self.setNewMainPanel(self.registersButton)