My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

preheat_menu.cpp 3.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /********************
  2. * preheat_menu.cpp *
  3. ********************/
  4. /****************************************************************************
  5. * Written By Marcio Teixeira 2020 - Cocoa Press *
  6. * *
  7. * This program is free software: you can redistribute it and/or modify *
  8. * it under the terms of the GNU General Public License as published by *
  9. * the Free Software Foundation, either version 3 of the License, or *
  10. * (at your option) any later version. *
  11. * *
  12. * This program is distributed in the hope that it will be useful, *
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  15. * GNU General Public License for more details. *
  16. * *
  17. * To view a copy of the GNU General Public License, go to the following *
  18. * location: <https://www.gnu.org/licenses/>. *
  19. ****************************************************************************/
  20. #include "../config.h"
  21. #if ENABLED(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_COCOA_PRESS)
  22. #include "screens.h"
  23. using namespace FTDI;
  24. using namespace ExtUI;
  25. using namespace Theme;
  26. void PreheatMenu::onRedraw(draw_mode_t what) {
  27. if (what & BACKGROUND) {
  28. CommandProcessor cmd;
  29. cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color))
  30. .cmd(CLEAR(true,true,true))
  31. .tag(0);
  32. }
  33. #define GRID_ROWS 3
  34. #define GRID_COLS 2
  35. if (what & FOREGROUND) {
  36. CommandProcessor cmd;
  37. cmd.cmd(COLOR_RGB(bg_text_enabled))
  38. .font(Theme::font_medium)
  39. .text ( BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_PREHEAT_1))
  40. .colors(normal_btn)
  41. .tag(2).button( BTN_POS(1,2), BTN_SIZE(1,1), F("Dark Chocolate"))
  42. .tag(3).button( BTN_POS(2,2), BTN_SIZE(1,1), F("Milk Chocolate"))
  43. .tag(4).button( BTN_POS(1,3), BTN_SIZE(1,1), F("White Chocolate"))
  44. .colors(action_btn)
  45. .tag(1) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACK));
  46. }
  47. }
  48. bool PreheatMenu::onTouchEnd(uint8_t tag) {
  49. switch (tag) {
  50. case 1: GOTO_PREVIOUS(); break;
  51. case 2:
  52. #ifdef COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_SCRIPT
  53. injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_SCRIPT));
  54. #endif
  55. GOTO_SCREEN(PreheatTimerScreen);
  56. break;
  57. case 3:
  58. #ifdef COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_SCRIPT
  59. injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_SCRIPT));
  60. #endif
  61. GOTO_SCREEN(PreheatTimerScreen);
  62. break;
  63. case 4:
  64. #ifdef COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_SCRIPT
  65. injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_SCRIPT));
  66. #endif
  67. GOTO_SCREEN(PreheatTimerScreen);
  68. break;
  69. default: return false;
  70. }
  71. return true;
  72. }
  73. #endif // TOUCH_UI_FTDI_EVE