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.

Button.hpp 640B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. #include "widgets/OpaqueWidget.hpp"
  3. #include "ui/common.hpp"
  4. #include "ui/Quantity.hpp"
  5. namespace rack {
  6. struct Button : OpaqueWidget {
  7. std::string text;
  8. BNDwidgetState state = BND_DEFAULT;
  9. /** Optional, owned. Tracks the pressed state of the button.*/
  10. Quantity *quantity = NULL;
  11. Button();
  12. ~Button();
  13. void draw(NVGcontext *vg) override;
  14. void onEnter(const event::Enter &e) override;
  15. void onLeave(const event::Leave &e) override;
  16. void onDragStart(const event::DragStart &e) override;
  17. void onDragEnd(const event::DragEnd &e) override;
  18. void onDragDrop(const event::DragDrop &e) override;
  19. };
  20. } // namespace rack