|
@@ -303,6 +303,10 @@ void lcd_kill_screen() {
|
303
|
303
|
|
304
|
304
|
static void lcd_implementation_clear() { } // Automatically cleared by Picture Loop
|
305
|
305
|
|
|
306
|
+//
|
|
307
|
+// Status Screen
|
|
308
|
+//
|
|
309
|
+
|
306
|
310
|
FORCE_INLINE void _draw_centered_temp(int temp, int x, int y) {
|
307
|
311
|
int degsize = 6 * (temp >= 100 ? 3 : temp >= 10 ? 2 : 1); // number's pixel width
|
308
|
312
|
u8g.setPrintPos(x - (18 - degsize) / 2, y); // move left if shorter
|
|
@@ -473,164 +477,173 @@ static void lcd_implementation_status_screen() {
|
473
|
477
|
#endif
|
474
|
478
|
}
|
475
|
479
|
|
476
|
|
-static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) {
|
477
|
|
- if (isSelected) {
|
478
|
|
- u8g.setColorIndex(1); // black on white
|
479
|
|
- u8g.drawBox(0, row * (DOG_CHAR_HEIGHT) + 3 - (TALL_FONT_CORRECTION), LCD_PIXEL_WIDTH, DOG_CHAR_HEIGHT);
|
480
|
|
- u8g.setColorIndex(0); // following text must be white on black
|
481
|
|
- }
|
482
|
|
- else {
|
483
|
|
- u8g.setColorIndex(1); // unmarked text is black on white
|
|
480
|
+#if ENABLED(ULTIPANEL)
|
|
481
|
+
|
|
482
|
+ // Set the colors for a menu item based on whether it is selected
|
|
483
|
+ static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) {
|
|
484
|
+ if (isSelected) {
|
|
485
|
+ u8g.setColorIndex(1); // black on white
|
|
486
|
+ u8g.drawBox(0, row * (DOG_CHAR_HEIGHT) + 3 - (TALL_FONT_CORRECTION), LCD_PIXEL_WIDTH, DOG_CHAR_HEIGHT);
|
|
487
|
+ u8g.setColorIndex(0); // following text must be white on black
|
|
488
|
+ }
|
|
489
|
+ else {
|
|
490
|
+ u8g.setColorIndex(1); // unmarked text is black on white
|
|
491
|
+ }
|
|
492
|
+ u8g.setPrintPos((START_COL) * (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT));
|
484
|
493
|
}
|
485
|
|
- u8g.setPrintPos((START_COL) * (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT));
|
486
|
|
-}
|
487
|
494
|
|
488
|
|
-#if ENABLED(LCD_INFO_MENU) || ENABLED(FILAMENT_CHANGE_FEATURE)
|
|
495
|
+ #if ENABLED(LCD_INFO_MENU) || ENABLED(FILAMENT_CHANGE_FEATURE)
|
489
|
496
|
|
490
|
|
- static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, bool center=true, bool invert=false, const char* valstr=NULL) {
|
|
497
|
+ // Draw a static line of text in the same idiom as a menu item
|
|
498
|
+ static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, bool center=true, bool invert=false, const char* valstr=NULL) {
|
491
|
499
|
|
492
|
|
- lcd_implementation_mark_as_selected(row, invert);
|
|
500
|
+ lcd_implementation_mark_as_selected(row, invert);
|
493
|
501
|
|
494
|
|
- char c;
|
495
|
|
- int8_t n = LCD_WIDTH - (START_COL);
|
|
502
|
+ char c;
|
|
503
|
+ int8_t n = LCD_WIDTH - (START_COL);
|
496
|
504
|
|
497
|
|
- if (center && !valstr) {
|
498
|
|
- int8_t pad = (LCD_WIDTH - lcd_strlen_P(pstr)) / 2;
|
499
|
|
- while (--pad >= 0) { lcd_print(' '); n--; }
|
500
|
|
- }
|
501
|
|
- while (n > 0 && (c = pgm_read_byte(pstr))) {
|
502
|
|
- n -= lcd_print(c);
|
503
|
|
- pstr++;
|
504
|
|
- }
|
505
|
|
- if (valstr) while (n > 0 && (c = *valstr)) {
|
506
|
|
- n -= lcd_print(c);
|
507
|
|
- valstr++;
|
|
505
|
+ if (center && !valstr) {
|
|
506
|
+ int8_t pad = (LCD_WIDTH - lcd_strlen_P(pstr)) / 2;
|
|
507
|
+ while (--pad >= 0) { lcd_print(' '); n--; }
|
|
508
|
+ }
|
|
509
|
+ while (n > 0 && (c = pgm_read_byte(pstr))) {
|
|
510
|
+ n -= lcd_print(c);
|
|
511
|
+ pstr++;
|
|
512
|
+ }
|
|
513
|
+ if (valstr) while (n > 0 && (c = *valstr)) {
|
|
514
|
+ n -= lcd_print(c);
|
|
515
|
+ valstr++;
|
|
516
|
+ }
|
|
517
|
+ while (n-- > 0) lcd_print(' ');
|
508
|
518
|
}
|
509
|
|
- while (n-- > 0) lcd_print(' ');
|
510
|
|
- }
|
511
|
519
|
|
512
|
|
-#endif // LCD_INFO_MENU || FILAMENT_CHANGE_FEATURE
|
|
520
|
+ #endif // LCD_INFO_MENU || FILAMENT_CHANGE_FEATURE
|
513
|
521
|
|
514
|
|
-static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, const char* pstr, char pre_char, char post_char) {
|
515
|
|
- UNUSED(pre_char);
|
|
522
|
+ // Draw a generic menu item
|
|
523
|
+ static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, const char* pstr, char pre_char, char post_char) {
|
|
524
|
+ UNUSED(pre_char);
|
516
|
525
|
|
517
|
|
- char c;
|
518
|
|
- uint8_t n = LCD_WIDTH - (START_COL) - 2;
|
|
526
|
+ char c;
|
|
527
|
+ uint8_t n = LCD_WIDTH - (START_COL) - 2;
|
519
|
528
|
|
520
|
|
- lcd_implementation_mark_as_selected(row, isSelected);
|
|
529
|
+ lcd_implementation_mark_as_selected(row, isSelected);
|
521
|
530
|
|
522
|
|
- while (c = pgm_read_byte(pstr)) {
|
523
|
|
- n -= lcd_print(c);
|
524
|
|
- pstr++;
|
|
531
|
+ while (c = pgm_read_byte(pstr)) {
|
|
532
|
+ n -= lcd_print(c);
|
|
533
|
+ pstr++;
|
|
534
|
+ }
|
|
535
|
+ while (n--) lcd_print(' ');
|
|
536
|
+ u8g.setPrintPos(LCD_PIXEL_WIDTH - (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT));
|
|
537
|
+ lcd_print(post_char);
|
|
538
|
+ lcd_print(' ');
|
525
|
539
|
}
|
526
|
|
- while (n--) lcd_print(' ');
|
527
|
|
- u8g.setPrintPos(LCD_PIXEL_WIDTH - (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT));
|
528
|
|
- lcd_print(post_char);
|
529
|
|
- lcd_print(' ');
|
530
|
|
-}
|
531
|
540
|
|
532
|
|
-static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const char* pstr, const char* data, bool pgm) {
|
533
|
|
- char c;
|
534
|
|
- uint8_t vallen = (pgm ? lcd_strlen_P(data) : (lcd_strlen((char*)data)));
|
535
|
|
- uint8_t n = LCD_WIDTH - (START_COL) - 2 - vallen;
|
|
541
|
+ // Macros for specific types of menu items
|
|
542
|
+ #define lcd_implementation_drawmenu_back(sel, row, pstr) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0])
|
|
543
|
+ #define lcd_implementation_drawmenu_submenu(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0])
|
|
544
|
+ #define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
|
|
545
|
+ #define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
|
536
|
546
|
|
537
|
|
- lcd_implementation_mark_as_selected(row, isSelected);
|
|
547
|
+ // Draw a menu item with an editable value
|
|
548
|
+ static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const char* pstr, const char* data, bool pgm) {
|
|
549
|
+ char c;
|
|
550
|
+ uint8_t vallen = (pgm ? lcd_strlen_P(data) : (lcd_strlen((char*)data)));
|
|
551
|
+ uint8_t n = LCD_WIDTH - (START_COL) - 2 - vallen;
|
538
|
552
|
|
539
|
|
- while (c = pgm_read_byte(pstr)) {
|
540
|
|
- n -= lcd_print(c);
|
541
|
|
- pstr++;
|
542
|
|
- }
|
543
|
|
- lcd_print(':');
|
544
|
|
- while (n--) lcd_print(' ');
|
545
|
|
- u8g.setPrintPos(LCD_PIXEL_WIDTH - (DOG_CHAR_WIDTH) * vallen, (row + 1) * (DOG_CHAR_HEIGHT));
|
546
|
|
- if (pgm) lcd_printPGM(data); else lcd_print((char*)data);
|
547
|
|
-}
|
|
553
|
+ lcd_implementation_mark_as_selected(row, isSelected);
|
548
|
554
|
|
549
|
|
-#define lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, data) _drawmenu_setting_edit_generic(sel, row, pstr, data, false)
|
550
|
|
-#define lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, data) _drawmenu_setting_edit_generic(sel, row, pstr, data, true)
|
551
|
|
-
|
552
|
|
-#define lcd_implementation_drawmenu_setting_edit_int3(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, itostr3(*(data)))
|
553
|
|
-#define lcd_implementation_drawmenu_setting_edit_float3(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr3(*(data)))
|
554
|
|
-#define lcd_implementation_drawmenu_setting_edit_float32(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr32(*(data)))
|
555
|
|
-#define lcd_implementation_drawmenu_setting_edit_float43(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr43sign(*(data)))
|
556
|
|
-#define lcd_implementation_drawmenu_setting_edit_float5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data)))
|
557
|
|
-#define lcd_implementation_drawmenu_setting_edit_float52(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr52sign(*(data)))
|
558
|
|
-#define lcd_implementation_drawmenu_setting_edit_float51(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr51sign(*(data)))
|
559
|
|
-#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)))
|
560
|
|
-#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))
|
561
|
|
-
|
562
|
|
-//Add version for callback functions
|
563
|
|
-#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)))
|
564
|
|
-#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)))
|
565
|
|
-#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)))
|
566
|
|
-#define lcd_implementation_drawmenu_setting_edit_callback_float43(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr43sign(*(data)))
|
567
|
|
-#define lcd_implementation_drawmenu_setting_edit_callback_float5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data)))
|
568
|
|
-#define lcd_implementation_drawmenu_setting_edit_callback_float52(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr52sign(*(data)))
|
569
|
|
-#define lcd_implementation_drawmenu_setting_edit_callback_float51(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr51sign(*(data)))
|
570
|
|
-#define lcd_implementation_drawmenu_setting_edit_callback_long5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data)))
|
571
|
|
-#define lcd_implementation_drawmenu_setting_edit_callback_bool(sel, row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
|
572
|
|
-
|
573
|
|
-void lcd_implementation_drawedit(const char* pstr, const char* value=NULL) {
|
574
|
|
- uint8_t rows = 1;
|
575
|
|
- uint8_t lcd_width = LCD_WIDTH - (START_COL), char_width = DOG_CHAR_WIDTH;
|
576
|
|
- uint8_t vallen = lcd_strlen(value);
|
577
|
|
-
|
578
|
|
- #if ENABLED(USE_BIG_EDIT_FONT)
|
579
|
|
- if (lcd_strlen_P(pstr) <= LCD_WIDTH_EDIT - 1) {
|
580
|
|
- lcd_setFont(FONT_MENU_EDIT);
|
581
|
|
- lcd_width = LCD_WIDTH_EDIT + 1;
|
582
|
|
- char_width = DOG_CHAR_WIDTH_EDIT;
|
583
|
|
- if (lcd_strlen_P(pstr) >= LCD_WIDTH_EDIT - vallen) rows = 2;
|
584
|
|
- }
|
585
|
|
- else {
|
586
|
|
- lcd_setFont(FONT_MENU);
|
|
555
|
+ while (c = pgm_read_byte(pstr)) {
|
|
556
|
+ n -= lcd_print(c);
|
|
557
|
+ pstr++;
|
587
|
558
|
}
|
588
|
|
- #endif
|
|
559
|
+ lcd_print(':');
|
|
560
|
+ while (n--) lcd_print(' ');
|
|
561
|
+ u8g.setPrintPos(LCD_PIXEL_WIDTH - (DOG_CHAR_WIDTH) * vallen, (row + 1) * (DOG_CHAR_HEIGHT));
|
|
562
|
+ if (pgm) lcd_printPGM(data); else lcd_print((char*)data);
|
|
563
|
+ }
|
|
564
|
+
|
|
565
|
+ // Macros for edit items
|
|
566
|
+ #define lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, data) _drawmenu_setting_edit_generic(sel, row, pstr, data, false)
|
|
567
|
+ #define lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, data) _drawmenu_setting_edit_generic(sel, row, pstr, data, true)
|
|
568
|
+
|
|
569
|
+ #define lcd_implementation_drawmenu_setting_edit_int3(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, itostr3(*(data)))
|
|
570
|
+ #define lcd_implementation_drawmenu_setting_edit_float3(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr3(*(data)))
|
|
571
|
+ #define lcd_implementation_drawmenu_setting_edit_float32(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr32(*(data)))
|
|
572
|
+ #define lcd_implementation_drawmenu_setting_edit_float43(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr43sign(*(data)))
|
|
573
|
+ #define lcd_implementation_drawmenu_setting_edit_float5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data)))
|
|
574
|
+ #define lcd_implementation_drawmenu_setting_edit_float52(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr52sign(*(data)))
|
|
575
|
+ #define lcd_implementation_drawmenu_setting_edit_float51(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr51sign(*(data)))
|
|
576
|
+ #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)))
|
|
577
|
+ #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))
|
|
578
|
+
|
|
579
|
+ #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)))
|
|
580
|
+ #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)))
|
|
581
|
+ #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)))
|
|
582
|
+ #define lcd_implementation_drawmenu_setting_edit_callback_float43(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr43sign(*(data)))
|
|
583
|
+ #define lcd_implementation_drawmenu_setting_edit_callback_float5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data)))
|
|
584
|
+ #define lcd_implementation_drawmenu_setting_edit_callback_float52(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr52sign(*(data)))
|
|
585
|
+ #define lcd_implementation_drawmenu_setting_edit_callback_float51(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr51sign(*(data)))
|
|
586
|
+ #define lcd_implementation_drawmenu_setting_edit_callback_long5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data)))
|
|
587
|
+ #define lcd_implementation_drawmenu_setting_edit_callback_bool(sel, row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
|
|
588
|
+
|
|
589
|
+ void lcd_implementation_drawedit(const char* pstr, const char* value=NULL) {
|
|
590
|
+ uint8_t rows = 1;
|
|
591
|
+ uint8_t lcd_width = LCD_WIDTH - (START_COL), char_width = DOG_CHAR_WIDTH;
|
|
592
|
+ uint8_t vallen = lcd_strlen(value);
|
|
593
|
+
|
|
594
|
+ #if ENABLED(USE_BIG_EDIT_FONT)
|
|
595
|
+ if (lcd_strlen_P(pstr) <= LCD_WIDTH_EDIT - 1) {
|
|
596
|
+ lcd_setFont(FONT_MENU_EDIT);
|
|
597
|
+ lcd_width = LCD_WIDTH_EDIT + 1;
|
|
598
|
+ char_width = DOG_CHAR_WIDTH_EDIT;
|
|
599
|
+ if (lcd_strlen_P(pstr) >= LCD_WIDTH_EDIT - vallen) rows = 2;
|
|
600
|
+ }
|
|
601
|
+ else {
|
|
602
|
+ lcd_setFont(FONT_MENU);
|
|
603
|
+ }
|
|
604
|
+ #endif
|
589
|
605
|
|
590
|
|
- if (lcd_strlen_P(pstr) > LCD_WIDTH - 2 - vallen) rows = 2;
|
|
606
|
+ if (lcd_strlen_P(pstr) > LCD_WIDTH - 2 - vallen) rows = 2;
|
591
|
607
|
|
592
|
|
- const float kHalfChar = (DOG_CHAR_HEIGHT_EDIT) / 2;
|
593
|
|
- float rowHeight = u8g.getHeight() / (rows + 1); // 1/(rows+1) = 1/2 or 1/3
|
|
608
|
+ const float kHalfChar = (DOG_CHAR_HEIGHT_EDIT) / 2;
|
|
609
|
+ float rowHeight = u8g.getHeight() / (rows + 1); // 1/(rows+1) = 1/2 or 1/3
|
594
|
610
|
|
595
|
|
- u8g.setPrintPos(0, rowHeight + kHalfChar);
|
596
|
|
- lcd_printPGM(pstr);
|
597
|
|
- if (value != NULL) {
|
598
|
|
- lcd_print(':');
|
599
|
|
- u8g.setPrintPos((lcd_width - 1 - vallen) * char_width, rows * rowHeight + kHalfChar);
|
600
|
|
- lcd_print(value);
|
|
611
|
+ u8g.setPrintPos(0, rowHeight + kHalfChar);
|
|
612
|
+ lcd_printPGM(pstr);
|
|
613
|
+ if (value != NULL) {
|
|
614
|
+ lcd_print(':');
|
|
615
|
+ u8g.setPrintPos((lcd_width - 1 - vallen) * char_width, rows * rowHeight + kHalfChar);
|
|
616
|
+ lcd_print(value);
|
|
617
|
+ }
|
601
|
618
|
}
|
602
|
|
-}
|
603
|
619
|
|
604
|
|
-#if ENABLED(SDSUPPORT)
|
|
620
|
+ #if ENABLED(SDSUPPORT)
|
605
|
621
|
|
606
|
|
- static void _drawmenu_sd(bool isSelected, uint8_t row, const char* pstr, const char* filename, char* const longFilename, bool isDir) {
|
607
|
|
- UNUSED(pstr);
|
608
|
|
- char c;
|
609
|
|
- uint8_t n = LCD_WIDTH - (START_COL) - 1;
|
|
622
|
+ static void _drawmenu_sd(bool isSelected, uint8_t row, const char* pstr, const char* filename, char* const longFilename, bool isDir) {
|
|
623
|
+ UNUSED(pstr);
|
|
624
|
+ char c;
|
|
625
|
+ uint8_t n = LCD_WIDTH - (START_COL) - 1;
|
610
|
626
|
|
611
|
|
- if (longFilename[0]) {
|
612
|
|
- filename = longFilename;
|
613
|
|
- longFilename[n] = '\0';
|
614
|
|
- }
|
|
627
|
+ if (longFilename[0]) {
|
|
628
|
+ filename = longFilename;
|
|
629
|
+ longFilename[n] = '\0';
|
|
630
|
+ }
|
615
|
631
|
|
616
|
|
- lcd_implementation_mark_as_selected(row, isSelected);
|
|
632
|
+ lcd_implementation_mark_as_selected(row, isSelected);
|
617
|
633
|
|
618
|
|
- if (isDir) lcd_print(LCD_STR_FOLDER[0]);
|
619
|
|
- while ((c = *filename)) {
|
620
|
|
- n -= lcd_print(c);
|
621
|
|
- filename++;
|
|
634
|
+ if (isDir) lcd_print(LCD_STR_FOLDER[0]);
|
|
635
|
+ while ((c = *filename)) {
|
|
636
|
+ n -= lcd_print(c);
|
|
637
|
+ filename++;
|
|
638
|
+ }
|
|
639
|
+ while (n--) lcd_print(' ');
|
622
|
640
|
}
|
623
|
|
- while (n--) lcd_print(' ');
|
624
|
|
- }
|
625
|
641
|
|
626
|
|
- #define lcd_implementation_drawmenu_sdfile(sel, row, pstr, filename, longFilename) _drawmenu_sd(sel, row, pstr, filename, longFilename, false)
|
627
|
|
- #define lcd_implementation_drawmenu_sddirectory(sel, row, pstr, filename, longFilename) _drawmenu_sd(sel, row, pstr, filename, longFilename, true)
|
|
642
|
+ #define lcd_implementation_drawmenu_sdfile(sel, row, pstr, filename, longFilename) _drawmenu_sd(sel, row, pstr, filename, longFilename, false)
|
|
643
|
+ #define lcd_implementation_drawmenu_sddirectory(sel, row, pstr, filename, longFilename) _drawmenu_sd(sel, row, pstr, filename, longFilename, true)
|
628
|
644
|
|
629
|
|
-#endif //SDSUPPORT
|
|
645
|
+ #endif // SDSUPPORT
|
630
|
646
|
|
631
|
|
-#define lcd_implementation_drawmenu_back(sel, row, pstr) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0])
|
632
|
|
-#define lcd_implementation_drawmenu_submenu(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0])
|
633
|
|
-#define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
|
634
|
|
-#define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
|
|
647
|
+#endif // ULTIPANEL
|
635
|
648
|
|
636
|
649
|
#endif //__ULTRALCD_IMPL_DOGM_H
|