Bläddra i källkod

Invert headings on Graphical LCD

Scott Lahteine 8 år sedan
förälder
incheckning
85aeb02aa6

+ 5
- 3
Marlin/dogm_lcd_implementation.h Visa fil

@@ -485,11 +485,13 @@ static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) {
485 485
 
486 486
 #if ENABLED(LCD_INFO_MENU) || ENABLED(FILAMENT_CHANGE_FEATURE)
487 487
 
488
-  static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, const char* valstr=NULL, bool center=true) {
488
+  static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, bool center=true, bool invert=false, const char* valstr=NULL) {
489
+
490
+    lcd_implementation_mark_as_selected(row, invert);
491
+
489 492
     char c;
490 493
     int8_t n = LCD_WIDTH;
491
-    u8g.setPrintPos(0, (row + 1) * (DOG_CHAR_HEIGHT));
492
-    u8g.setColorIndex(1); // normal text
494
+
493 495
     if (center && !valstr) {
494 496
       int8_t pad = (LCD_WIDTH - lcd_strlen_P(pstr)) / 2;
495 497
       while (--pad >= 0) { lcd_print(' '); n--; }

+ 12
- 12
Marlin/ultralcd.cpp Visa fil

@@ -1965,9 +1965,9 @@ void kill_screen(const char* lcd_msg) {
1965 1965
 
1966 1966
         if (LCD_CLICKED) lcd_goto_previous_menu(true);
1967 1967
         START_SCREEN();
1968
-        STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", itostr3left(stats.totalPrints));        // Print Count : 999
1969
-        STATIC_ITEM(MSG_INFO_FINISHED_PRINTS ": ", itostr3left(stats.finishedPrints)); // Finished    : 666
1970
-        STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", printTime);                              // Total Time  : 12:34
1968
+        STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, itostr3left(stats.totalPrints));        // Print Count : 999
1969
+        STATIC_ITEM(MSG_INFO_FINISHED_PRINTS ": ", false, false, itostr3left(stats.finishedPrints)); // Finished    : 666
1970
+        STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", false, false, printTime);                              // Total Time  : 12:34
1971 1971
         END_SCREEN();
1972 1972
       }
1973 1973
     #endif // PRINTCOUNTER
@@ -2032,7 +2032,7 @@ void kill_screen(const char* lcd_msg) {
2032 2032
     static void lcd_info_board_menu() {
2033 2033
       if (LCD_CLICKED) lcd_goto_previous_menu(true);
2034 2034
       START_SCREEN();
2035
-      STATIC_ITEM(BOARD_NAME);                                 // MyPrinterController
2035
+      STATIC_ITEM(BOARD_NAME, true, true);                     // MyPrinterController
2036 2036
       STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE)); // Baud: 250000
2037 2037
       STATIC_ITEM(MSG_INFO_PROTOCOL ": " PROTOCOL_VERSION);    // Protocol: 1.0
2038 2038
       #ifdef POWER_SUPPLY
@@ -2053,7 +2053,7 @@ void kill_screen(const char* lcd_msg) {
2053 2053
     static void lcd_info_printer_menu() {
2054 2054
       if (LCD_CLICKED) lcd_goto_previous_menu(true);
2055 2055
       START_SCREEN();
2056
-      STATIC_ITEM(MSG_MARLIN);                                   // Marlin
2056
+      STATIC_ITEM(MSG_MARLIN, true, true);                       // Marlin
2057 2057
       STATIC_ITEM(SHORT_BUILD_VERSION);                          // x.x.x-Branch
2058 2058
       STATIC_ITEM(STRING_DISTRIBUTION_DATE);                     // YYYY-MM-DD HH:MM
2059 2059
       STATIC_ITEM(MACHINE_NAME);                                 // My3DPrinter
@@ -2095,7 +2095,7 @@ void kill_screen(const char* lcd_msg) {
2095 2095
     static void lcd_filament_change_option_menu() {
2096 2096
       START_MENU();
2097 2097
       #if LCD_HEIGHT > 2
2098
-        STATIC_ITEM(MSG_FILAMENT_CHANGE_OPTION_HEADER);
2098
+        STATIC_ITEM(MSG_FILAMENT_CHANGE_OPTION_HEADER, true, false);
2099 2099
       #endif
2100 2100
       MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_RESUME, lcd_filament_change_resume_print);
2101 2101
       MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_EXTRUDE, lcd_filament_change_extrude_more);
@@ -2104,7 +2104,7 @@ void kill_screen(const char* lcd_msg) {
2104 2104
 
2105 2105
     static void lcd_filament_change_init_message() {
2106 2106
       START_SCREEN();
2107
-      STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER);
2107
+      STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, true, true);
2108 2108
       STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_1);
2109 2109
       #ifdef MSG_FILAMENT_CHANGE_INIT_2
2110 2110
         STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_2);
@@ -2117,7 +2117,7 @@ void kill_screen(const char* lcd_msg) {
2117 2117
 
2118 2118
     static void lcd_filament_change_unload_message() {
2119 2119
       START_SCREEN();
2120
-      STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER);
2120
+      STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, true, true);
2121 2121
       STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_1);
2122 2122
       #ifdef MSG_FILAMENT_CHANGE_UNLOAD_2
2123 2123
         STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_2);
@@ -2130,7 +2130,7 @@ void kill_screen(const char* lcd_msg) {
2130 2130
 
2131 2131
     static void lcd_filament_change_insert_message() {
2132 2132
       START_SCREEN();
2133
-      STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER);
2133
+      STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, true, true);
2134 2134
       STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_1);
2135 2135
       #ifdef MSG_FILAMENT_CHANGE_INSERT_2
2136 2136
         STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_2);
@@ -2143,7 +2143,7 @@ void kill_screen(const char* lcd_msg) {
2143 2143
 
2144 2144
     static void lcd_filament_change_load_message() {
2145 2145
       START_SCREEN();
2146
-      STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER);
2146
+      STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, true, true);
2147 2147
       STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_1);
2148 2148
       #ifdef MSG_FILAMENT_CHANGE_LOAD_2
2149 2149
         STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_2);
@@ -2156,7 +2156,7 @@ void kill_screen(const char* lcd_msg) {
2156 2156
 
2157 2157
     static void lcd_filament_change_extrude_message() {
2158 2158
       START_SCREEN();
2159
-      STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER);
2159
+      STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, true, true);
2160 2160
       STATIC_ITEM(MSG_FILAMENT_CHANGE_EXTRUDE_1);
2161 2161
       #ifdef MSG_FILAMENT_CHANGE_EXTRUDE_2
2162 2162
         STATIC_ITEM(MSG_FILAMENT_CHANGE_EXTRUDE_2);
@@ -2169,7 +2169,7 @@ void kill_screen(const char* lcd_msg) {
2169 2169
 
2170 2170
     static void lcd_filament_change_resume_message() {
2171 2171
       START_SCREEN();
2172
-      STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER);
2172
+      STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, true, true);
2173 2173
       STATIC_ITEM(MSG_FILAMENT_CHANGE_RESUME_1);
2174 2174
       #ifdef MSG_FILAMENT_CHANGE_RESUME_2
2175 2175
         STATIC_ITEM(MSG_FILAMENT_CHANGE_RESUME_2);

+ 2
- 1
Marlin/ultralcd_implementation_hitachi_HD44780.h Visa fil

@@ -830,7 +830,8 @@ static void lcd_implementation_status_screen() {
830 830
 
831 831
 #if ENABLED(LCD_INFO_MENU) || ENABLED(FILAMENT_CHANGE_FEATURE)
832 832
 
833
-  static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, const char *valstr=NULL, bool center=true) {
833
+  static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, bool center=true, bool invert=false, const char *valstr=NULL) {
834
+    UNUSED(invert);
834 835
     char c;
835 836
     int8_t n = LCD_WIDTH;
836 837
     lcd.setCursor(0, row);

Laddar…
Avbryt
Spara