예제 #1
0
파일: frame.py 프로젝트: swindy/sy-game
    def __init__(self, content=None, is_expandable=False, anchor=ANCHOR_CENTER, offset=(0, 0)):
        """
        Creates a new Wrapper around an included Widget.

        @param content The Widget to be wrapped.
        """
        Widget.__init__(self)
        self.content = content
        self.expandable = is_expandable
        self.anchor = anchor
        self.content_offset = offset
예제 #2
0
    def __init__(self,
                 content=None,
                 is_expandable=False,
                 anchor=ANCHOR_CENTER,
                 offset=(0, 0)):
        """
        Creates a new Wrapper around an included Widget.

        @param content The Widget to be wrapped.
        """
        Widget.__init__(self)
        self.content = content
        self.expandable = is_expandable
        self.anchor = anchor
        self.content_offset = offset
예제 #3
0
    def __init__(self, content=[], align=HALIGN_CENTER, padding=5):
        """
        Creates a new VerticalLayout.

        @param content A list of Widgets to be arranged
        @param align HALIGN_LEFT if Widgets are to be left-justified,
                     HALIGN_CENTER if they should be centered, and
                     HALIGN_RIGHT if they are to be right-justified.
        @param padding This amount of padding is inserted between widgets.
        """
        assert isinstance(content, list) or isinstance(content, tuple)
        Widget.__init__(self)
        self.align = align
        self.padding = padding
        self.content = [x or Spacer() for x in content]
        self.expandable = []
예제 #4
0
    def __init__(self, content=[], align=HALIGN_CENTER, padding=5):
        """
        Creates a new VerticalLayout.

        @param content A list of Widgets to be arranged
        @param align HALIGN_LEFT if Widgets are to be left-justified,
                     HALIGN_CENTER if they should be centered, and
                     HALIGN_RIGHT if they are to be right-justified.
        @param padding This amount of padding is inserted between widgets.
        """
        assert isinstance(content, list) or isinstance(content, tuple)
        Widget.__init__(self)
        self.align = align
        self.padding = padding
        self.content = [x or Spacer() for x in content]
        self.expandable = []
예제 #5
0
    def __init__(self, content=[[]], anchor=ANCHOR_TOP_LEFT, padding=5,
                 offset=(0, 0)):
        """
        Defines a new GridLayout.

        @param content A list of rows, each of which is a list of cells
                       within that row.  'None' may be used for empty cells,
                       and rows do not need to all be the same length.
        @param anchor Alignment of
        """
        assert ((isinstance(content, list) or isinstance(content, tuple)) and
                (len(content) == 0 or (isinstance(content[0], list) or
                                       isinstance(content[0], tuple))))
        Widget.__init__(self)
        self.content = content
        self.anchor = anchor
        self.padding = padding
        self.offset = offset
        self.max_heights = []
        self.max_widths = []
예제 #6
0
    def __init__(self,
                 content=[[]],
                 anchor=ANCHOR_TOP_LEFT,
                 padding=5,
                 offset=(0, 0)):
        """
        Defines a new GridLayout.

        @param content A list of rows, each of which is a list of cells
                       within that row.  'None' may be used for empty cells,
                       and rows do not need to all be the same length.
        @param anchor Alignment of
        """
        assert (
            (isinstance(content, list) or isinstance(content, tuple)) and
            (len(content) == 0 or
             (isinstance(content[0], list) or isinstance(content[0], tuple))))
        Widget.__init__(self)
        self.content = content
        self.anchor = anchor
        self.padding = padding
        self.offset = offset
        self.max_heights = []
        self.max_widths = []