|
|
|
@ -46,14 +46,12 @@ LCDMenuLib2::LCDMenuLib2(LCDMenuLib2_menu &p_r, const uint8_t p_rows, const uint |
|
|
|
|
rootMenu = &p_r; |
|
|
|
|
curMenu = rootMenu; |
|
|
|
|
|
|
|
|
|
window_rows = p_rows; |
|
|
|
|
window_rows = p_rows; |
|
|
|
|
// the cols variable is removed
|
|
|
|
|
|
|
|
|
|
callback_contentUpdate = contentUpdate; // callback update content
|
|
|
|
|
callback_contentClear = contentClear; // callback clear content
|
|
|
|
|
callback_menuControl = menuControl; // callback buttons
|
|
|
|
|
|
|
|
|
|
init();
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* ******************************************************************** */ |
|
|
|
@ -63,7 +61,7 @@ LCDMenuLib2::LCDMenuLib2(LCDMenuLib2_menu &p_r, const uint8_t p_rows, const uint |
|
|
|
|
/* ******************************************************************** */ |
|
|
|
|
|
|
|
|
|
/* ******************************************************************** */ |
|
|
|
|
void LCDMenuLib2::init() |
|
|
|
|
void LCDMenuLib2::init(uint8_t p_maxElements) |
|
|
|
|
/* ******************************************************************** */ |
|
|
|
|
{ |
|
|
|
|
// init some variables
|
|
|
|
@ -80,6 +78,8 @@ void LCDMenuLib2::init() |
|
|
|
|
menu_timer = 0; |
|
|
|
|
menu_default_time = 100000000; |
|
|
|
|
|
|
|
|
|
maxElements = p_maxElements; |
|
|
|
|
|
|
|
|
|
// reset all buttons
|
|
|
|
|
BT_resetAll(); |
|
|
|
|
|
|
|
|
@ -299,6 +299,9 @@ void LCDMenuLib2::loop_menu(void) |
|
|
|
|
// ============================================
|
|
|
|
|
if(bitRead(REG_special, _LCDML_REG_special_jumpTo_enabled)) |
|
|
|
|
{ |
|
|
|
|
// debug information
|
|
|
|
|
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpTo.. / LCDML.OTHER_setCursorTo... - is active")); |
|
|
|
|
|
|
|
|
|
MENU_enScroll(); |
|
|
|
|
|
|
|
|
|
bitClear(REG_special, _LCDML_REG_special_jumpTo_enabled);
|
|
|
|
@ -310,6 +313,9 @@ void LCDMenuLib2::loop_menu(void) |
|
|
|
|
// got to root
|
|
|
|
|
if(activMenu != NULL) |
|
|
|
|
{ |
|
|
|
|
// debug information
|
|
|
|
|
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpTo.. / LCDML.OTHER_setCursorTo... - close active function")); |
|
|
|
|
|
|
|
|
|
// this function called be recursive (only once)
|
|
|
|
|
// set this bit to call the FUNC_close function when the goRoot function is called
|
|
|
|
|
bitSet(REG_MenuFunction, _LCDML_REG_MenuFunction_end);
|
|
|
|
@ -332,16 +338,22 @@ void LCDMenuLib2::loop_menu(void) |
|
|
|
|
bitClear(REG_MenuFunction, _LCDML_REG_MenuFunction_setup); |
|
|
|
|
|
|
|
|
|
bitClear(REG_special, _LCDML_REG_special_disable_screensaver);
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
// do nothing
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// reset the old parameter from the closed function / this parameter is set when a new jumpTo.. function is called
|
|
|
|
|
jT_paramOld = 0; |
|
|
|
|
|
|
|
|
|
// set the menu to root
|
|
|
|
|
MENU_goRoot(); |
|
|
|
|
|
|
|
|
|
// debug information
|
|
|
|
|
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpTo.. / LCDML.OTHER_setCursorTo... - searching element")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// search element
|
|
|
|
|
switch(jT_mode) |
|
|
|
|
{ |
|
|
|
@ -359,17 +371,60 @@ void LCDMenuLib2::loop_menu(void) |
|
|
|
|
// error
|
|
|
|
|
break; |
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//maxElements;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
|
|
New Search function
|
|
|
|
|
(only id based) |
|
|
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
//tmp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// check element handling
|
|
|
|
|
if(found == true) |
|
|
|
|
{
|
|
|
|
|
// debug information
|
|
|
|
|
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpTo.. / LCDML.OTHER_setCursorTo... - element found")); |
|
|
|
|
|
|
|
|
|
// get element to to open
|
|
|
|
|
tmp = curMenu->getChild(cursor_obj_pos);
|
|
|
|
|
|
|
|
|
|
// reset the search action to do some normal handlings
|
|
|
|
|
bitClear(REG_control, _LCDML_REG_control_search_display); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch(jT_mode) |
|
|
|
|
{ |
|
|
|
|
case 0: // jumpToFunc
|
|
|
|
@ -462,6 +517,8 @@ void LCDMenuLib2::loop_menu(void) |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
// do nothing
|
|
|
|
|
// debug information
|
|
|
|
|
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpTo.. / LCDML.OTHER_setCursorTo... - nothing found")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bitClear(REG_control, _LCDML_REG_control_search_display); |
|
|
|
@ -513,6 +570,9 @@ void LCDMenuLib2::loop_menu(void) |
|
|
|
|
|
|
|
|
|
activMenu = NULL; |
|
|
|
|
|
|
|
|
|
// reset the custom parameter
|
|
|
|
|
jT_param = 0;
|
|
|
|
|
|
|
|
|
|
bitClear(REG_MenuFunction, _LCDML_REG_MenuFunction_close_active); |
|
|
|
|
bitClear(REG_special, _LCDML_REG_special_disable_screensaver); |
|
|
|
|
bitClear(REG_MenuFunction, _LCDML_REG_MenuFunction_end); |
|
|
|
@ -1047,7 +1107,7 @@ void LCDMenuLib2::MENU_doScroll(uint8_t state) |
|
|
|
|
rollover = true;
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(bitRead(REG_control, _LCDML_REG_control_rollover) && rollover == true && child_cnt > window_rows) |
|
|
|
|
if(bitRead(REG_control, _LCDML_REG_control_rollover) && rollover == true) |
|
|
|
|
{ |
|
|
|
|
// rollover the menu
|
|
|
|
|
if((tmp = curMenu->getChild(0)) != NULL) |
|
|
|
@ -1135,7 +1195,7 @@ void LCDMenuLib2::MENU_doScroll(uint8_t state) |
|
|
|
|
rollover = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(bitRead(REG_control, _LCDML_REG_control_rollover) && rollover == true && child_cnt > window_rows) |
|
|
|
|
if(bitRead(REG_control, _LCDML_REG_control_rollover) && rollover == true) |
|
|
|
|
{ |
|
|
|
|
cursor_obj_pos = 0; |
|
|
|
|
cursor_pos_abs = 0; |
|
|
|
@ -1571,7 +1631,11 @@ void LCDMenuLib2::FUNC_call(void) |
|
|
|
|
|
|
|
|
|
if(activMenu != NULL) |
|
|
|
|
{ |
|
|
|
|
if(jT_param > 0) |
|
|
|
|
if(jT_paramOld > 0) |
|
|
|
|
{ |
|
|
|
|
activMenu->callback(jT_paramOld); |
|
|
|
|
} |
|
|
|
|
else if(jT_param > 0) |
|
|
|
|
{ |
|
|
|
|
activMenu->callback(jT_param); |
|
|
|
|
} |
|
|
|
@ -2125,56 +2189,133 @@ boolean LCDMenuLib2::OTHER_searchFunction(LCDMenuLib2_menu &p_m, uint8_t mod |
|
|
|
|
void LCDMenuLib2::OTHER_jumpToFunc(LCDML_FuncPtr_pu8 p_search, uint8_t p_para) |
|
|
|
|
/* ******************************************************************** */ |
|
|
|
|
{ |
|
|
|
|
// debug information
|
|
|
|
|
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpToFunc")); |
|
|
|
|
|
|
|
|
|
bitSet(REG_special, _LCDML_REG_special_jumpTo_enabled); |
|
|
|
|
jT_mode = 0; |
|
|
|
|
jT_id = 0; |
|
|
|
|
jT_param = p_para; |
|
|
|
|
jT_function = p_search; |
|
|
|
|
if(bitRead(REG_special, _LCDML_REG_special_jumpTo_enabled) == true) |
|
|
|
|
{ |
|
|
|
|
// debug information
|
|
|
|
|
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpToFunc - is still activ")); |
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{ |
|
|
|
|
// debug information
|
|
|
|
|
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpToFunc - start")); |
|
|
|
|
|
|
|
|
|
// enable jump to Func
|
|
|
|
|
bitSet(REG_special, _LCDML_REG_special_jumpTo_enabled); |
|
|
|
|
jT_mode = 0; |
|
|
|
|
jT_id = 0; |
|
|
|
|
|
|
|
|
|
if(activMenu != NULL) |
|
|
|
|
{ |
|
|
|
|
jT_paramOld = jT_param; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
jT_paramOld = 0; |
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
jT_param = p_para; |
|
|
|
|
jT_function = p_search; |
|
|
|
|
}
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* ******************************************************************** */ |
|
|
|
|
void LCDMenuLib2::OTHER_jumpToID(uint8_t p_id, uint8_t p_para) |
|
|
|
|
/* ******************************************************************** */ |
|
|
|
|
{ |
|
|
|
|
// debug information
|
|
|
|
|
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpToID")); |
|
|
|
|
if(bitRead(REG_special, _LCDML_REG_special_jumpTo_enabled) == true) |
|
|
|
|
{ |
|
|
|
|
// debug information
|
|
|
|
|
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpToID - is still activ")); |
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{ |
|
|
|
|
// debug information
|
|
|
|
|
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpToID - start")); |
|
|
|
|
|
|
|
|
|
bitSet(REG_special, _LCDML_REG_special_jumpTo_enabled); |
|
|
|
|
jT_mode = 1; |
|
|
|
|
jT_id = p_id; |
|
|
|
|
jT_param = p_para; |
|
|
|
|
jT_function = NULL; |
|
|
|
|
// enable jump to ID
|
|
|
|
|
bitSet(REG_special, _LCDML_REG_special_jumpTo_enabled); |
|
|
|
|
jT_mode = 1; |
|
|
|
|
jT_id = p_id; |
|
|
|
|
|
|
|
|
|
if(activMenu != NULL) |
|
|
|
|
{ |
|
|
|
|
jT_paramOld = jT_param; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
jT_paramOld = 0; |
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
jT_param = p_para; |
|
|
|
|
jT_function = NULL; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* ******************************************************************** */ |
|
|
|
|
void LCDMenuLib2::OTHER_setCursorToFunc(LCDML_FuncPtr_pu8 p_search) |
|
|
|
|
/* ******************************************************************** */ |
|
|
|
|
{ |
|
|
|
|
// debug information
|
|
|
|
|
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_setCursorToFunc")); |
|
|
|
|
if(bitRead(REG_special, _LCDML_REG_special_jumpTo_enabled) == true) |
|
|
|
|
{ |
|
|
|
|
// debug information
|
|
|
|
|
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_setCursorToFunc - is still activ")); |
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{ |
|
|
|
|
// debug information
|
|
|
|
|
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_setCursorToFunc - start")); |
|
|
|
|
|
|
|
|
|
// enable jump to Func
|
|
|
|
|
bitSet(REG_special, _LCDML_REG_special_jumpTo_enabled); |
|
|
|
|
jT_mode = 2; |
|
|
|
|
jT_id = 0; |
|
|
|
|
|
|
|
|
|
bitSet(REG_special, _LCDML_REG_special_jumpTo_enabled); |
|
|
|
|
jT_mode = 2; |
|
|
|
|
jT_id = 0; |
|
|
|
|
jT_param = 0; |
|
|
|
|
jT_function = p_search; |
|
|
|
|
if(activMenu != NULL) |
|
|
|
|
{ |
|
|
|
|
jT_paramOld = jT_param; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
jT_paramOld = 0; |
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
jT_param = 0; |
|
|
|
|
jT_function = p_search; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* ******************************************************************** */ |
|
|
|
|
void LCDMenuLib2::OTHER_setCursorToID(uint8_t p_id) |
|
|
|
|
/* ******************************************************************** */ |
|
|
|
|
{ |
|
|
|
|
// debug information
|
|
|
|
|
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_setCursorToID")); |
|
|
|
|
if(bitRead(REG_special, _LCDML_REG_special_jumpTo_enabled) == true) |
|
|
|
|
{ |
|
|
|
|
// debug information
|
|
|
|
|
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_setCursorToID - is still activ")); |
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{ |
|
|
|
|
// debug information
|
|
|
|
|
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_setCursorToID - start")); |
|
|
|
|
|
|
|
|
|
bitSet(REG_special, _LCDML_REG_special_jumpTo_enabled); |
|
|
|
|
jT_mode = 3; |
|
|
|
|
jT_id = p_id; |
|
|
|
|
jT_param = 0; |
|
|
|
|
jT_function = NULL;
|
|
|
|
|
// enable jump to Func
|
|
|
|
|
bitSet(REG_special, _LCDML_REG_special_jumpTo_enabled); |
|
|
|
|
jT_mode = 3; |
|
|
|
|
jT_id = p_id; |
|
|
|
|
|
|
|
|
|
if(activMenu != NULL) |
|
|
|
|
{ |
|
|
|
|
jT_paramOld = jT_param; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
jT_paramOld = 0; |
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
jT_param = 0; |
|
|
|
|
jT_function = NULL;
|
|
|
|
|
}
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|