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


Python VerticalPanel.setCellVerticalAlignment方法代码示例

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


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

示例1: DayFilterWidget

# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setCellVerticalAlignment [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


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