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.

language_menu.cpp 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*********************
  2. * language_menu.cpp *
  3. *********************/
  4. /****************************************************************************
  5. * Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
  6. * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
  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. * To view a copy of the GNU General Public License, go to the following *
  19. * location: <http://www.gnu.org/licenses/>. *
  20. ****************************************************************************/
  21. #include "../config.h"
  22. #if ENABLED(LULZBOT_TOUCH_UI) && defined(TOUCH_UI_LANGUAGE_MENU)
  23. #include "screens.h"
  24. using namespace FTDI;
  25. using namespace Theme;
  26. void LanguageMenu::onRedraw(draw_mode_t) {
  27. CommandProcessor cmd;
  28. cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color))
  29. .cmd(CLEAR(true,true,true))
  30. .colors(normal_btn)
  31. .font(Theme::font_medium);
  32. #define GRID_ROWS 8
  33. #define GRID_COLS 1
  34. for (uint8_t i = 0; i < get_language_count(); i++)
  35. cmd.tag(1 + i).button(BTN_POS(1,i + 1), BTN_SIZE(1,1), get_text(i, String_Indices::LANGUAGE));
  36. }
  37. bool LanguageMenu::onTouchEnd(uint8_t tag) {
  38. const uint8_t lang = tag - 1;
  39. if (tag != 0) {
  40. set_language(lang);
  41. GOTO_SCREEN(StatusScreen);
  42. return true;
  43. }
  44. return false;
  45. }
  46. #endif // LULZBOT_TOUCH_UI