DMCP interface
03.15_020
|
Selection dialog functions. More...
Data Structures | |
struct | item_sel_state |
Item selection state. More... | |
Macros | |
#define | ISEL_FILL_ITEMS -100 |
Requests reload of items. More... | |
#define | ISEL_KEY_PRESSED -101 |
Key pressed indicator. More... | |
#define | ISEL_EXIT -102 |
Dialog exit flag. More... | |
#define | ISEL_POST_DRAW -2 |
POST-draw phase flag. More... | |
#define | ISEL_PRE_DRAW -1 |
PRE-draw phase flag. More... | |
Typedefs | |
typedef uint16_t | list_item_t |
Type for item list item_sel_state::fis. | |
typedef void | isel_disp_line_fn_t(int lnr, list_item_t *fis, int cur_fnr, struct item_sel_state *st) |
Display line callback prototype. | |
typedef void | fis_name_fn_t(struct item_sel_state *st, list_item_t fis, char *nmbuf, int len) |
Callback function for getting list item name. | |
typedef struct item_sel_state | item_sel_state_t |
Item selection state. | |
Functions | |
void | item_sel_init (item_sel_state_t *st) |
Initializes item sel structure. More... | |
void | item_sel_reinit (item_sel_state_t *st) |
Cleanup before items reload. More... | |
int | item_sel_engine (item_sel_state_t *st, int upd) |
Main item selection engine loop. More... | |
void | item_sel_header (item_sel_state_t *st, int update) |
Display header for item selection dialog. More... | |
Selection dialog functions.
This set of functions gives access to selection screen engine interface. It allows to implement screen where items are listed and optionally sorted and controls allow to move up and down and select particular item.
Even if this is part of user interface it serves at this time mainly as core for file selection screen.
#define ISEL_EXIT -102 |
Dialog exit flag.
Return value from item_sel_engine(). User loop enclosing item_sel_engine() should detect this and terminate the loop.
#define ISEL_FILL_ITEMS -100 |
Requests reload of items.
Return value from item_sel_engine(). User loop enclosing item_sel_engine() should detect this value and fill items in item selection state item_sel_state.
#define ISEL_KEY_PRESSED -101 |
Key pressed indicator.
Return value from item_sel_engine(). User loop enclosing item_sel_engine() should detect this and handle key code stored in item_sel_state::key.
#define ISEL_POST_DRAW -2 |
POST-draw phase flag.
Indicates POST-draw phase for isel_disp_line_fn_t callback. It is called with this indicator after all lines are drawn and could serve for drawing overlays.
#define ISEL_PRE_DRAW -1 |
PRE-draw phase flag.
Indicates PRE-draw phase for isel_disp_line_fn_t callback. It is called with this indicator before any line is drawn and could serve for background drawing.
int item_sel_engine | ( | item_sel_state_t * | st, |
int | upd | ||
) |
Main item selection engine loop.
st | Item selection state |
upd | (0/1) 1 - force repaint |
void item_sel_header | ( | item_sel_state_t * | st, |
int | update | ||
) |
Display header for item selection dialog.
st | Item selection state |
update | (0/1) 1 - forces LCD refresh after header draw |
Displays header according to item_sel_state::title and item_sel_state::title2. Jumps to first available line on LCD.
Optionally forces LCD refresh.
void item_sel_init | ( | item_sel_state_t * | st | ) |
Initializes item sel structure.
st | Item selection state |
Fills selection state structure with zeros and sets defaults.
void item_sel_reinit | ( | item_sel_state_t * | st | ) |
Cleanup before items reload.
st | Item selection state |
Sets item count to zero and jumps to first item.