LISTBOX widget.
More...
|
| gui_handle_p | gui_listbox_create (gui_id_t id, float x, float y, float width, float height, gui_handle_p parent, gui_widget_evt_fn evt_fn, uint16_t flags) |
| | Create new listbox widget. More...
|
| |
| uint8_t | gui_listbox_setcolor (gui_handle_p h, gui_listbox_color_t index, gui_color_t color) |
| | Set color to listbox. More...
|
| |
| uint8_t | gui_listbox_addstring (gui_handle_p h, const gui_char *text) |
| | Add a new string to list box. More...
|
| |
| uint8_t | gui_listbox_deletefirststring (gui_handle_p h) |
| | Delete first string from list. More...
|
| |
| uint8_t | gui_listbox_deletelaststring (gui_handle_p h) |
| | Delete last string from list. More...
|
| |
| uint8_t | gui_listbox_deletestring (gui_handle_p h, int16_t index) |
| | Delete specific entry from list. More...
|
| |
| uint8_t | gui_listbox_setstring (gui_handle_p h, int16_t index, const gui_char *text) |
| | Set string value to already added string index. More...
|
| |
| uint8_t | gui_listbox_setselection (gui_handle_p h, int16_t selection) |
| | Set selected value. More...
|
| |
| int16_t | gui_listbox_getselection (gui_handle_p h) |
| | Get selected value. More...
|
| |
| uint8_t | gui_listbox_scroll (gui_handle_p h, int16_t step) |
| | Scroll list if possible. More...
|
| |
LISTBOX widget.
Listbox widget is simple widget to display single list of data. For detailed support of list displays, refer to List view widget
Listbox in passive (left) and active (focused, right image) modes
Example code of image above
◆ gui_listbox_color_t
List of listbox colors.
| Enumerator |
|---|
| GUI_LISTBOX_COLOR_BG | Background color
|
| GUI_LISTBOX_COLOR_TEXT | Text color index
|
| GUI_LISTBOX_COLOR_SEL_FOC | Text color of selected item when widget is in focus
|
| GUI_LISTBOX_COLOR_SEL_NOFOC | Text color of selected item when widget is not in focus
|
| GUI_LISTBOX_COLOR_SEL_FOC_BG | Background color of selected item when widget is in focus
|
| GUI_LISTBOX_COLOR_SEL_NOFOC_BG | Background color of selected item when widget is not in focus
|
◆ gui_listbox_addstring()
| uint8_t gui_listbox_addstring |
( |
gui_handle_p |
h, |
|
|
const gui_char * |
text |
|
) |
| |
Add a new string to list box.
- Parameters
-
| [in] | h | Widget handle |
| [in] | text | Pointer to text to add to list. Only pointer is saved to memory! |
- Returns
1 on success, 0 otherwise
◆ gui_listbox_create()
| gui_handle_p gui_listbox_create |
( |
gui_id_t |
id, |
|
|
float |
x, |
|
|
float |
y, |
|
|
float |
width, |
|
|
float |
height, |
|
|
gui_handle_p |
parent, |
|
|
gui_widget_evt_fn |
evt_fn, |
|
|
uint16_t |
flags |
|
) |
| |
Create new listbox widget.
- Parameters
-
| [in] | id | Widget unique ID to use for identity for callback processing |
| [in] | x | Widget X position relative to parent widget |
| [in] | y | Widget Y position relative to parent widget |
| [in] | width | Widget width in units of pixels |
| [in] | height | Widget height in units of pixels |
| [in] | parent | Parent widget handle. Set to NULL to use current active parent widget |
| [in] | evt_fn | Custom widget callback function. Set to NULL to use default callback |
| [in] | flags | flags for widget creation |
- Returns
- Widget handle on success,
NULL otherwise
◆ gui_listbox_deletefirststring()
| uint8_t gui_listbox_deletefirststring |
( |
gui_handle_p |
h | ) |
|
Delete first string from list.
- Parameters
-
- Returns
1 on success, 0 otherwise
◆ gui_listbox_deletelaststring()
| uint8_t gui_listbox_deletelaststring |
( |
gui_handle_p |
h | ) |
|
Delete last string from list.
- Parameters
-
- Returns
1 on success, 0 otherwise
◆ gui_listbox_deletestring()
| uint8_t gui_listbox_deletestring |
( |
gui_handle_p |
h, |
|
|
int16_t |
index |
|
) |
| |
Delete specific entry from list.
- Parameters
-
| [in] | h | Widget handle |
| [in] | index | List index (position) to delete |
- Returns
1 on success, 0 otherwise
◆ gui_listbox_getselection()
| int16_t gui_listbox_getselection |
( |
gui_handle_p |
h | ) |
|
Get selected value.
- Parameters
-
- Returns
- Selection on success,
-1 otherwise
◆ gui_listbox_scroll()
| uint8_t gui_listbox_scroll |
( |
gui_handle_p |
h, |
|
|
int16_t |
step |
|
) |
| |
Scroll list if possible.
- Parameters
-
| [in] | h | Widget handle |
| [in] | step | Step to scroll. Positive step will scroll up, negative will scroll down |
- Returns
1 on success, 0 otherwise
◆ gui_listbox_setcolor()
Set color to listbox.
- Parameters
-
| [in] | h | Widget handle |
| [in] | index | Color index |
| [in] | color | Color value |
- Returns
1 on success, 0 otherwise
◆ gui_listbox_setselection()
| uint8_t gui_listbox_setselection |
( |
gui_handle_p |
h, |
|
|
int16_t |
selection |
|
) |
| |
Set selected value.
- Parameters
-
| [in] | h | Widget handle |
| [in] | selection | Set to -1 to invalidate selection or 0 - count-1 for specific selection |
- Returns
1 on success, 0 otherwise
◆ gui_listbox_setstring()
| uint8_t gui_listbox_setstring |
( |
gui_handle_p |
h, |
|
|
int16_t |
index, |
|
|
const gui_char * |
text |
|
) |
| |
Set string value to already added string index.
- Parameters
-
| [in] | h | Widget handle |
| [in] | index | Index (position) on list to set/change text |
| [in] | text | Pointer to text to add to list. Only pointer is saved to memory! |
- Returns
1 on success, 0 otherwise