My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dwin_popup.cpp 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. /**
  23. * DWIN UI Enhanced implementation
  24. * Author: Miguel A. Risco-Castillo (MRISCOC)
  25. * Version: 3.10.1
  26. * Date: 2022/01/21
  27. *
  28. * Based on the original code provided by Creality under GPL
  29. */
  30. #include "../../../inc/MarlinConfigPre.h"
  31. #if ENABLED(DWIN_LCD_PROUI)
  32. #include "dwin.h"
  33. #include "dwin_popup.h"
  34. void Draw_Select_Highlight(const bool sel) {
  35. HMI_flag.select_flag = sel;
  36. const uint16_t c1 = sel ? HMI_data.Highlight_Color : HMI_data.PopupBg_color,
  37. c2 = sel ? HMI_data.PopupBg_color : HMI_data.Highlight_Color;
  38. DWIN_Draw_Rectangle(0, c1, 25, 279, 126, 318);
  39. DWIN_Draw_Rectangle(0, c1, 24, 278, 127, 319);
  40. DWIN_Draw_Rectangle(0, c2, 145, 279, 246, 318);
  41. DWIN_Draw_Rectangle(0, c2, 144, 278, 247, 319);
  42. }
  43. void DWIN_Popup_Continue(const uint8_t icon, FSTR_P const fmsg1, FSTR_P const fmsg2) {
  44. HMI_SaveProcessID(WaitResponse);
  45. DWIN_Draw_Popup(icon, fmsg1, fmsg2, ICON_Continue_E); // Button Continue
  46. DWIN_UpdateLCD();
  47. }
  48. void DWIN_Popup_ConfirmCancel(const uint8_t icon, FSTR_P const fmsg2) {
  49. DWIN_Draw_Popup(ICON_BLTouch, F("Please confirm"), fmsg2);
  50. DWINUI::Draw_IconWB(ICON_Confirm_E, 26, 280);
  51. DWINUI::Draw_IconWB(ICON_Cancel_E, 146, 280);
  52. Draw_Select_Highlight(true);
  53. DWIN_UpdateLCD();
  54. }
  55. #endif // DWIN_LCD_PROUI