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