Skip to content

Body

morphui.uix.dataview.body

MorphDataViewBodyLabel(**kwargs)

Bases: BaseDataViewLabel

A label widget designed for use as a body cell in a data view.

This class extends the base data view label to provide specific styling and behavior for body cells.

header = ObjectProperty(None) class-attribute instance-attribute

Reference to the header associated with this body label.

This property holds a reference to the header component of the data view, allowing the body label to access header information if needed.

:attr:header is a :class:~kivy.properties.ObjectProperty and defaults to None.

index = ObjectProperty(None) class-attribute instance-attribute

Reference to the index associated with this body label.

This property holds a reference to the index component of the data view, allowing the body label to access index information if needed.

:attr:index is a :class:~kivy.properties.ObjectProperty and defaults to None.

default_config = dict(theme_color_bindings=(dict(normal_content_color='content_surface_color', normal_overlay_edge_color='outline_color')), typography_role='Label', typography_size='medium', typography_weight='Regular', halign='center', valign='center', shorten=True, padding=[dp(8), dp(4)], overlay_edge_width=(dp(0.5)), auto_size=(False, False), size_hint=(None, None), size=(MorphDataViewHeaderLabel.default_config.get('width', dp(120)), MorphDataViewIndexLabel.default_config.get('height', dp(30))), text_size=(MorphDataViewHeaderLabel.default_config.get('width', dp(120)) - dp(16), MorphDataViewIndexLabel.default_config.get('height', dp(30)) - dp(8)), visible_edges=['bottom']) class-attribute instance-attribute

Default configuration for the MorphDataViewBodyLabel.

refresh_view_attrs(rv, index, data)

Refresh the view attributes when the data changes.

This method is called by the RecycleView framework to update the view's attributes based on the provided data.

PARAMETER DESCRIPTION
rv

The RecycleView instance managing this view.

TYPE: RecycleView

index

The index of this view in the RecycleView data.

TYPE: int

data

The data dictionary for this view.

TYPE: Dict[str, Any]

MorphDataViewBodyLayout(**kwargs)

Bases: MorphRecycleGridLayout

A layout for arranging body cells in a data view.

This class extends the base data view layout and :class:MorphRecycleGridLayout to provide a grid layout suitable for body cells.

header = ObjectProperty(None) class-attribute instance-attribute

Reference to the header associated with this body label.

This property holds a reference to the header component of the data view, allowing the body label to access header information if needed.

:attr:header is a :class:~kivy.properties.ObjectProperty and defaults to None.

index = ObjectProperty(None) class-attribute instance-attribute

Reference to the index associated with this body label.

This property holds a reference to the index component of the data view, allowing the body label to access index information if needed.

:attr:index is a :class:~kivy.properties.ObjectProperty and defaults to None.

default_config = dict(theme_color_bindings={'normal_surface_color': 'surface_container_low_color'}, auto_size=(True, True)) class-attribute instance-attribute

Default configuration for the MorphDataViewBodyLayout.

MorphDataViewBody(**kwargs)

Bases: BaseDataView

A RecycleView designed to serve as the body of a data view.

This class extends the base data view to provide a body component suitable for displaying tabular data in a data view.

header = ObjectProperty(None) class-attribute instance-attribute

Reference to the header associated with this body label.

This property holds a reference to the header component of the data view, allowing the body label to access header information if needed.

:attr:header is a :class:~kivy.properties.ObjectProperty and defaults to None.

index = ObjectProperty(None) class-attribute instance-attribute

Reference to the index associated with this body label.

This property holds a reference to the index component of the data view, allowing the body label to access index information if needed.

:attr:index is a :class:~kivy.properties.ObjectProperty and defaults to None.

values = AliasProperty(_get_values, _set_values, bind=['data']) class-attribute instance-attribute

2D list of values displayed in the body.

This property allows getting and setting the values of the body cells in a tabular format. When set, it updates the body's data accordingly. The outer list represents rows, and each inner list represents the values in that row.

:attr:values is an :class:~kivy.properties.AliasProperty and is bound to changes in :attr:children.

default_config = dict(do_scroll_x=True, do_scroll_y=True, size_hint=(1, 1), bar_width=(dp(3))) class-attribute instance-attribute

Default configuration for the MorphDataViewBody.

on_header(instance, header)

Handle changes to the associated header data view.

This method is called whenever the header property is set and synchronizes the horizontal scrolling between the body and header.

on_index(instance, index)

Handle changes to the associated index data view.

This method is called whenever the index property is set and synchronizes the vertical scrolling between the body and index.

on_layout_manager(instance, layout_manager)

Handle changes to the associated layout.

This method is called whenever the layout_manager property is set and configures the layout to reference the associated header and index.

on_values_updated(*args)

Event handler called when the values in the body are updated.

This method is triggered whenever the values property is set and can be overridden to perform additional actions when the body data changes.