Dialog Control Module


Enumerations

enum  lcdgraph_dialog_state_e { DIALOG_FOCUS, DIALOG_EDIT }
 Current state of dialog. More...
enum  lcdgraph_dialog_event_e {
  DIALOG_EVENT_NONE, DIALOG_KEY_NEXT, DIALOG_KEY_PREV, DIALOG_KEY_ENTER,
  DIALOG_KEY_ESC
}
 Key code. More...

Functions

lcdgraph_result_e LCDGRAPH_DIALOG_DrawItem (rom_type lcdgraph_control_t *control, lcdgraph_dialog_control_state_e state)
 Draw single item.
lcdgraph_result_e LCDGRAPH_DIALOG_Create (void)
 Draw dialog box.
lcdgraph_result_e LCDGRAPH_DIALOG_RegisterEvent (lcdgraph_dialog_event_e event)
 Register event.
lcdgraph_result_e LCDGRAPH_DIALOG_GetStatus (lcdgraph_dialog_state_e *state)
 Get status.
lcdgraph_result_e LCDGRAPH_DIALOG_GetFocus (unsigned char *current_focus, rom_type lcdgraph_control_t **control)
 Get currently focused item.
lcdgraph_result_e LCDGRAPH_DIALOG_Init (rom_type lcdgraph_dialog_t *dialog_ptr)
 Initialize Dialog Module.

Enumeration Type Documentation

enum lcdgraph_dialog_event_e

Key code.

Code of the pressed key passed to dialog facility. It is treated as single event and will be processed accordingly

Note:
The list of events may be and should be extended in future
Enumerator:
DIALOG_EVENT_NONE  No action required
DIALOG_KEY_NEXT  User pressed 'next' key
DIALOG_KEY_PREV  User pressed 'prev' key
DIALOG_KEY_ENTER  User pressed 'enter' key
DIALOG_KEY_ESC  User pressed 'esc' key

enum lcdgraph_dialog_state_e

Current state of dialog.

Represents the current dialog box's state

Enumerator:
DIALOG_FOCUS  One of elements is currently focused
DIALOG_EDIT  One of elements is in edit mode


Function Documentation

lcdgraph_result_e LCDGRAPH_DIALOG_Create ( void   ) 

Draw dialog box.

Author:
Mariusz Murawski
Draw entire dialog box, all items and set focus to the first focusable item

Return values:
LCDGRAPH_OK if all is ok
LCDGRAPH_MEMORY_FAIL if dialog box is not initialized. See LCDGRAPH_DIALOG_Init

lcdgraph_result_e LCDGRAPH_DIALOG_DrawItem ( rom_type lcdgraph_control_t *  control,
lcdgraph_dialog_control_state_e  state 
)

Draw single item.

Author:
Mariusz Murawski
Draw single item

Parameters:
[in] control pointer to control item to be drawed
[in] state state of drawed control item
Return values:
LCDGRAPH_OK if all is ok
LCDGRAPH_PARAM_FAIL if pointer to control item is NULL or given state is unknown

lcdgraph_result_e LCDGRAPH_DIALOG_GetFocus ( unsigned char *  current_focus,
rom_type lcdgraph_control_t **  control 
)

Get currently focused item.

Author:
Mariusz Murawski
Get index of currently focused item and a pointer to focused control

Parameters:
[out] current_focus Pointer to variable to hold index if currently focused item. Pass NULL if out of interest
[out] control Pointer to pointer to variable to hold currently focused control's pointer. Pass NULL if out of interest
Return values:
LCDGRAPH_OK if all is ok

lcdgraph_result_e LCDGRAPH_DIALOG_GetStatus ( lcdgraph_dialog_state_e state  ) 

Get status.

Author:
Mariusz Murawski
Get current status of dialog machine state

Parameters:
[out] state Pointer to variable to hold current status
Return values:
LCDGRAPH_OK if all is ok
LCDGRAPH_PARAM_FAIL if parameter state is NULL

lcdgraph_result_e LCDGRAPH_DIALOG_Init ( rom_type lcdgraph_dialog_t *  dialog_ptr  ) 

Initialize Dialog Module.

Author:
Mariusz Murawski
Initialize dialog module

Parameters:
[in] dialog_ptr pointer to struct holding all dialog data
Return values:
LCDGRAPH_OK if all is ok
LCDGRAPH_PARAM_FAIL if either dialog_ptr or any of its significant member is NULL

lcdgraph_result_e LCDGRAPH_DIALOG_RegisterEvent ( lcdgraph_dialog_event_e  event  ) 

Register event.

Author:
Mariusz Murawski
Register event such as a 'key pressed'. Function performs action right for a key

Parameters:
event type of event to handle
Return values:
LCDGRAPH_OK if all is ok
LCDGRAPH_PARAM_FAIL if parameter event is incorrect

SourceForge.net Logo