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 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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
  25. * Version: 3.8.1
  26. * Date: 2021/11/06
  27. */
  28. #include "dwin.h"
  29. #include "dwin_popup.h"
  30. void Draw_Select_Highlight(const bool sel) {
  31. HMI_flag.select_flag = sel;
  32. const uint16_t c1 = sel ? HMI_data.Highlight_Color : HMI_data.PopupBg_color,
  33. c2 = sel ? HMI_data.PopupBg_color : HMI_data.Highlight_Color;
  34. DWIN_Draw_Rectangle(0, c1, 25, 279, 126, 318);
  35. DWIN_Draw_Rectangle(0, c1, 24, 278, 127, 319);
  36. DWIN_Draw_Rectangle(0, c2, 145, 279, 246, 318);
  37. DWIN_Draw_Rectangle(0, c2, 144, 278, 247, 319);
  38. }
  39. void DWIN_Popup_Continue(const uint8_t icon, FSTR_P const fmsg1, FSTR_P const fmsg2) {
  40. HMI_SaveProcessID(WaitResponse);
  41. DWIN_Draw_Popup(icon, fmsg1, fmsg2, ICON_Continue_E); // Button Continue
  42. DWIN_UpdateLCD();
  43. }
  44. void DWIN_Popup_ConfirmCancel(const uint8_t icon, FSTR_P const fmsg2) {
  45. DWIN_Draw_Popup(ICON_BLTouch, F("Please confirm"), fmsg2);
  46. DWINUI::Draw_Icon(ICON_Confirm_E, 26, 280);
  47. DWINUI::Draw_Icon(ICON_Cancel_E, 146, 280);
  48. Draw_Select_Highlight(true);
  49. DWIN_UpdateLCD();
  50. }