Пример #1
0
    def __init__(self, label = "", contents = [], expand = False, spacing = 0, expanded = False, **kwargs):
        VBox.__init__(self, expand=expand, spacing=spacing, **kwargs)
        self.expanded = expanded
        self._caption = self.caption_class(label, x_align=0, expanded = self.expanded, expand=False)
        self.connect_child(self._caption, "on-click", self.on_caption_mouse_down)

        self.container = ScrollArea(scroll_vertical=False, scroll_horizontal=False, visible=False, border=0)
        self.add_child(self._caption, self.container)
        self.add_child(*contents)
Пример #2
0
    def __init__(self, pages = [], spacing = 0, animation_duration = None,
                 easing_function = Easing.Quad.ease_out, **kwargs):
        VBox.__init__(self, spacing=spacing, **kwargs)

        #: currently selected page
        self.current_page = None

        self.reclick_to_close = True

        #: duration of the sliding animation. Defaults to scene's settings.
        #: Set 0 to disable
        self.animation_duration = animation_duration

        #: Tweening method to use for the animation
        self.easing_function = easing_function

        if pages:
            self.add_child(*pages)
Пример #3
0
    def __init__(self,
                 rows=[],
                 renderers=None,
                 headers=None,
                 select_on_drag=False,
                 spacing=0,
                 scroll_border=1,
                 row_height=None,
                 fixed_headers=None,
                 **kwargs):
        VBox.__init__(self, **kwargs)

        self.list_view = self.class_list_view(rows=rows)
        self.list_view.connect("on-render", self._on_list_render)

        for event in ("on-select", "on-change", "on-mouse-down", "on-mouse-up",
                      "on-click"):
            self.list_view.connect(event, self._forward_event, event)

        if renderers is not None:
            self.renderers = renderers
        self.select_on_drag = select_on_drag
        self.spacing = spacing
        self.row_height = row_height

        self.header_container = self.class_headers_container()
        self.headers = headers

        if fixed_headers is not None:
            self.fixed_headers = fixed_headers

        self.scrollbox = self.class_scroll_area(border=scroll_border)

        if self.fixed_headers:
            self.scrollbox.add_child(self.list_view)
            self.add_child(self.header_container, self.scrollbox)
        else:
            self.scrollbox.add_child(
                VBox([self.header_container, self.list_view], spacing=0))
            self.add_child(self.scrollbox)
Пример #4
0
    def __init__(
        self,
        rows=[],
        renderers=None,
        headers=None,
        select_on_drag=False,
        spacing=0,
        scroll_border=1,
        row_height=None,
        fixed_headers=None,
        **kwargs
    ):
        VBox.__init__(self, **kwargs)

        self.list_view = self.class_list_view(rows=rows)
        self.list_view.connect("on-render", self._on_list_render)

        for event in ("on-select", "on-change", "on-mouse-down", "on-mouse-up", "on-click"):
            self.list_view.connect(event, self._forward_event, event)

        if renderers is not None:
            self.renderers = renderers
        self.select_on_drag = select_on_drag
        self.spacing = spacing
        self.row_height = row_height

        self.header_container = self.class_headers_container()
        self.headers = headers

        if fixed_headers is not None:
            self.fixed_headers = fixed_headers

        self.scrollbox = self.class_scroll_area(border=scroll_border)

        if self.fixed_headers:
            self.scrollbox.add_child(self.list_view)
            self.add_child(self.header_container, self.scrollbox)
        else:
            self.scrollbox.add_child(VBox([self.header_container, self.list_view], spacing=0))
            self.add_child(self.scrollbox)
Пример #5
0
    def __init__(self,
                 pages=[],
                 spacing=0,
                 animation_duration=None,
                 easing_function=Easing.Quad.ease_out,
                 **kwargs):
        VBox.__init__(self, spacing=spacing, **kwargs)

        #: currently selected page
        self.current_page = None

        self.reclick_to_close = True

        #: duration of the sliding animation. Defaults to scene's settings.
        #: Set 0 to disable
        self.animation_duration = animation_duration

        #: Tweening method to use for the animation
        self.easing_function = easing_function

        if pages:
            self.add_child(*pages)
Пример #6
0
    def __init__(self,
                 label="",
                 contents=[],
                 expand=False,
                 spacing=0,
                 expanded=False,
                 **kwargs):
        VBox.__init__(self, expand=expand, spacing=spacing, **kwargs)
        self.expanded = expanded
        self._caption = self.caption_class(label,
                                           x_align=0,
                                           expanded=self.expanded,
                                           expand=False)
        self.connect_child(self._caption, "on-click",
                           self.on_caption_mouse_down)

        self.container = ScrollArea(scroll_vertical=False,
                                    scroll_horizontal=False,
                                    visible=False,
                                    border=0)
        self.add_child(self._caption, self.container)
        self.add_child(*contents)
Пример #7
0
 def __init__(self, contents=None, spacing = 0, **kwargs):
     VBox.__init__(self, contents=contents, spacing=spacing, **kwargs)
Пример #8
0
 def __init__(self, contents=None, spacing=0, **kwargs):
     VBox.__init__(self, contents=contents, spacing=spacing, **kwargs)