======= Layouts ======= .. py:currentmodule:: p3dsdk.ui .. py:class:: Layout Base class of all layouts. .. py:property:: margin The margin of the layout. :type: int .. py:property:: spacing The spacing of the layout. :type: int .. py:class:: GridLayout(parent = None, rows = 1, columns = 1, spacing = -1) Base class: :py:class:`Layout` The GridLayout class lays out widgets in a grid. :param parent: The parent :py:class:`Widget`. :type parent: Widget :param rows: The number of rows of the grid. :type rows: int :param columns: The number of columns of the grid. :type columns: int :param spacing: The spacing of the layout. :type spacing: int .. py:property:: column_count The number of columns in the grid. :type: int, read-only .. py:property:: row_count The number of rows in the grid. :type: int, read-only .. py:method:: add_layout(item, row, column) Adds a layout to the layout in the specified row and column. :param item: The layout that will be added to the grid. :type item: Layout :param row: The row where the layout will be added. :type row: int :param column: The column where the layout will be added. :type column: int .. py:method:: add_widget(item, row, column) Adds a widget to the layout in the specified row and column. :param item: The widget that will be added to the grid. :type item: Widget :param row: The row where the layout will be added. :type row: int :param column: The column where the layout will be added. :type column: int .. py:class:: HBox(parent = None, spacing = 0, margin = 0) Base class: :py:class:`Layout` The HBox class lines up widgets horizontally. :param parent: The parent :py:class:`Widget`. :type parent: Widget :param spacing: The spacing of the layout. :type spacing: int :param margin: The space between the border of the layout and the widgets inside. :type margin: int .. py:method:: add_layout(item, stretch = 0) Adds another layout to the box. :param item: The layout that will be added to the box. :type item: Layout :param stretch: How the layout will react when the box is resized. :type stretch: int .. py:method:: add_widget(item, stretch = 0, alignment = Position.CENTER) Adds a widget to the layout. :param item: The widget that will be added to the box. :type item: Widget :param stretch: How the layout will react when the box is resized. :type stretch: int :param alignment: The alignment of the widget. :type alignment: Position .. py:method:: insert_spacing(index, size) Adds a widget to the layout. :param index: The index in the box where the space will be inserted. :type index: int :param size: The amount of spacing to add. :type size: int .. py:class:: VBox(parent = None, spacing = 0, margin = 0) Base class: :py:class:`Layout` The VBox class lines up widgets vertically. :param parent: The parent :py:class:`Widget`. :type parent: Widget :param spacing: The spacing of the layout. :type spacing: int :param margin: The space between the border of the layout and the widgets inside. :type margin: int .. py:method:: add_layout(item, stretch = 0) Adds another layout to the box. :param item: The layout that will be added to the box. :type item: Layout :param stretch: How the layout will react when the box is resized. :type stretch: int .. py:method:: add_widget(item, stretch = 0, alignment = Position.CENTER) Adds a widget to the layout. :param item: The widget that will be added to the box. :type item: Widget :param stretch: How the layout will react when the box is resized. :type stretch: int :param alignment: The alignment of the widget. :type alignment: Position .. py:method:: insert_spacing(index, size) Adds a widget to the layout. :param index: The index in the box where the space will be inserted. :type index: int :param size: The amount of spacing to add. :type size: int