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.

32 lines
622B

  1. #pragma once
  2. #include "widget/Widget.hpp"
  3. namespace rack {
  4. namespace widget {
  5. /** A Widget that consumes recursing events without giving a chance for children to consume.
  6. */
  7. struct ObstructWidget : Widget {
  8. void onHover(const HoverEvent &e) override {
  9. e.consume(this);
  10. }
  11. void onButton(const ButtonEvent &e) override {
  12. e.consume(this);
  13. }
  14. void onHoverKey(const HoverKeyEvent &e) override {
  15. e.consume(this);
  16. }
  17. void onHoverText(const HoverTextEvent &e) override {
  18. e.consume(this);
  19. }
  20. void onDragHover(const DragHoverEvent &e) override {
  21. e.consume(this);
  22. }
  23. };
  24. } // namespace widget
  25. } // namespace rack