DMCP interface  03.15_020
Selection Screen Functions

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...
 

Detailed Description

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.

Macro Definition Documentation

◆ ISEL_EXIT

#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.

◆ ISEL_FILL_ITEMS

#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.

◆ ISEL_KEY_PRESSED

#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.

◆ ISEL_POST_DRAW

#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.

◆ ISEL_PRE_DRAW

#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.

Function Documentation

◆ item_sel_engine()

int item_sel_engine ( item_sel_state_t st,
int  upd 
)

Main item selection engine loop.

Parameters
stItem selection state
upd(0/1) 1 - force repaint

◆ item_sel_header()

void item_sel_header ( item_sel_state_t st,
int  update 
)

Display header for item selection dialog.

Parameters
stItem 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.

◆ item_sel_init()

void item_sel_init ( item_sel_state_t st)

Initializes item sel structure.

Parameters
stItem selection state

Fills selection state structure with zeros and sets defaults.

◆ item_sel_reinit()

void item_sel_reinit ( item_sel_state_t st)

Cleanup before items reload.

Parameters
stItem selection state

Sets item count to zero and jumps to first item.