VCV Rack API
v2
Loading...
Searching...
No Matches
OpaqueWidget.hpp
Go to the documentation of this file.
1
#pragma once
2
#include <
widget/Widget.hpp
>
3
4
5
namespace
rack
{
6
namespace
widget {
7
8
12
struct
OpaqueWidget
:
Widget
{
13
void
onHover
(
const
HoverEvent
& e)
override
{
14
Widget::onHover
(e);
15
e.
stopPropagating
();
16
// Consume if not consumed by child
17
if
(!e.
isConsumed
())
18
e.
consume
(
this
);
19
}
20
void
onButton
(
const
ButtonEvent
& e)
override
{
21
Widget::onButton
(e);
22
e.
stopPropagating
();
23
if
(e.
button
== GLFW_MOUSE_BUTTON_LEFT) {
24
// Consume if not consumed by child
25
if
(!e.
isConsumed
())
26
e.
consume
(
this
);
27
}
28
}
29
void
onHoverKey
(
const
HoverKeyEvent
& e)
override
{
30
Widget::onHoverKey
(e);
31
e.
stopPropagating
();
32
}
33
void
onHoverText
(
const
HoverTextEvent
& e)
override
{
34
Widget::onHoverText
(e);
35
e.
stopPropagating
();
36
}
37
void
onHoverScroll
(
const
HoverScrollEvent
& e)
override
{
38
Widget::onHoverScroll
(e);
39
e.
stopPropagating
();
40
}
41
void
onDragHover
(
const
DragHoverEvent
& e)
override
{
42
Widget::onDragHover
(e);
43
e.
stopPropagating
();
44
// Consume if not consumed by child
45
if
(!e.
isConsumed
())
46
e.
consume
(
this
);
47
}
48
void
onPathDrop
(
const
PathDropEvent
& e)
override
{
49
Widget::onPathDrop
(e);
50
e.
stopPropagating
();
51
}
52
};
53
54
55
}
// namespace widget
56
}
// namespace rack
Widget.hpp
rack
Root namespace for the Rack API.
Definition
AudioDisplay.hpp:9
rack::widget::BaseEvent::stopPropagating
void stopPropagating() const
Prevents the event from being handled by more Widgets.
Definition
event.hpp:67
rack::widget::BaseEvent::isConsumed
bool isConsumed() const
Definition
event.hpp:105
rack::widget::BaseEvent::consume
void consume(Widget *w) const
Sets the target Widget and stops propagating.
Definition
event.hpp:93
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::OpaqueWidget::onDragHover
void onDragHover(const DragHoverEvent &e) override
Definition
OpaqueWidget.hpp:41
rack::widget::OpaqueWidget::onHoverKey
void onHoverKey(const HoverKeyEvent &e) override
Definition
OpaqueWidget.hpp:29
rack::widget::OpaqueWidget::onHoverText
void onHoverText(const HoverTextEvent &e) override
Definition
OpaqueWidget.hpp:33
rack::widget::OpaqueWidget::onHoverScroll
void onHoverScroll(const HoverScrollEvent &e) override
Definition
OpaqueWidget.hpp:37
rack::widget::OpaqueWidget::onButton
void onButton(const ButtonEvent &e) override
Definition
OpaqueWidget.hpp:20
rack::widget::OpaqueWidget::onHover
void onHover(const HoverEvent &e) override
Definition
OpaqueWidget.hpp:13
rack::widget::OpaqueWidget::onPathDrop
void onPathDrop(const PathDropEvent &e) override
Definition
OpaqueWidget.hpp:48
rack::widget::Widget::ButtonEvent
Occurs each mouse button press or release.
Definition
Widget.hpp:237
rack::widget::Widget::ButtonEvent::button
int button
GLFW_MOUSE_BUTTON_LEFT, GLFW_MOUSE_BUTTON_RIGHT, GLFW_MOUSE_BUTTON_MIDDLE, etc.
Definition
Widget.hpp:239
rack::widget::Widget::DragHoverEvent
Occurs every frame when the mouse is hovering over a Widget while another Widget (possibly the same o...
Definition
Widget.hpp:391
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::HoverTextEvent
Occurs when a character is typed while the mouse is hovering a Widget.
Definition
Widget.hpp:307
rack::widget::Widget::PathDropEvent
Occurs when a selection of files from the operating system is dropped onto a Widget.
Definition
Widget.hpp:432
rack::widget::Widget
A node in the 2D scene graph.
Definition
Widget.hpp:21
rack::widget::Widget::onHoverKey
virtual void onHoverKey(const HoverKeyEvent &e)
Definition
Widget.hpp:295
rack::widget::Widget::onHover
virtual void onHover(const HoverEvent &e)
Definition
Widget.hpp:229
rack::widget::Widget::onHoverText
virtual void onHoverText(const HoverTextEvent &e)
Definition
Widget.hpp:308
rack::widget::Widget::onPathDrop
virtual void onPathDrop(const PathDropEvent &e)
Definition
Widget.hpp:438
rack::widget::Widget::onHoverScroll
virtual void onHoverScroll(const HoverScrollEvent &e)
Definition
Widget.hpp:319
rack::widget::Widget::onButton
virtual void onButton(const ButtonEvent &e)
Definition
Widget.hpp:245
rack::widget::Widget::onDragHover
virtual void onDragHover(const DragHoverEvent &e)
Definition
Widget.hpp:397
include
widget
OpaqueWidget.hpp
Generated by
1.12.0