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.

38 lines
788B

  1. #pragma once
  2. #include "widget/Widget.hpp"
  3. namespace rack {
  4. namespace widget {
  5. /** Widget that consumes recursing events without giving a chance for children to consume.
  6. */
  7. struct ObstructWidget : Widget {
  8. void onHover(const event::Hover &e) override {
  9. e.consume(this);
  10. }
  11. void onButton(const event::Button &e) override {
  12. e.consume(this);
  13. }
  14. void onHoverKey(const event::HoverKey &e) override {
  15. e.consume(this);
  16. }
  17. void onHoverText(const event::HoverText &e) override {
  18. e.consume(this);
  19. }
  20. void onHoverScroll(const event::HoverScroll &e) override {
  21. e.consume(this);
  22. }
  23. void onDragHover(const event::DragHover &e) override {
  24. e.consume(this);
  25. }
  26. void onPathDrop(const event::PathDrop &e) override {
  27. e.consume(this);
  28. }
  29. };
  30. } // namespace widget
  31. } // namespace rack