🎨 Apply F() to E3V2 titles, popups
This commit is contained in:
		@@ -175,9 +175,10 @@ void DWIN_Frame_AreaMove(uint8_t mode, uint8_t dir, uint16_t dis,
 | 
			
		||||
//  rlimit: For draw less chars than string length use rlimit
 | 
			
		||||
void DWIN_Draw_String(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t x, uint16_t y, const char * const string, uint16_t rlimit=0xFFFF);
 | 
			
		||||
 | 
			
		||||
inline void DWIN_Draw_String(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t x, uint16_t y, FSTR_P title) {
 | 
			
		||||
  // Note that this won't work on AVR, only 32-bit systems!
 | 
			
		||||
  DWIN_Draw_String(bShow, size, color, bColor, x, y, FTOP(title));
 | 
			
		||||
inline void DWIN_Draw_String(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t x, uint16_t y, FSTR_P const ftitle) {
 | 
			
		||||
  char ctitle[strlen_P(FTOP(ftitle)) + 1];
 | 
			
		||||
  strcpy_P(ctitle, FTOP(ftitle));
 | 
			
		||||
  DWIN_Draw_String(bShow, size, color, bColor, x, y, ctitle);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Draw a positive integer
 | 
			
		||||
 
 | 
			
		||||
@@ -359,12 +359,8 @@ inline void Clear_Title_Bar() {
 | 
			
		||||
  DWIN_Draw_Box(1, Color_Bg_Blue, 0, 0, DWIN_WIDTH, TITLE_HEIGHT);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Draw_Title(const char * const title) {
 | 
			
		||||
  DWIN_Draw_String(false, DWIN_FONT_HEAD, Color_White, Color_Bg_Blue, 14, 4, (char*)title);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Draw_Title(FSTR_P title) {
 | 
			
		||||
  DWIN_Draw_String(false, DWIN_FONT_HEAD, Color_White, Color_Bg_Blue, 14, 4, (char*)title);
 | 
			
		||||
void Draw_Title(FSTR_P ftitle) {
 | 
			
		||||
  DWIN_Draw_String(false, DWIN_FONT_HEAD, Color_White, Color_Bg_Blue, 14, 4, ftitle);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
inline void Clear_Menu_Area() {
 | 
			
		||||
@@ -420,32 +416,40 @@ inline uint16_t nr_sd_menu_items() {
 | 
			
		||||
  return card.get_num_Files() + !card.flag.workDirIsRoot;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Draw_Menu_Icon(const uint8_t line, const uint8_t icon) {
 | 
			
		||||
  DWIN_ICON_Show(ICON, icon, 26, MBASE(line) - 3);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Erase_Menu_Text(const uint8_t line) {
 | 
			
		||||
  DWIN_Draw_Rectangle(1, Color_Bg_Black, LBLX, MBASE(line) - 14, 271, MBASE(line) + 28);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Draw_Menu_Item(const uint8_t line, const uint8_t icon=0, const char * const label=nullptr, bool more=false) {
 | 
			
		||||
  if (label) DWIN_Draw_String(false, font8x16, Color_White, Color_Bg_Black, LBLX, MBASE(line) - 1, (char*)label);
 | 
			
		||||
void Draw_Menu_Icon(const uint8_t line, const uint8_t icon) {
 | 
			
		||||
  DWIN_ICON_Show(ICON, icon, 26, MBASE(line) - 3);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void _Decorate_Menu_Item(const uint8_t line, const uint8_t icon, bool more) {
 | 
			
		||||
  if (icon) Draw_Menu_Icon(line, icon);
 | 
			
		||||
  if (more) Draw_More_Icon(line);
 | 
			
		||||
}
 | 
			
		||||
void Draw_Menu_Item(const uint8_t line, const uint8_t icon=0, const char * const label=nullptr, bool more=false) {
 | 
			
		||||
  if (label) DWIN_Draw_String(false, font8x16, Color_White, Color_Bg_Black, LBLX, MBASE(line) - 1, (char*)label);
 | 
			
		||||
  _Decorate_Menu_Item(line, icon, more);
 | 
			
		||||
}
 | 
			
		||||
void Draw_Menu_Item(const uint8_t line, const uint8_t icon=0, FSTR_P const flabel=nullptr, bool more=false) {
 | 
			
		||||
  if (flabel) DWIN_Draw_String(false, font8x16, Color_White, Color_Bg_Black, LBLX, MBASE(line) - 1, flabel);
 | 
			
		||||
  _Decorate_Menu_Item(line, icon, more);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Draw_Menu_Line(const uint8_t line, const uint8_t icon=0, const char * const label=nullptr, bool more=false) {
 | 
			
		||||
  Draw_Menu_Item(line, icon, label, more);
 | 
			
		||||
  DWIN_Draw_Line(Line_Color, 16, MBASE(line) + 33, 256, MBASE(line) + 34);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Draw_Menu_LineF(const uint8_t line, const uint8_t icon=0, FSTR_P label=nullptr, bool more=false) {
 | 
			
		||||
  Draw_Menu_Line(line, icon, (char*)label, more);
 | 
			
		||||
void Draw_Menu_Line(const uint8_t line, const uint8_t icon, FSTR_P const flabel, bool more=false) {
 | 
			
		||||
  Draw_Menu_Item(line, icon, flabel, more);
 | 
			
		||||
  DWIN_Draw_Line(Line_Color, 16, MBASE(line) + 33, 256, MBASE(line) + 34);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Draw_Checkbox_Line(const uint8_t line, const bool ison) {
 | 
			
		||||
  const uint16_t x = 225, y = EBASE(line) - 2;
 | 
			
		||||
  DWIN_Draw_String(true, font8x16, Color_White, Color_Bg_Black, x + 5, y, F(ison ? "X" : " "));
 | 
			
		||||
  DWIN_Draw_String(true, font8x16, Color_White, Color_Bg_Black, x + 5, y, ison ? F("X") : F(" "));
 | 
			
		||||
  DWIN_Draw_Rectangle(0, Color_White, x + 2, y + 2, x + 16, y + 16);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -1853,7 +1857,7 @@ void Draw_SDItem(const uint16_t item, int16_t row=-1) {
 | 
			
		||||
  if (row < 0) row = item + 1 + MROWS - index_file;
 | 
			
		||||
  const bool is_subdir = !card.flag.workDirIsRoot;
 | 
			
		||||
  if (is_subdir && item == 0) {
 | 
			
		||||
    Draw_Menu_Line(row, ICON_Folder, "..");
 | 
			
		||||
    Draw_Menu_Line(row, ICON_Folder, F(".."));
 | 
			
		||||
    return;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@@ -2531,7 +2535,7 @@ void Item_HomeOffs_X(const uint8_t row) {
 | 
			
		||||
  }
 | 
			
		||||
  else {
 | 
			
		||||
    #ifdef USE_STRING_TITLES
 | 
			
		||||
      Draw_Menu_LineF(row, ICON_HomeOffsetX, GET_TEXT_F(MSG_HOME_OFFSET_X));
 | 
			
		||||
      Draw_Menu_Line(row, ICON_HomeOffsetX, GET_TEXT_F(MSG_HOME_OFFSET_X));
 | 
			
		||||
    #else
 | 
			
		||||
      say_home_offs_en(row); say_x_en(75, row);   // "Home Offset X"
 | 
			
		||||
    #endif
 | 
			
		||||
@@ -2546,7 +2550,7 @@ void Item_HomeOffs_Y(const uint8_t row) {
 | 
			
		||||
  }
 | 
			
		||||
  else {
 | 
			
		||||
    #ifdef USE_STRING_TITLES
 | 
			
		||||
      Draw_Menu_LineF(row, ICON_HomeOffsetY, GET_TEXT_F(MSG_HOME_OFFSET_Y));
 | 
			
		||||
      Draw_Menu_Line(row, ICON_HomeOffsetY, GET_TEXT_F(MSG_HOME_OFFSET_Y));
 | 
			
		||||
    #else
 | 
			
		||||
      say_home_offs_en(row); say_y_en(75, row);   // "Home Offset X"
 | 
			
		||||
    #endif
 | 
			
		||||
@@ -2561,7 +2565,7 @@ void Item_HomeOffs_Z(const uint8_t row) {
 | 
			
		||||
  }
 | 
			
		||||
  else {
 | 
			
		||||
    #ifdef USE_STRING_TITLES
 | 
			
		||||
      Draw_Menu_LineF(row, ICON_HomeOffsetZ, GET_TEXT_F(MSG_HOME_OFFSET_Z));
 | 
			
		||||
      Draw_Menu_Line(row, ICON_HomeOffsetZ, GET_TEXT_F(MSG_HOME_OFFSET_Z));
 | 
			
		||||
    #else
 | 
			
		||||
      say_home_offs_en(row); say_z_en(75, row);   // "Home Offset Z"
 | 
			
		||||
    #endif
 | 
			
		||||
@@ -2604,8 +2608,8 @@ void Draw_HomeOff_Menu() {
 | 
			
		||||
        DWIN_Frame_TitleCopy(124, 431, 91, 12);                             // "Probe Offsets"
 | 
			
		||||
      #endif
 | 
			
		||||
      #ifdef USE_STRING_TITLES
 | 
			
		||||
        Draw_Menu_LineF(1, ICON_ProbeOffsetX, GET_TEXT_F(MSG_ZPROBE_XOFFSET));  // Probe X Offset
 | 
			
		||||
        Draw_Menu_LineF(2, ICON_ProbeOffsetY, GET_TEXT_F(MSG_ZPROBE_YOFFSET));  // Probe Y Offset
 | 
			
		||||
        Draw_Menu_Line(1, ICON_ProbeOffsetX, GET_TEXT_F(MSG_ZPROBE_XOFFSET));  // Probe X Offset
 | 
			
		||||
        Draw_Menu_Line(2, ICON_ProbeOffsetY, GET_TEXT_F(MSG_ZPROBE_YOFFSET));  // Probe Y Offset
 | 
			
		||||
      #else
 | 
			
		||||
        say_probe_offs_en(1); say_x_en(75, 1);  // "Probe Offset X"
 | 
			
		||||
        say_probe_offs_en(2); say_y_en(75, 2);  // "Probe Offset Y"
 | 
			
		||||
@@ -3090,7 +3094,7 @@ void HMI_Temperature() {
 | 
			
		||||
          }
 | 
			
		||||
          else {
 | 
			
		||||
            #ifdef USE_STRING_HEADINGS
 | 
			
		||||
              Draw_Title(PREHEAT_1_LABEL " Settings"); // TODO: GET_TEXT_F
 | 
			
		||||
              Draw_Title(F(PREHEAT_1_LABEL " Settings")); // TODO: GET_TEXT_F
 | 
			
		||||
            #else
 | 
			
		||||
              DWIN_Frame_TitleCopy(56, 15, 85, 14);                       // "Temperature"  TODO: "PLA Settings"
 | 
			
		||||
            #endif
 | 
			
		||||
@@ -3169,7 +3173,7 @@ void HMI_Temperature() {
 | 
			
		||||
          }
 | 
			
		||||
          else {
 | 
			
		||||
            #ifdef USE_STRING_HEADINGS
 | 
			
		||||
              Draw_Title("ABS Settings"); // TODO: GET_TEXT_F
 | 
			
		||||
              Draw_Title(F("ABS Settings")); // TODO: GET_TEXT_F
 | 
			
		||||
            #else
 | 
			
		||||
              DWIN_Frame_TitleCopy(56, 15, 85, 14);                       // "Temperature"  TODO: "ABS Settings"
 | 
			
		||||
            #endif
 | 
			
		||||
@@ -3252,7 +3256,7 @@ void Draw_Max_Speed_Menu() {
 | 
			
		||||
  }
 | 
			
		||||
  else {
 | 
			
		||||
    #ifdef USE_STRING_HEADINGS
 | 
			
		||||
      Draw_Title("Max Speed (mm/s)"); // TODO: GET_TEXT_F
 | 
			
		||||
      Draw_Title(F("Max Speed (mm/s)")); // TODO: GET_TEXT_F
 | 
			
		||||
    #else
 | 
			
		||||
      DWIN_Frame_TitleCopy(144, 16, 46, 11);                  // "Max Speed (mm/s)"
 | 
			
		||||
    #endif
 | 
			
		||||
 
 | 
			
		||||
@@ -486,24 +486,31 @@ void Clear_Popup_Area() {
 | 
			
		||||
  DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 0, 31, DWIN_WIDTH, DWIN_HEIGHT);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DWIN_Draw_Popup(uint8_t icon=0, const char * const msg1=nullptr, const char * const msg2=nullptr, uint8_t button=0) {
 | 
			
		||||
void DWIN_Draw_Popup1(const uint8_t icon) {
 | 
			
		||||
  DWINUI::ClearMenuArea();
 | 
			
		||||
  Draw_Popup_Bkgd_60();
 | 
			
		||||
  if (icon) DWINUI::Draw_Icon(icon, 101, 105);
 | 
			
		||||
  if (msg1) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 210, msg1);
 | 
			
		||||
  if (msg2) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 240, msg2);
 | 
			
		||||
}
 | 
			
		||||
void DWIN_Draw_Popup2(FSTR_P const fmsg2, uint8_t button) {
 | 
			
		||||
  if (fmsg2) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 240, fmsg2);
 | 
			
		||||
  if (button) DWINUI::Draw_Icon(button, 86, 280);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DWIN_Popup_Confirm(uint8_t icon, const char * const msg1, const char * const msg2) {
 | 
			
		||||
  HMI_SaveProcessID(WaitResponse);
 | 
			
		||||
  DWIN_Draw_Popup(icon, msg1, msg2, ICON_Confirm_E);  // Button Confirm
 | 
			
		||||
  DWIN_UpdateLCD();
 | 
			
		||||
void DWIN_Draw_Popup(const uint8_t icon, const char * const cmsg1, FSTR_P const fmsg2, uint8_t button) {
 | 
			
		||||
  DWIN_Draw_Popup1(icon);
 | 
			
		||||
  if (cmsg1) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 210, cmsg1);
 | 
			
		||||
  DWIN_Draw_Popup2(fmsg2, button);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DWIN_Popup_Continue(uint8_t icon, const char * const msg1, const char * const msg2) {
 | 
			
		||||
void DWIN_Draw_Popup(const uint8_t icon, FSTR_P const fmsg1, FSTR_P const fmsg2, uint8_t button) {
 | 
			
		||||
  DWIN_Draw_Popup1(icon);
 | 
			
		||||
  if (fmsg1) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 210, fmsg1);
 | 
			
		||||
  DWIN_Draw_Popup2(fmsg2, button);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DWIN_Popup_Continue(const uint8_t icon, FSTR_P const fmsg1, FSTR_P const fmsg2) {
 | 
			
		||||
  HMI_SaveProcessID(WaitResponse);
 | 
			
		||||
  DWIN_Draw_Popup(icon, msg1, msg2, ICON_Continue_E);  // Button Continue
 | 
			
		||||
  DWIN_Draw_Popup(icon, fmsg1, fmsg2, ICON_Continue_E);  // Button Continue
 | 
			
		||||
  DWIN_UpdateLCD();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -521,7 +528,7 @@ void DWIN_Popup_Continue(uint8_t icon, const char * const msg1, const char * con
 | 
			
		||||
      DWIN_UpdateLCD();
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
      DWIN_Popup_Confirm(ICON_TempTooLow, "Nozzle is too cold", "Preheat the hotend");
 | 
			
		||||
      DWIN_Popup_Confirm(ICON_TempTooLow, F("Nozzle is too cold"), F("Preheat the hotend"));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
@@ -565,7 +572,7 @@ void Popup_window_PauseOrStop() {
 | 
			
		||||
    DWINUI::Draw_Icon(ICON_Cancel_C, 146, 280);
 | 
			
		||||
  }
 | 
			
		||||
  else {
 | 
			
		||||
    DWIN_Draw_Popup(ICON_BLTouch, "Please confirm", select_print.now == PRINT_PAUSE_RESUME ? GET_TEXT(MSG_PAUSE_PRINT) : GET_TEXT(MSG_STOP_PRINT));
 | 
			
		||||
    DWIN_Draw_Popup(ICON_BLTouch, F("Please confirm"), select_print.now == PRINT_PAUSE_RESUME ? GET_TEXT_F(MSG_PAUSE_PRINT) : GET_TEXT_F(MSG_STOP_PRINT));
 | 
			
		||||
    DWINUI::Draw_Icon(ICON_Confirm_E, 26, 280);
 | 
			
		||||
    DWINUI::Draw_Icon(ICON_Cancel_E, 146, 280);
 | 
			
		||||
  }
 | 
			
		||||
@@ -1386,7 +1393,7 @@ void HMI_PauseOrStop() {
 | 
			
		||||
        #ifdef ACTION_ON_CANCEL
 | 
			
		||||
          host_action_cancel();
 | 
			
		||||
        #endif
 | 
			
		||||
        DWIN_Draw_Popup(ICON_BLTouch, "Stopping..." , "Please wait until done.");
 | 
			
		||||
        DWIN_Draw_Popup(ICON_BLTouch, F("Stopping...") , F("Please wait until done."));
 | 
			
		||||
      }
 | 
			
		||||
      else
 | 
			
		||||
        Goto_PrintProcess(); // cancel stop
 | 
			
		||||
@@ -1644,7 +1651,7 @@ void HMI_SaveProcessID(const uint8_t id) {
 | 
			
		||||
void DWIN_StartHoming() {
 | 
			
		||||
  HMI_flag.home_flag = true;
 | 
			
		||||
  HMI_SaveProcessID(Homing);
 | 
			
		||||
  DWIN_Draw_Popup(ICON_BLTouch, "Axis Homing", "Please wait until done.");
 | 
			
		||||
  DWIN_Draw_Popup(ICON_BLTouch, F("Axis Homing"), F("Please wait until done."));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DWIN_CompletedHoming() {
 | 
			
		||||
@@ -1659,7 +1666,7 @@ void DWIN_CompletedHoming() {
 | 
			
		||||
void DWIN_MeshLevelingStart() {
 | 
			
		||||
  #if HAS_ONESTEP_LEVELING
 | 
			
		||||
    HMI_SaveProcessID(Leveling);
 | 
			
		||||
    DWIN_Draw_Popup(ICON_AutoLeveling, GET_TEXT(MSG_BED_LEVELING), "Please wait until done.");
 | 
			
		||||
    DWIN_Draw_Popup(ICON_AutoLeveling, GET_TEXT_F(MSG_BED_LEVELING), F("Please wait until done."));
 | 
			
		||||
  #elif ENABLED(MESH_BED_LEVELING)
 | 
			
		||||
    Draw_ManualMesh_Menu();
 | 
			
		||||
  #endif
 | 
			
		||||
@@ -1682,27 +1689,27 @@ void DWIN_PidTuning(pidresult_t result) {
 | 
			
		||||
  switch (result) {
 | 
			
		||||
    case PID_BED_START:
 | 
			
		||||
      HMI_SaveProcessID(NothingToDo);
 | 
			
		||||
      DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT(MSG_PID_AUTOTUNE), "for BED is running.");
 | 
			
		||||
      DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for BED is running."));
 | 
			
		||||
      break;
 | 
			
		||||
    case PID_EXTR_START:
 | 
			
		||||
      HMI_SaveProcessID(NothingToDo);
 | 
			
		||||
      DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT(MSG_PID_AUTOTUNE), "for Nozzle is running.");
 | 
			
		||||
      DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for Nozzle is running."));
 | 
			
		||||
      break;
 | 
			
		||||
    case PID_BAD_EXTRUDER_NUM:
 | 
			
		||||
      checkkey = last_checkkey;
 | 
			
		||||
      DWIN_Popup_Confirm(ICON_TempTooLow, "PID Autotune failed!", "Bad extruder");
 | 
			
		||||
      DWIN_Popup_Confirm(ICON_TempTooLow, F("PID Autotune failed!"), F("Bad extruder"));
 | 
			
		||||
      break;
 | 
			
		||||
    case PID_TUNING_TIMEOUT:
 | 
			
		||||
      checkkey = last_checkkey;
 | 
			
		||||
      DWIN_Popup_Confirm(ICON_TempTooHigh, "Error", GET_TEXT(MSG_PID_TIMEOUT));
 | 
			
		||||
      DWIN_Popup_Confirm(ICON_TempTooHigh, F("Error"), GET_TEXT_F(MSG_PID_TIMEOUT));
 | 
			
		||||
      break;
 | 
			
		||||
    case PID_TEMP_TOO_HIGH:
 | 
			
		||||
      checkkey = last_checkkey;
 | 
			
		||||
      DWIN_Popup_Confirm(ICON_TempTooHigh, "PID Autotune failed!", "Temperature too high");
 | 
			
		||||
      DWIN_Popup_Confirm(ICON_TempTooHigh, F("PID Autotune failed!"), F("Temperature too high"));
 | 
			
		||||
      break;
 | 
			
		||||
    case PID_DONE:
 | 
			
		||||
      checkkey = last_checkkey;
 | 
			
		||||
      DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT(MSG_PID_AUTOTUNE), GET_TEXT(MSG_BUTTON_DONE));
 | 
			
		||||
      DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_PID_AUTOTUNE), GET_TEXT_F(MSG_BUTTON_DONE));
 | 
			
		||||
      break;
 | 
			
		||||
    default:
 | 
			
		||||
      checkkey = last_checkkey;
 | 
			
		||||
@@ -1864,24 +1871,24 @@ void DWIN_Redraw_screen() {
 | 
			
		||||
 | 
			
		||||
#if ENABLED(ADVANCED_PAUSE_FEATURE)
 | 
			
		||||
 | 
			
		||||
  void DWIN_Popup_Pause(const char *msg, uint8_t button = 0) {
 | 
			
		||||
  void DWIN_Popup_Pause(FSTR_P const fmsg, uint8_t button = 0) {
 | 
			
		||||
    HMI_SaveProcessID(button ? WaitResponse : NothingToDo);
 | 
			
		||||
    DWIN_Draw_Popup(ICON_BLTouch, "Advanced Pause", msg, button);
 | 
			
		||||
    DWIN_Draw_Popup(ICON_BLTouch, F("Advanced Pause"), fmsg, button);
 | 
			
		||||
    ui.reset_status(true);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  void MarlinUI::pause_show_message(const PauseMessage message, const PauseMode mode/*=PAUSE_MODE_SAME*/, const uint8_t extruder/*=active_extruder*/) {
 | 
			
		||||
    switch (message) {
 | 
			
		||||
      case PAUSE_MESSAGE_PARKING:  DWIN_Popup_Pause(GET_TEXT(MSG_PAUSE_PRINT_PARKING));    break;
 | 
			
		||||
      case PAUSE_MESSAGE_CHANGING: DWIN_Popup_Pause(GET_TEXT(MSG_FILAMENT_CHANGE_INIT));   break;
 | 
			
		||||
      case PAUSE_MESSAGE_UNLOAD:   DWIN_Popup_Pause(GET_TEXT(MSG_FILAMENT_CHANGE_UNLOAD)); break;
 | 
			
		||||
      case PAUSE_MESSAGE_WAITING:  DWIN_Popup_Pause(GET_TEXT(MSG_ADVANCED_PAUSE_WAITING), ICON_Continue_E); break;
 | 
			
		||||
      case PAUSE_MESSAGE_INSERT:   DWIN_Popup_Continue(ICON_BLTouch, "Advanced Pause", GET_TEXT(MSG_FILAMENT_CHANGE_INSERT)); break;
 | 
			
		||||
      case PAUSE_MESSAGE_LOAD:     DWIN_Popup_Pause(GET_TEXT(MSG_FILAMENT_CHANGE_LOAD));   break;
 | 
			
		||||
      case PAUSE_MESSAGE_PURGE:    DWIN_Popup_Pause(GET_TEXT(MSG_FILAMENT_CHANGE_PURGE));  break;
 | 
			
		||||
      case PAUSE_MESSAGE_PARKING:  DWIN_Popup_Pause(GET_TEXT_F(MSG_PAUSE_PRINT_PARKING));    break;
 | 
			
		||||
      case PAUSE_MESSAGE_CHANGING: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT));   break;
 | 
			
		||||
      case PAUSE_MESSAGE_UNLOAD:   DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD)); break;
 | 
			
		||||
      case PAUSE_MESSAGE_WAITING:  DWIN_Popup_Pause(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING), ICON_Continue_E); break;
 | 
			
		||||
      case PAUSE_MESSAGE_INSERT:   DWIN_Popup_Continue(ICON_BLTouch, F("Advanced Pause"), GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT)); break;
 | 
			
		||||
      case PAUSE_MESSAGE_LOAD:     DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD));   break;
 | 
			
		||||
      case PAUSE_MESSAGE_PURGE:    DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE));  break;
 | 
			
		||||
      case PAUSE_MESSAGE_OPTION:   DWIN_Popup_FilamentPurge(); break;
 | 
			
		||||
      case PAUSE_MESSAGE_RESUME:   DWIN_Popup_Pause(GET_TEXT(MSG_FILAMENT_CHANGE_RESUME)); break;
 | 
			
		||||
      case PAUSE_MESSAGE_HEAT:     DWIN_Popup_Pause(GET_TEXT(MSG_FILAMENT_CHANGE_HEAT), ICON_Continue_E);   break;
 | 
			
		||||
      case PAUSE_MESSAGE_RESUME:   DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_RESUME)); break;
 | 
			
		||||
      case PAUSE_MESSAGE_HEAT:     DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEAT), ICON_Continue_E);   break;
 | 
			
		||||
      case PAUSE_MESSAGE_HEATING:  ui.set_status_P(GET_TEXT(MSG_FILAMENT_CHANGE_HEATING)); break;
 | 
			
		||||
      case PAUSE_MESSAGE_STATUS:   HMI_ReturnScreen(); break;
 | 
			
		||||
      default: break;
 | 
			
		||||
@@ -1889,7 +1896,7 @@ void DWIN_Redraw_screen() {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  void Draw_Popup_FilamentPurge() {
 | 
			
		||||
    DWIN_Draw_Popup(ICON_BLTouch, "Advanced Pause", "Purge or Continue?");
 | 
			
		||||
    DWIN_Draw_Popup(ICON_BLTouch, F("Advanced Pause"), F("Purge or Continue?"));
 | 
			
		||||
    DWINUI::Draw_Icon(ICON_Confirm_E, 26, 280);
 | 
			
		||||
    DWINUI::Draw_Icon(ICON_Continue_E, 146, 280);
 | 
			
		||||
    Draw_Select_Highlight(true);
 | 
			
		||||
@@ -1928,7 +1935,7 @@ void DWIN_Redraw_screen() {
 | 
			
		||||
#if HAS_MESH
 | 
			
		||||
  void DWIN_MeshViewer() {
 | 
			
		||||
    if (!leveling_is_valid())
 | 
			
		||||
      DWIN_Popup_Continue(ICON_BLTouch, "Mesh viewer", "No valid mesh");
 | 
			
		||||
      DWIN_Popup_Continue(ICON_BLTouch, F("Mesh viewer"), F("No valid mesh"));
 | 
			
		||||
    else {
 | 
			
		||||
      HMI_SaveProcessID(WaitResponse);
 | 
			
		||||
      MeshViewer.Draw();
 | 
			
		||||
 
 | 
			
		||||
@@ -152,16 +152,6 @@ extern HMI_data_t HMI_data;
 | 
			
		||||
extern uint8_t checkkey;
 | 
			
		||||
extern millis_t dwin_heat_time;
 | 
			
		||||
 | 
			
		||||
// Popup windows
 | 
			
		||||
void DWIN_Popup_Confirm(uint8_t icon, const char * const msg1, const char * const msg2);
 | 
			
		||||
#if HAS_HOTEND || HAS_HEATED_BED
 | 
			
		||||
  void DWIN_Popup_Temperature(const bool toohigh);
 | 
			
		||||
#endif
 | 
			
		||||
#if HAS_HOTEND
 | 
			
		||||
  void Popup_Window_ETempTooLow();
 | 
			
		||||
#endif
 | 
			
		||||
void Popup_Window_Resume();
 | 
			
		||||
 | 
			
		||||
// SD Card
 | 
			
		||||
void HMI_SDCardInit();
 | 
			
		||||
void HMI_SDCardUpdate();
 | 
			
		||||
@@ -278,3 +268,23 @@ void Draw_Steps_Menu();
 | 
			
		||||
#if EITHER(HAS_BED_PROBE, BABYSTEPPING)
 | 
			
		||||
  void Draw_ZOffsetWiz_Menu();
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Popup windows
 | 
			
		||||
 | 
			
		||||
void DWIN_Draw_Popup(const uint8_t icon, const char * const cmsg1, FSTR_P const fmsg2, uint8_t button=0);
 | 
			
		||||
void DWIN_Draw_Popup(const uint8_t icon, FSTR_P const fmsg1=nullptr, FSTR_P const fmsg2=nullptr, uint8_t button=0);
 | 
			
		||||
 | 
			
		||||
template<typename T, typename U>
 | 
			
		||||
void DWIN_Popup_Confirm(const uint8_t icon, T amsg1, U amsg2) {
 | 
			
		||||
  HMI_SaveProcessID(WaitResponse);
 | 
			
		||||
  DWIN_Draw_Popup(icon, amsg1, amsg2, ICON_Confirm_E);  // Button Confirm
 | 
			
		||||
  DWIN_UpdateLCD();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if HAS_HOTEND || HAS_HEATED_BED
 | 
			
		||||
  void DWIN_Popup_Temperature(const bool toohigh);
 | 
			
		||||
#endif
 | 
			
		||||
#if HAS_HOTEND
 | 
			
		||||
  void Popup_Window_ETempTooLow();
 | 
			
		||||
#endif
 | 
			
		||||
void Popup_Window_Resume();
 | 
			
		||||
 
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -175,7 +175,9 @@ public:
 | 
			
		||||
  static uint16_t GetColor(uint8_t color, uint16_t original, bool light=false);
 | 
			
		||||
  static void Draw_Checkbox(uint8_t row, bool value);
 | 
			
		||||
  static void Draw_Title(const char * title);
 | 
			
		||||
  static void Draw_Title(FSTR_P const title);
 | 
			
		||||
  static void Draw_Menu_Item(uint8_t row, uint8_t icon=0, const char * const label1=nullptr, const char * const label2=nullptr, bool more=false, bool centered=false);
 | 
			
		||||
  static void Draw_Menu_Item(uint8_t row, uint8_t icon=0, FSTR_P const flabel1=nullptr, FSTR_P const flabel2=nullptr, bool more=false, bool centered=false);
 | 
			
		||||
  static void Draw_Menu(uint8_t menu, uint8_t select=0, uint8_t scroll=0);
 | 
			
		||||
  static void Redraw_Menu(bool lastprocess=true, bool lastselection=false, bool lastmenu=false);
 | 
			
		||||
  static void Redraw_Screen();
 | 
			
		||||
@@ -194,7 +196,7 @@ public:
 | 
			
		||||
  static void Draw_SD_Item(uint8_t item, uint8_t row);
 | 
			
		||||
  static void Draw_SD_List(bool removed=false);
 | 
			
		||||
  static void Draw_Status_Area(bool icons=false);
 | 
			
		||||
  static void Draw_Popup(PGM_P const line1, PGM_P const line2, PGM_P const line3, uint8_t mode, uint8_t icon=0);
 | 
			
		||||
  static void Draw_Popup(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, uint8_t mode, uint8_t icon=0);
 | 
			
		||||
  static void Popup_Select();
 | 
			
		||||
  static void Update_Status_Bar(bool refresh=false);
 | 
			
		||||
 | 
			
		||||
@@ -203,7 +205,7 @@ public:
 | 
			
		||||
    static void Set_Mesh_Viewer_Status();
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
  static const char * Get_Menu_Title(uint8_t menu);
 | 
			
		||||
  static FSTR_P Get_Menu_Title(uint8_t menu);
 | 
			
		||||
  static uint8_t Get_Menu_Size(uint8_t menu);
 | 
			
		||||
  static void Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw=true);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user