VCV Rack API v2
Loading...
Searching...
No Matches
ParamWidget.hpp
Go to the documentation of this file.
1#pragma once
2#include <app/common.hpp>
4#include <ui/Tooltip.hpp>
5#include <ui/Menu.hpp>
7
8
9namespace rack {
10namespace app {
11
12
15 struct Internal;
16 Internal* internal;
17
18 engine::Module* module = NULL;
19 int paramId = -1;
20
26 virtual void initParamQuantity() {}
30
31 void step() override;
32 void draw(const DrawArgs& args) override;
33
34 void onButton(const ButtonEvent& e) override;
35 void onDoubleClick(const DoubleClickEvent& e) override;
36 void onEnter(const EnterEvent& e) override;
37 void onLeave(const LeaveEvent& e) override;
38
45 virtual void appendContextMenu(ui::Menu* menu) {}
47};
48
49
50} // namespace app
51} // namespace rack
Root namespace for the Rack API.
Definition AudioDisplay.hpp:9
Manages an engine::Param on a ModuleWidget.
Definition ParamWidget.hpp:14
virtual void initParamQuantity()
Configures ParamQuantity properties based on the type of ParamWidget.
Definition ParamWidget.hpp:26
void onLeave(const LeaveEvent &e) override
virtual void appendContextMenu(ui::Menu *menu)
Override to add custom menu items at the bottom of the parameter context menu.
Definition ParamWidget.hpp:45
void onDoubleClick(const DoubleClickEvent &e) override
void step() override
Advances the module by one frame.
engine::ParamQuantity * getParamQuantity()
void draw(const DrawArgs &args) override
Draws the widget to the NanoVG context.
void onEnter(const EnterEvent &e) override
int paramId
Definition ParamWidget.hpp:19
void onButton(const ButtonEvent &e) override
Internal * internal
Definition ParamWidget.hpp:16
DSP processor instance for your module.
Definition Module.hpp:29
A Quantity that wraps an engine::Param.
Definition ParamQuantity.hpp:21
Definition Menu.hpp:11
A Widget that stops propagation of all recursive PositionEvents (such as ButtonEvent) but gives a cha...
Definition OpaqueWidget.hpp:12
Occurs each mouse button press or release.
Definition Widget.hpp:237
Occurs when the left mouse button is pressed a second time on the same Widget within a time duration.
Definition Widget.hpp:252
Definition Widget.hpp:141
Occurs when a Widget begins consuming the Hover event.
Definition Widget.hpp:327
Occurs when a different Widget is entered.
Definition Widget.hpp:333