20 #include "os_helpers.h"
24 void ux_menulist_refresh(
unsigned int stack_slot);
26 unsigned int ux_menulist_button(
unsigned int button_mask,
unsigned int button_mask_counter)
28 UNUSED(button_mask_counter);
30 switch (button_mask) {
32 if (
G_ux.menulist_getter(
G_ux.menulist_current - 1UL)) {
33 G_ux.menulist_current--;
34 ux_menulist_refresh(
G_ux.stack_count - 1);
38 if (
G_ux.menulist_getter(
G_ux.menulist_current + 1UL)) {
39 G_ux.menulist_current++;
40 ux_menulist_refresh(
G_ux.stack_count - 1);
44 G_ux.menulist_selector(
G_ux.menulist_current);
50 void ux_menulist_refresh(
unsigned int stack_slot)
54 for (i = 0; i < 5; i++) {
55 G_ux.menulist_params.lines[i] =
G_ux.menulist_getter(
G_ux.menulist_current + i - 2);
58 ux_layout_nnbnn_init(stack_slot);
60 G_ux.stack[stack_slot].button_push_callback = ux_menulist_button;
64 = {ux_menulist_refresh, &
G_ux.menulist_params, NULL, NULL};
65 UX_FLOW(ux_menulist_constflow, &ux_menulist_conststep);
67 void ux_menulist_init_select(
unsigned int stack_slot,
68 list_item_value_t getter,
69 list_item_select_t selector,
70 unsigned int selected_item_idx)
72 G_ux.menulist_current = selected_item_idx;
73 G_ux.menulist_getter = getter;
74 G_ux.menulist_selector = selector;
82 ux_menulist_refresh(stack_slot);
87 void ux_menulist_init(
unsigned int stack_slot,
88 list_item_value_t getter,
89 list_item_select_t selector)
91 ux_menulist_init_select(stack_slot, getter, selector, 0);
#define BUTTON_EVT_RELEASED
void ux_flow_init(unsigned int stack_slot, const ux_flow_step_t *const *steps, const ux_flow_step_t *const start_step)
const void * ux_stack_get_step_params(unsigned int stack_slot)
#define UX_FLOW(flow_name,...)