Пример #1
0
    def __init__(self, title, content=None, is_open=True, align=HALIGN_CENTER):
        Control.__init__(self)
        if align == HALIGN_LEFT:
            left_expand = False
            right_expand = True
        elif align == HALIGN_CENTER:
            left_expand = True
            right_expand = True
        else:  # HALIGN_RIGHT
            left_expand = True
            right_expand = False

        self.is_open = is_open
        self.folding_content = content
        self.book = Graphic(self._get_image_path())

        self.header = HorizontalLayout([
            Graphic(path=["section", "left"], is_expandable=left_expand),
            Frame(HorizontalLayout([
                self.book,
                Label(title, path=["section"]),
            ]),
                  path=["section", "center"],
                  use_bg_group=True),
            Graphic(path=["section", "right"], is_expandable=right_expand),
        ],
                                       align=VALIGN_BOTTOM,
                                       padding=0)
        layout = [self.header]
        if self.is_open:
            layout.append(content)

        VerticalLayout.__init__(self, content=layout, align=align)
Пример #2
0
 def __init__(self, title, content):
     VerticalLayout.__init__(
         self,
         content=[
             HorizontalLayout([
                 Graphic(path=["titlebar", "left"], is_expandable=True),
                 Frame(Label(title, path=["titlebar"]),
                       path=["titlebar", "center"]),
                 Graphic(path=["titlebar", "right"], is_expandable=True),
             ],
                              align=VALIGN_BOTTOM,
                              padding=0),
             Frame(content, path=["titlebar", "frame"], is_expandable=True),
         ],
         padding=0)
Пример #3
0
    def __init__(self, title, align=HALIGN_CENTER):
        if align == HALIGN_LEFT:
            left_expand = False
            right_expand = True
        elif align == HALIGN_CENTER:
            left_expand = True
            right_expand = True
        else:  # HALIGN_RIGHT
            left_expand = True
            right_expand = False

        HorizontalLayout.__init__(self,
                                  content=[
                                      Graphic(path=["section", "left"],
                                              is_expandable=left_expand),
                                      Frame(Label(title, path=["section"]),
                                            path=['section', 'center'],
                                            use_bg_group=True),
                                      Graphic(path=["section", "right"],
                                              is_expandable=right_expand),
                                  ],
                                  align=VALIGN_BOTTOM,
                                  padding=0)