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


Python VerticalPanel.setCellHorizontalAlignment方法代码示例

本文整理汇总了Python中pyjamas.ui.VerticalPanel.VerticalPanel.setCellHorizontalAlignment方法的典型用法代码示例。如果您正苦于以下问题:Python VerticalPanel.setCellHorizontalAlignment方法的具体用法?Python VerticalPanel.setCellHorizontalAlignment怎么用?Python VerticalPanel.setCellHorizontalAlignment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyjamas.ui.VerticalPanel.VerticalPanel的用法示例。


在下文中一共展示了VerticalPanel.setCellHorizontalAlignment方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setCellHorizontalAlignment [as 别名]
    def __init__(self):
        SimplePanel.__init__(self)

        panel = VerticalPanel(BorderWidth=1,
                              HorizontalAlignment=HasAlignment.ALIGN_CENTER,
                              VerticalAlignment=HasAlignment.ALIGN_MIDDLE,
                              Width="50%",
                              Height="300px")

        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)

        self.add(panel)
开发者ID:Afey,项目名称:pyjs,代码行数:29,代码来源:verticalPanel.py

示例2: __init__

# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setCellHorizontalAlignment [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)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:32,代码来源:verticalPanel.py

示例3: DayFilterWidget

# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setCellHorizontalAlignment [as 别名]
class DayFilterWidget(Composite):

    def __init__(self, calendar):
        Composite.__init__(self)
    
        self.calendar = calendar
        self.dayCheckBoxListener = DayCheckBoxListener(calendar)
        self.outer = VerticalPanel()
        self.initWidget(self.outer)
        self.setStyleName("DynaTable-DayFilterWidget")
        self.outer.add(DayCheckBox(self, "Sunday", 0))
        self.outer.add(DayCheckBox(self, "Monday", 1))
        self.outer.add(DayCheckBox(self, "Tuesday", 2))
        self.outer.add(DayCheckBox(self, "Wednesday", 3))
        self.outer.add(DayCheckBox(self, "Thursday", 4))
        self.outer.add(DayCheckBox(self, "Friday", 5))
        self.outer.add(DayCheckBox(self, "Saturday", 6))

        self.buttonAll = Button("All", self)
        self.buttonNone = Button("None", self)

        hp = HorizontalPanel()
        hp.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
        hp.add(self.buttonAll)
        hp.add(self.buttonNone)
        
        self.outer.add(hp)
        self.outer.setCellVerticalAlignment(hp, HasAlignment.ALIGN_BOTTOM)
        self.outer.setCellHorizontalAlignment(hp, HasAlignment.ALIGN_CENTER)
        
    def setAllCheckBoxes(self, checked):
        for widget in self.outer:
            if hasattr(widget, "setChecked"):
                widget.setChecked(checked)
                self.dayCheckBoxListener.onClick(widget)
    
    def onClick(self, sender):
        if self.buttonAll == sender:
            self.setAllCheckBoxes(True)
        elif self.buttonNone == sender:
            self.setAllCheckBoxes(False)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:43,代码来源:DayFilterWidget.py

示例4: __init__

# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setCellHorizontalAlignment [as 别名]
	def __init__( self ) :
		self.cbcList=ListBox(MultipleSelect=True, VisibleItemCount=4)
		self.channelList=ListBox(MultipleSelect=True, VisibleItemCount=20)
		self.updateButton=Button("Update")

		controls=VerticalPanel()
		controls.add(self.updateButton)
		controls.add(self.cbcList)
		controls.add(self.channelList)

		controls.setCellHorizontalAlignment( self.updateButton, HasHorizontalAlignment.ALIGN_CENTER )
		self.cbcList.setWidth("95%")
		self.channelList.setWidth("95%")

		self.cbcList.addItem( "waiting..." )
		for index in range(0,254) :
			self.channelList.addItem( "Channel %3d"%index )

		self.histogram = Image()
		self.mainPanel = HorizontalPanel()
		self.mainPanel.add( controls )
		self.mainPanel.add( self.histogram )
		self.histogram.setUrl( "defaultScurveHistogram.png" )
开发者ID:BristolHEP-CBC-Testing,项目名称:cbcanalysis,代码行数:25,代码来源:DisplayHistogramsPanel.py

示例5: ParamGroup

# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setCellHorizontalAlignment [as 别名]
class ParamGroup(object):
    def __init__(self, container, kind, parent=None, level=0, draw=True, title=None):
        self.container = container
        self.kind = kind
        self.parent = parent
        self.level = level
        self.title = title
        self.panel = SimplePanel(StyleName='aur-search-advanced-group')
        if level % 2 == 0: self.panel.addStyleName('aur-search-advanced-group-nested')
        self.childPanel = VerticalPanel(StyleName='aur-search-advanced-group-list', Width='100%')
        self.paramPanel = VerticalPanel(StyleName='aur-search-advanced-param-list', Width='100%')
        self.listPanel = VerticalPanel(StyleName='aur-search-advanced-list-boundary', Width='100%', Visible=False)
        self.paramChooser = ListBox()
        self.children = []
        self.parameters = []
        self.isInverted = False
        self.operator = 'and'
        # assigned by parent, visual use only
        self.op = None if parent else Label('and')
        if draw: self.draw()

    def draw(self):
        cont = VerticalPanel(Width='100%')
        header = HorizontalPanel(Width='100%', VerticalAlignment='middle', StyleName='aur-search-advanced-group-header')
        params = self.paramChooser
        addParam = Image(url='/ico/tick.png', Title='Add parameter to this group')
        addGroup = Image(url='/ico/table_add.png', Title='Nest group within this group')
        addGroupFull = Image(url='/ico/table_lightning.png', Title='Nest group within this group; all parameters')
        invertSelf = Image(url='/ico/exclamation.png', Title='Invert this parameter group')
        self.container.add(self.panel)
        self.panel.setWidget(cont)
        cont.add(header)
        if self.parent:
            d = Image(url='/ico/cross.png', Title='Delete this parameter group')
            d.addStyleName('aur-search-advanced-delete')
            header.add(d)
            header.setCellWidth(d, '1px')
            d.addClickListener(getattr(self, 'delSelf'))
        if self.title:
            t = Label(self.title, StyleName='aur-search-advanced-group-header-title')
            header.add(t)
            header.setCellWidth(t, '1px')
        header.add(params)
        header.add(addParam)
        header.add(addGroup)
        header.add(addGroupFull)
        header.add(invertSelf)
        header.setCellWidth(params, '1px')
        header.setCellWidth(addGroup, '1px')
        header.setCellWidth(addGroupFull, '1px')
        header.setCellWidth(invertSelf, '1px')
        for x in self.kind:
            params.addItem(x['item'], x['index'])
        cont.add(self.listPanel)
        self.listPanel.add(self.paramPanel)
        self.listPanel.add(self.childPanel)
        addParam.addClickListener(getattr(self, 'addParam'))
        addGroup.addClickListener(getattr(self, 'addGroup'))
        addGroupFull.addClickListener(getattr(self, 'addGroupFull'))
        invertSelf.addClickListener(getattr(self, 'invertSelf'))

    def addGroup(self, sender):
        self.listPanel.setVisible(True)
        op = Label(self.operator, Title='Invert group operator', StyleName='aur-search-advanced-group-op', Visible=False)
        op.addClickListener(getattr(self, 'invertOperator'))
        if len(self.children) > 0 or len(self.parameters) > 0: op.setVisible(True)
        self.childPanel.add(op)
        self.childPanel.setCellHorizontalAlignment(op, 'right')
        g = ParamGroup(self.childPanel, self.kind, self, self.level+1)
        g.op = op
        self.children.append(g)

    def addGroupFull(self, sender):
        # this is a little hacky, but it's so fast you don't see it
        self.addGroup(None)
        group = self.children[len(self.children)-1]
        for x in range(group.paramChooser.getItemCount()):
            group.paramChooser.setSelectedIndex(x)
            group.addParam(None)
        group.paramChooser.setSelectedIndex(0)

    def addParam(self, sender):
        self.listPanel.setVisible(True)
        op = Label(self.operator, Title='Invert group operator', StyleName='aur-search-advanced-param-op', Visible=False)
        op.addClickListener(getattr(self, 'invertOperator'))
        if len(self.parameters) > 0: op.setVisible(True)
        self.paramPanel.add(op)
        self.paramPanel.setCellHorizontalAlignment(op, 'right')
        k = self.kind[self.paramChooser.getSelectedValues()[0]]
        p = Param(self.paramPanel, k, self)
        p.op = op
        self.parameters.append(p)
        if len(self.children) > 0:
            self.children[0].op.setVisible(True)

    def addParamFull(self, sender):
        # this is a little hacky, but it's so fast you don't see it
        old = self.paramChooser.getSelectedIndex()
        for x in range(self.paramChooser.getItemCount()):
            self.paramChooser.setSelectedIndex(x)
#.........这里部分代码省略.........
开发者ID:anthonyrisinger,项目名称:aur-pyjs,代码行数:103,代码来源:Search.py


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