VCV Rack API
v2
Loading...
Searching...
No Matches
ScrollWidget.hpp
Go to the documentation of this file.
1
#pragma once
2
#include <
ui/common.hpp
>
3
#include <
widget/OpaqueWidget.hpp
>
4
#include <
ui/Scrollbar.hpp
>
5
6
7
namespace
rack
{
8
namespace
ui {
9
10
12
struct
ScrollWidget
:
widget::OpaqueWidget
{
13
struct
Internal;
14
Internal*
internal
;
15
16
widget::Widget
*
container
;
17
Scrollbar
*
horizontalScrollbar
;
18
Scrollbar
*
verticalScrollbar
;
19
20
math::Vec
offset
;
21
math::Rect
containerBox
;
22
bool
hideScrollbars
=
false
;
23
24
ScrollWidget
();
25
~ScrollWidget
();
26
math::Vec
getScrollOffset
() {
27
return
offset
;
28
}
29
void
scrollTo
(
math::Rect
r);
31
math::Rect
getContainerOffsetBound
();
33
math::Vec
getHandleOffset
();
35
math::Vec
getHandleSize
();
37
bool
isScrolling
();
38
void
draw
(
const
DrawArgs
& args)
override
;
39
void
step
()
override
;
40
void
onHover
(
const
HoverEvent
& e)
override
;
41
void
onButton
(
const
ButtonEvent
& e)
override
;
42
void
onDragStart
(
const
DragStartEvent
& e)
override
;
43
void
onDragMove
(
const
DragMoveEvent
& e)
override
;
44
void
onHoverScroll
(
const
HoverScrollEvent
& e)
override
;
45
void
onHoverKey
(
const
HoverKeyEvent
& e)
override
;
46
};
47
48
49
}
// namespace ui
50
}
// namespace rack
OpaqueWidget.hpp
Scrollbar.hpp
rack
Root namespace for the Rack API.
Definition
AudioDisplay.hpp:9
rack::math::Rect
2-dimensional rectangle for graphics.
Definition
math.hpp:301
rack::math::Vec
2-dimensional vector of floats, representing a point on the plane for graphics.
Definition
math.hpp:189
rack::ui::ScrollWidget
Handles a container with Scrollbar.
Definition
ScrollWidget.hpp:12
rack::ui::ScrollWidget::step
void step() override
Advances the module by one frame.
rack::ui::ScrollWidget::container
widget::Widget * container
Definition
ScrollWidget.hpp:16
rack::ui::ScrollWidget::onDragMove
void onDragMove(const DragMoveEvent &e) override
rack::ui::ScrollWidget::scrollTo
void scrollTo(math::Rect r)
rack::ui::ScrollWidget::hideScrollbars
bool hideScrollbars
Definition
ScrollWidget.hpp:22
rack::ui::ScrollWidget::onHover
void onHover(const HoverEvent &e) override
rack::ui::ScrollWidget::internal
Internal * internal
Definition
ScrollWidget.hpp:14
rack::ui::ScrollWidget::getContainerOffsetBound
math::Rect getContainerOffsetBound()
Returns the bound of allowed offset values in pixels.
rack::ui::ScrollWidget::getScrollOffset
math::Vec getScrollOffset()
Definition
ScrollWidget.hpp:26
rack::ui::ScrollWidget::getHandleOffset
math::Vec getHandleOffset()
Returns the handle position relative to the scrollbar.
rack::ui::ScrollWidget::offset
math::Vec offset
Definition
ScrollWidget.hpp:20
rack::ui::ScrollWidget::ScrollWidget
ScrollWidget()
rack::ui::ScrollWidget::horizontalScrollbar
Scrollbar * horizontalScrollbar
Definition
ScrollWidget.hpp:17
rack::ui::ScrollWidget::onDragStart
void onDragStart(const DragStartEvent &e) override
rack::ui::ScrollWidget::~ScrollWidget
~ScrollWidget()
rack::ui::ScrollWidget::getHandleSize
math::Vec getHandleSize()
Returns the handle size relative to the scrollbar.
rack::ui::ScrollWidget::onHoverKey
void onHoverKey(const HoverKeyEvent &e) override
rack::ui::ScrollWidget::onButton
void onButton(const ButtonEvent &e) override
rack::ui::ScrollWidget::containerBox
math::Rect containerBox
Definition
ScrollWidget.hpp:21
rack::ui::ScrollWidget::verticalScrollbar
Scrollbar * verticalScrollbar
Definition
ScrollWidget.hpp:18
rack::ui::ScrollWidget::isScrolling
bool isScrolling()
The user is considered scrolling with the wheel until the mouse is moved.
rack::ui::ScrollWidget::draw
void draw(const DrawArgs &args) override
Draws the widget to the NanoVG context.
rack::ui::ScrollWidget::onHoverScroll
void onHoverScroll(const HoverScrollEvent &e) override
rack::ui::Scrollbar
Parent must be a ScrollWidget.
Definition
Scrollbar.hpp:11
rack::widget::OpaqueWidget
A Widget that stops propagation of all recursive PositionEvents (such as ButtonEvent) but gives a cha...
Definition
OpaqueWidget.hpp:12
rack::widget::Widget::ButtonEvent
Occurs each mouse button press or release.
Definition
Widget.hpp:237
rack::widget::Widget::DragMoveEvent
Occurs every frame on the dragged Widget.
Definition
Widget.hpp:381
rack::widget::Widget::DragStartEvent
Occurs when a Widget begins being dragged.
Definition
Widget.hpp:369
rack::widget::Widget::DrawArgs
Definition
Widget.hpp:141
rack::widget::Widget::HoverEvent
Occurs every frame when the mouse is hovering over a Widget.
Definition
Widget.hpp:225
rack::widget::Widget::HoverKeyEvent
Occurs when a key is pressed, released, or repeated while the mouse is hovering a Widget.
Definition
Widget.hpp:294
rack::widget::Widget::HoverScrollEvent
Occurs when the mouse scroll wheel is moved while the mouse is hovering a Widget.
Definition
Widget.hpp:315
rack::widget::Widget
A node in the 2D scene graph.
Definition
Widget.hpp:21
common.hpp
include
ui
ScrollWidget.hpp
Generated by
1.12.0