|
|
@ -303,6 +303,10 @@ void lcd_kill_screen() {
|
|
|
|
|
|
|
|
|
|
|
|
static void lcd_implementation_clear() { } // Automatically cleared by Picture Loop
|
|
|
|
static void lcd_implementation_clear() { } // Automatically cleared by Picture Loop
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// Status Screen
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
FORCE_INLINE void _draw_centered_temp(int temp, int x, int y) {
|
|
|
|
FORCE_INLINE void _draw_centered_temp(int temp, int x, int y) {
|
|
|
|
int degsize = 6 * (temp >= 100 ? 3 : temp >= 10 ? 2 : 1); // number's pixel width
|
|
|
|
int degsize = 6 * (temp >= 100 ? 3 : temp >= 10 ? 2 : 1); // number's pixel width
|
|
|
|
u8g.setPrintPos(x - (18 - degsize) / 2, y); // move left if shorter
|
|
|
|
u8g.setPrintPos(x - (18 - degsize) / 2, y); // move left if shorter
|
|
|
@ -473,6 +477,9 @@ static void lcd_implementation_status_screen() {
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(ULTIPANEL)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Set the colors for a menu item based on whether it is selected
|
|
|
|
static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) {
|
|
|
|
static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) {
|
|
|
|
if (isSelected) {
|
|
|
|
if (isSelected) {
|
|
|
|
u8g.setColorIndex(1); // black on white
|
|
|
|
u8g.setColorIndex(1); // black on white
|
|
|
@ -487,6 +494,7 @@ static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) {
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(LCD_INFO_MENU) || ENABLED(FILAMENT_CHANGE_FEATURE)
|
|
|
|
#if ENABLED(LCD_INFO_MENU) || ENABLED(FILAMENT_CHANGE_FEATURE)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Draw a static line of text in the same idiom as a menu item
|
|
|
|
static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, bool center=true, bool invert=false, const char* valstr=NULL) {
|
|
|
|
static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, bool center=true, bool invert=false, const char* valstr=NULL) {
|
|
|
|
|
|
|
|
|
|
|
|
lcd_implementation_mark_as_selected(row, invert);
|
|
|
|
lcd_implementation_mark_as_selected(row, invert);
|
|
|
@ -511,6 +519,7 @@ static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) {
|
|
|
|
|
|
|
|
|
|
|
|
#endif // LCD_INFO_MENU || FILAMENT_CHANGE_FEATURE
|
|
|
|
#endif // LCD_INFO_MENU || FILAMENT_CHANGE_FEATURE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Draw a generic menu item
|
|
|
|
static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, const char* pstr, char pre_char, char post_char) {
|
|
|
|
static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, const char* pstr, char pre_char, char post_char) {
|
|
|
|
UNUSED(pre_char);
|
|
|
|
UNUSED(pre_char);
|
|
|
|
|
|
|
|
|
|
|
@ -529,6 +538,13 @@ static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, co
|
|
|
|
lcd_print(' ');
|
|
|
|
lcd_print(' ');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Macros for specific types of menu items
|
|
|
|
|
|
|
|
#define lcd_implementation_drawmenu_back(sel, row, pstr) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0])
|
|
|
|
|
|
|
|
#define lcd_implementation_drawmenu_submenu(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0])
|
|
|
|
|
|
|
|
#define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
|
|
|
|
|
|
|
|
#define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Draw a menu item with an editable value
|
|
|
|
static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const char* pstr, const char* data, bool pgm) {
|
|
|
|
static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const char* pstr, const char* data, bool pgm) {
|
|
|
|
char c;
|
|
|
|
char c;
|
|
|
|
uint8_t vallen = (pgm ? lcd_strlen_P(data) : (lcd_strlen((char*)data)));
|
|
|
|
uint8_t vallen = (pgm ? lcd_strlen_P(data) : (lcd_strlen((char*)data)));
|
|
|
@ -546,6 +562,7 @@ static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const c
|
|
|
|
if (pgm) lcd_printPGM(data); else lcd_print((char*)data);
|
|
|
|
if (pgm) lcd_printPGM(data); else lcd_print((char*)data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Macros for edit items
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, data) _drawmenu_setting_edit_generic(sel, row, pstr, data, false)
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, data) _drawmenu_setting_edit_generic(sel, row, pstr, data, false)
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, data) _drawmenu_setting_edit_generic(sel, row, pstr, data, true)
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, data) _drawmenu_setting_edit_generic(sel, row, pstr, data, true)
|
|
|
|
|
|
|
|
|
|
|
@ -559,7 +576,6 @@ static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const c
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_long5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data)))
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_long5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data)))
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_bool(sel, row, pstr, pstr2, data) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_bool(sel, row, pstr, pstr2, data) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
|
|
|
|
|
|
|
|
|
|
|
|
//Add version for callback functions
|
|
|
|
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_callback_int3(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, itostr3(*(data)))
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_callback_int3(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, itostr3(*(data)))
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_callback_float3(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr3(*(data)))
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_callback_float3(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr3(*(data)))
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_callback_float32(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr32(*(data)))
|
|
|
|
#define lcd_implementation_drawmenu_setting_edit_callback_float32(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr32(*(data)))
|
|
|
@ -628,9 +644,6 @@ void lcd_implementation_drawedit(const char* pstr, const char* value=NULL) {
|
|
|
|
|
|
|
|
|
|
|
|
#endif // SDSUPPORT
|
|
|
|
#endif // SDSUPPORT
|
|
|
|
|
|
|
|
|
|
|
|
#define lcd_implementation_drawmenu_back(sel, row, pstr) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0])
|
|
|
|
#endif // ULTIPANEL
|
|
|
|
#define lcd_implementation_drawmenu_submenu(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0])
|
|
|
|
|
|
|
|
#define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
|
|
|
|
|
|
|
|
#define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif //__ULTRALCD_IMPL_DOGM_H
|
|
|
|
#endif //__ULTRALCD_IMPL_DOGM_H
|
|
|
|