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.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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: <https://www.gnu.org/licenses/>. *
  20. ****************************************************************************/
  21. #include "../config.h"
  22. #include "../screens.h"
  23. #ifdef FTDI_LANGUAGE_MENU
  24. #include "../language/language.h"
  25. using namespace FTDI;
  26. using namespace Theme;
  27. void LanguageMenu::onRedraw(draw_mode_t) {
  28. CommandProcessor cmd;
  29. cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color))
  30. .cmd(CLEAR(true,true,true))
  31. .colors(normal_btn)
  32. .font(Theme::font_medium);
  33. #define GRID_COLS 1
  34. #define GRID_ROWS 8
  35. cmd.tag(1).button(BTN_POS(1,1), BTN_SIZE(1,1), GET_LANGUAGE_NAME(1));
  36. cmd.tag(2).button(BTN_POS(1,2), BTN_SIZE(1,1), GET_LANGUAGE_NAME(2));
  37. #if NUM_LANGUAGES > 2
  38. cmd.tag(3).button(BTN_POS(1,3), BTN_SIZE(1,1), GET_LANGUAGE_NAME(3));
  39. #if NUM_LANGUAGES > 3
  40. cmd.tag(4).button(BTN_POS(1,4), BTN_SIZE(1,1), GET_LANGUAGE_NAME(4));
  41. #if NUM_LANGUAGES > 5
  42. cmd.tag(5).button(BTN_POS(1,5), BTN_SIZE(1,1), GET_LANGUAGE_NAME(5));
  43. #endif
  44. #endif
  45. #endif
  46. }
  47. bool LanguageMenu::onTouchEnd(uint8_t tag) {
  48. if (tag > 0 && tag <= NUM_LANGUAGES) {
  49. lang = tag - 1;
  50. GOTO_SCREEN(StatusScreen);
  51. return true;
  52. }
  53. return false;
  54. }
  55. #endif // FTDI_LANGUAGE_MENU