当前位置: 首页>>代码示例>>Python>>正文


Python HorizontalPanel.setCellHorizontalAlignment方法代码示例

本文整理汇总了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 )
开发者ID:BristolHEP-CBC-Testing,项目名称:cbcanalysis,代码行数:28,代码来源:CalibrateChannelTrimsPanel.py

示例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)
开发者ID:fedenko,项目名称:clientbank,代码行数:48,代码来源:LoginPanel.py

示例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)
开发者ID:fedenko,项目名称:clientbank,代码行数:24,代码来源:RegisterPanel.py

示例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
开发者ID:BristolHEP-CBC-Testing,项目名称:cbcanalysis,代码行数:40,代码来源:I2CPanel.py

示例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)
开发者ID:BristolHEP-CBC-Testing,项目名称:cbcanalysis,代码行数:65,代码来源:index.py


注:本文中的pyjamas.ui.HorizontalPanel.HorizontalPanel.setCellHorizontalAlignment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。