本文整理汇总了Python中pyjamas.ui.VerticalPanel.setCellHorizontalAlignment方法的典型用法代码示例。如果您正苦于以下问题:Python VerticalPanel.setCellHorizontalAlignment方法的具体用法?Python VerticalPanel.setCellHorizontalAlignment怎么用?Python VerticalPanel.setCellHorizontalAlignment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.ui.VerticalPanel
的用法示例。
在下文中一共展示了VerticalPanel.setCellHorizontalAlignment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DayFilterWidget
# 需要导入模块: from pyjamas.ui import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.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)