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.

31 lines
708B

  1. #pragma once
  2. #include <ui/common.hpp>
  3. #include <widget/OpaqueWidget.hpp>
  4. #include <ui/ScrollBar.hpp>
  5. namespace rack {
  6. namespace ui {
  7. /** Handles a container with ScrollBar */
  8. struct ScrollWidget : widget::OpaqueWidget {
  9. widget::Widget* container;
  10. ScrollBar* horizontalScrollBar;
  11. ScrollBar* verticalScrollBar;
  12. math::Vec offset;
  13. ScrollWidget();
  14. void scrollTo(math::Rect r);
  15. void draw(const DrawArgs& args) override;
  16. void step() override;
  17. void onButton(const event::Button& e) override;
  18. void onDragStart(const event::DragStart& e) override;
  19. void onDragMove(const event::DragMove& e) override;
  20. void onHoverScroll(const event::HoverScroll& e) override;
  21. };
  22. } // namespace ui
  23. } // namespace rack