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.

LedDisplay.hpp 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #pragma once
  2. #include <app/common.hpp>
  3. #include <widget/Widget.hpp>
  4. #include <widget/OpaqueWidget.hpp>
  5. #include <ui/TextField.hpp>
  6. namespace rack {
  7. namespace app {
  8. struct LedDisplay : widget::Widget {
  9. void draw(const DrawArgs& args) override;
  10. void drawLayer(const DrawArgs& args, int layer) override;
  11. };
  12. struct LedDisplaySeparator : widget::Widget {
  13. LedDisplaySeparator();
  14. void draw(const DrawArgs& args) override;
  15. };
  16. struct LedDisplayChoice : widget::OpaqueWidget {
  17. std::string text;
  18. std::string fontPath;
  19. math::Vec textOffset;
  20. NVGcolor color;
  21. NVGcolor bgColor;
  22. LedDisplayChoice();
  23. void draw(const DrawArgs& args) override;
  24. void drawLayer(const DrawArgs& args, int layer) override;
  25. void onButton(const ButtonEvent& e) override;
  26. };
  27. struct LedDisplayTextField : ui::TextField {
  28. std::string fontPath;
  29. math::Vec textOffset;
  30. NVGcolor color;
  31. NVGcolor bgColor;
  32. LedDisplayTextField();
  33. void draw(const DrawArgs& args) override;
  34. void drawLayer(const DrawArgs& args, int layer) override;
  35. int getTextPosition(math::Vec mousePos) override;
  36. };
  37. } // namespace app
  38. } // namespace rack