class documentation

A simple list class for a GUI.

Method __del__ Destructor to clean up resources
Method __init__ Initialize the list with drawing context and styling.
Method add_item Add an item to the list.
Method clear Clear the list.
Method draw Draw the list.
Method get_item Get an item from the list.
Method item_exists Check if an item exists in the list.
Method remove_item Remove an item from the list and update the display.
Method scroll_down Scroll the list down by one item.
Method scroll_up Scroll the list up by one item.
Method set_selected Set the selected item in the list.
Instance Variable background_color Undocumented
Instance Variable border_color Undocumented
Instance Variable border_width Undocumented
Instance Variable box_height Undocumented
Instance Variable box_width Undocumented
Instance Variable box_x Undocumented
Instance Variable display Undocumented
Instance Variable dot_size Undocumented
Instance Variable height Undocumented
Instance Variable is_circular Undocumented
Instance Variable item_height Undocumented
Instance Variable items Undocumented
Instance Variable menu_y Undocumented
Instance Variable position Undocumented
Instance Variable rec_vec_pos Undocumented
Instance Variable rec_vec_size Undocumented
Instance Variable selected_color Undocumented
Instance Variable size Undocumented
Instance Variable size_x Undocumented
Instance Variable text_color Undocumented
Instance Variable text_vec_pos Undocumented
Instance Variable use_lvgl Undocumented
Instance Variable visible_item_count Undocumented
Instance Variable y Undocumented
Property current_item Get the currently selected item.
Property item_count Get the number of items in the list.
Property list_height Get the height of the list.
Property selected_index Get the selected index.
Instance Variable _dec_v Undocumented
Instance Variable _dec_v_b Undocumented
Instance Variable _draw_count Undocumented
Instance Variable _five Undocumented
Instance Variable _lvgl_list Undocumented
Instance Variable _selected_index Undocumented
Instance Variable _sixteen Undocumented
Instance Variable _three Undocumented
def __del__(self):

Destructor to clean up resources

def __init__(self, draw, y: int, height: int, text_color: int = 65535, background_color: int = 0, selected_color: int = 31, border_color: int = 65535, border_width: int = 2):

Initialize the list with drawing context and styling.

Parameters
draw:DrawThe drawing context to render the list.
y:intThe top Y position of the list.
height:intThe height of the list.
text_color:intThe text color. Defaults to 0xFFFF.
background_color:intThe background color. Defaults to 0x0000.
selected_color:intThe selected item color. Defaults to 0x001F.
border_color:intThe border color. Defaults to 0xFFFF.
border_width:intThe border width. Defaults to 2.
def add_item(self, item: str):

Add an item to the list.

Parameters
item:strThe item to add.
def clear(self, swap: bool = True):

Clear the list.

Parameters
swap:boolWhether to swap the display buffer. Defaults to True.
def draw(self, swap: bool = True):

Draw the list.

Parameters
swap:boolWhether to swap the display buffer. Defaults to True.
def get_item(self, index: int) -> str:

Get an item from the list.

Parameters
index:intThe index of the item.
Returns
strThe item string, or "" if not found.
def item_exists(self, item: str) -> bool:

Check if an item exists in the list.

Parameters
item:strThe item to look for.
Returns
boolTrue if the item exists.
def remove_item(self, index: int):

Remove an item from the list and update the display.

Parameters
index:intThe index of the item to remove.
def scroll_down(self, swap: bool = True):

Scroll the list down by one item.

Parameters
swap:boolWhether to swap the display buffer. Defaults to True.
def scroll_up(self, swap: bool = True):

Scroll the list up by one item.

Parameters
swap:boolWhether to swap the display buffer. Defaults to True.
def set_selected(self, index: int, swap: bool = True):

Set the selected item in the list.

Parameters
index:intThe index of the item to select.
swap:boolWhether to swap the display buffer. Defaults to True.
background_color =

Undocumented

border_color =

Undocumented

border_width =

Undocumented

box_height =

Undocumented

box_width =

Undocumented

box_x =

Undocumented

display =

Undocumented

dot_size =

Undocumented

height =

Undocumented

is_circular =

Undocumented

item_height =

Undocumented

items: list =

Undocumented

menu_y =

Undocumented

position =

Undocumented

rec_vec_pos =

Undocumented

rec_vec_size =

Undocumented

selected_color =

Undocumented

size =

Undocumented

size_x =

Undocumented

text_color =

Undocumented

text_vec_pos =

Undocumented

use_lvgl =

Undocumented

visible_item_count =

Undocumented

y =

Undocumented

@property
current_item: str =

Get the currently selected item.

@property
item_count: int =

Get the number of items in the list.

@property
list_height: int =

Get the height of the list.

@property
selected_index: int =

Get the selected index.

_dec_v =

Undocumented

_dec_v_b =

Undocumented

_draw_count =

Undocumented

_five =

Undocumented

_lvgl_list =

Undocumented

_selected_index =

Undocumented

_sixteen =

Undocumented

_three =

Undocumented