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
5namespace rack {
6namespace widget {
7
8
13 void onHover(const HoverEvent& e) override {
16 // Consume if not consumed by child
17 if (!e.isConsumed())
18 e.consume(this);
19 }
20 void onButton(const ButtonEvent& e) override {
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 {
32 }
33 void onHoverText(const HoverTextEvent& e) override {
36 }
37 void onHoverScroll(const HoverScrollEvent& e) override {
40 }
41 void onDragHover(const DragHoverEvent& e) override {
44 // Consume if not consumed by child
45 if (!e.isConsumed())
46 e.consume(this);
47 }
48 void onPathDrop(const PathDropEvent& e) override {
51 }
52};
53
54
55} // namespace widget
56} // namespace rack
Root namespace for the Rack API.
Definition AudioDisplay.hpp:9
void stopPropagating() const
Prevents the event from being handled by more Widgets.
Definition event.hpp:67
bool isConsumed() const
Definition event.hpp:105
void consume(Widget *w) const
Sets the target Widget and stops propagating.
Definition event.hpp:93
A Widget that stops propagation of all recursive PositionEvents (such as ButtonEvent) but gives a cha...
Definition OpaqueWidget.hpp:12
void onDragHover(const DragHoverEvent &e) override
Definition OpaqueWidget.hpp:41
void onHoverKey(const HoverKeyEvent &e) override
Definition OpaqueWidget.hpp:29
void onHoverText(const HoverTextEvent &e) override
Definition OpaqueWidget.hpp:33
void onHoverScroll(const HoverScrollEvent &e) override
Definition OpaqueWidget.hpp:37
void onButton(const ButtonEvent &e) override
Definition OpaqueWidget.hpp:20
void onHover(const HoverEvent &e) override
Definition OpaqueWidget.hpp:13
void onPathDrop(const PathDropEvent &e) override
Definition OpaqueWidget.hpp:48
Occurs each mouse button press or release.
Definition Widget.hpp:237
int button
GLFW_MOUSE_BUTTON_LEFT, GLFW_MOUSE_BUTTON_RIGHT, GLFW_MOUSE_BUTTON_MIDDLE, etc.
Definition Widget.hpp:239
Occurs every frame when the mouse is hovering over a Widget while another Widget (possibly the same o...
Definition Widget.hpp:391
Occurs every frame when the mouse is hovering over a Widget.
Definition Widget.hpp:225
Occurs when a key is pressed, released, or repeated while the mouse is hovering a Widget.
Definition Widget.hpp:294
Occurs when the mouse scroll wheel is moved while the mouse is hovering a Widget.
Definition Widget.hpp:315
Occurs when a character is typed while the mouse is hovering a Widget.
Definition Widget.hpp:307
Occurs when a selection of files from the operating system is dropped onto a Widget.
Definition Widget.hpp:432
A node in the 2D scene graph.
Definition Widget.hpp:21
virtual void onHoverKey(const HoverKeyEvent &e)
Definition Widget.hpp:295
virtual void onHover(const HoverEvent &e)
Definition Widget.hpp:229
virtual void onHoverText(const HoverTextEvent &e)
Definition Widget.hpp:308
virtual void onPathDrop(const PathDropEvent &e)
Definition Widget.hpp:438
virtual void onHoverScroll(const HoverScrollEvent &e)
Definition Widget.hpp:319
virtual void onButton(const ButtonEvent &e)
Definition Widget.hpp:245
virtual void onDragHover(const DragHoverEvent &e)
Definition Widget.hpp:397