| 
															
																@@ -184,11 +184,20 @@ static void menu_draw_item_puts_P(char type_char, const char* str) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     lcd_printf_P(PSTR("%c%-18.18S%c"), menu_selection_mark(), str, type_char); 
															 | 
															
															 | 
															
																     lcd_printf_P(PSTR("%c%-18.18S%c"), menu_selection_mark(), str, type_char); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 } 
															 | 
															
															 | 
															
																 } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-static void menu_draw_toggle_puts_P(const char* str, const char* toggle, const bool fromProgmem) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-{ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-	menu_draw_item_puts_P((toggle == NULL)?LCD_STR_ARROW_RIGHT[0]:LCD_STR_REFRESH[0], str); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-	lcd_set_cursor(LCD_WIDTH - 3 - (fromProgmem?(strlen_P((toggle == NULL)?_T(MSG_NA):toggle)):(strlen(toggle))), menu_row); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-	lcd_printf_P(fromProgmem?PSTR("[%S]"):PSTR("[%s]"), (toggle == NULL)?_T(MSG_NA):toggle); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+static void menu_draw_toggle_puts_P(const char* str, char* toggle, const uint8_t settings) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+{ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    //settings: 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    //xxxxxcba 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    //a = selection mark. If it's set(1), then '>' will be used as the first character on the line. Else leave blank 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    //b = toggle string is from progmem 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    //c = do not set cursor at all. Must be handled externally. 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    char lineStr[LCD_WIDTH + 1]; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    const char eol = (toggle == NULL)?LCD_STR_ARROW_RIGHT[0]:' '; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    if (toggle == NULL) toggle = _T(MSG_NA); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    sprintf_P(lineStr, PSTR("%c%-18.18S"), (settings & 0x01)?'>':' ', str); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    sprintf_P(lineStr + LCD_WIDTH - ((settings & 0x02)?strlen_P(toggle):strlen(toggle)) - 3, (settings & 0x02)?PSTR("[%S]%c"):PSTR("[%s]%c"), toggle, eol); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    if (!(settings & 0x04)) lcd_set_cursor(0, menu_row); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    fputs(lineStr, lcdout); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 } 
															 | 
															
															 | 
															
																 } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																 //! @brief Format sheet name 
															 | 
															
															 | 
															
																 //! @brief Format sheet name 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -382,11 +391,11 @@ uint8_t menu_item_function_P(const char* str, char number, void (*func)(uint8_t) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     return 0; 
															 | 
															
															 | 
															
																     return 0; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 } 
															 | 
															
															 | 
															
																 } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-uint8_t menu_item_toggle_P(const char* str, const char* toggle, menu_func_t func, const bool fromProgmem) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+uint8_t menu_item_toggle_P(const char* str, const char* toggle, menu_func_t func, const uint8_t settings) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 { 
															 | 
															
															 | 
															
																 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 	if (menu_item == menu_line) 
															 | 
															
															 | 
															
																 	if (menu_item == menu_line) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 	{ 
															 | 
															
															 | 
															
																 	{ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-		if (lcd_draw_update) menu_draw_toggle_puts_P(str, toggle, fromProgmem); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+		if (lcd_draw_update) menu_draw_toggle_puts_P(str, toggle, settings | (menu_selection_mark()=='>')); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 		if (menu_clicked && (lcd_encoder == menu_item)) 
															 | 
															
															 | 
															
																 		if (menu_clicked && (lcd_encoder == menu_item)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 		{ 
															 | 
															
															 | 
															
																 		{ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 			if (toggle == NULL) // print N/A warning message 
															 | 
															
															 | 
															
																 			if (toggle == NULL) // print N/A warning message 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -424,17 +433,12 @@ uint8_t menu_item_gcode_P(const char* str, const char* str_gcode) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 	return 0; 
															 | 
															
															 | 
															
																 	return 0; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 } 
															 | 
															
															 | 
															
																 } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																- 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-const char menu_20x_space[] PROGMEM = "                    "; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																- 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 const char menu_fmt_int3[] PROGMEM = "%c%.15S:%s%3d"; 
															 | 
															
															 | 
															
																 const char menu_fmt_int3[] PROGMEM = "%c%.15S:%s%3d"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																 const char menu_fmt_float31[] PROGMEM = "%-12.12S%+8.1f"; 
															 | 
															
															 | 
															
																 const char menu_fmt_float31[] PROGMEM = "%-12.12S%+8.1f"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																 const char menu_fmt_float13[] PROGMEM = "%c%-13.13S%+5.3f"; 
															 | 
															
															 | 
															
																 const char menu_fmt_float13[] PROGMEM = "%c%-13.13S%+5.3f"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-const char menu_fmt_float13off[] PROGMEM = "%c%-13.13S%6.6s"; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																- 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 template<typename T> 
															 | 
															
															 | 
															
																 template<typename T> 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 static void menu_draw_P(char chr, const char* str, int16_t val); 
															 | 
															
															 | 
															
																 static void menu_draw_P(char chr, const char* str, int16_t val); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -443,8 +447,8 @@ void menu_draw_P<int16_t*>(char chr, const char* str, int16_t val) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 { 
															 | 
															
															 | 
															
																 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 	int text_len = strlen_P(str); 
															 | 
															
															 | 
															
																 	int text_len = strlen_P(str); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 	if (text_len > 15) text_len = 15; 
															 | 
															
															 | 
															
																 	if (text_len > 15) text_len = 15; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-	char spaces[21]; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-	strcpy_P(spaces, menu_20x_space); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+	char spaces[LCD_WIDTH + 1] = {0}; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    memset(spaces,' ', LCD_WIDTH); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 	if (val <= -100) spaces[15 - text_len - 1] = 0; 
															 | 
															
															 | 
															
																 	if (val <= -100) spaces[15 - text_len - 1] = 0; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 	else spaces[15 - text_len] = 0; 
															 | 
															
															 | 
															
																 	else spaces[15 - text_len] = 0; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 	lcd_printf_P(menu_fmt_int3, chr, str, spaces, val); 
															 | 
															
															 | 
															
																 	lcd_printf_P(menu_fmt_int3, chr, str, spaces, val); 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -457,8 +461,7 @@ void menu_draw_P<uint8_t*>(char chr, const char* str, int16_t val) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     float factor = 1.0f + static_cast<float>(val) / 1000.0f; 
															 | 
															
															 | 
															
																     float factor = 1.0f + static_cast<float>(val) / 1000.0f; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     if (val <= _md->minEditValue) 
															 | 
															
															 | 
															
																     if (val <= _md->minEditValue) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     { 
															 | 
															
															 | 
															
																     { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-        // lcd_printf_P(menu_fmt_float13off, chr, str, " [off]"); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-        menu_draw_toggle_puts_P(str, _T(MSG_OFF), true); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        menu_draw_toggle_puts_P(str, _T(MSG_OFF), 0x04 | 0x02 | (chr=='>')); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     } 
															 | 
															
															 | 
															
																     } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     else 
															 | 
															
															 | 
															
																     else 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     { 
															 | 
															
															 | 
															
																     { 
															 |