VCV Rack API v2
Loading...
Searching...
No Matches
MenuItem.hpp
Go to the documentation of this file.
1#pragma once
2#include <ui/common.hpp>
3#include <ui/Menu.hpp>
4#include <ui/MenuEntry.hpp>
5#include <context.hpp>
6
7
8namespace rack {
9namespace ui {
10
11
13 std::string text;
14 std::string rightText;
15 bool disabled = false;
16
17 void draw(const DrawArgs& args) override;
18 PRIVATE void drawOffset(NVGcontext* vg, float offset = 0);
19 void step() override;
20 void onEnter(const EnterEvent& e) override;
21 void onDragDrop(const DragDropEvent& e) override;
22 void doAction(bool consume = true);
23 virtual Menu* createChildMenu() {
24 return NULL;
25 }
30 void onAction(const ActionEvent& e) override;
31};
32
33
36
37 void draw(const DrawArgs& args) override;
38 void step() override;
39};
40
41
42} // namespace ui
43} // namespace rack
#define PRIVATE
Attribute for private functions not intended to be called by plugins.
Definition common.hpp:32
static const NVGcolor BLACK_TRANSPARENT
Definition color.hpp:13
Root namespace for the Rack API.
Definition AudioDisplay.hpp:9
Definition MenuItem.hpp:34
void draw(const DrawArgs &args) override
Draws the widget to the NanoVG context.
void step() override
Advances the module by one frame.
NVGcolor color
Definition MenuItem.hpp:35
Definition MenuEntry.hpp:10
Definition MenuItem.hpp:12
void draw(const DrawArgs &args) override
Draws the widget to the NanoVG context.
void doAction(bool consume=true)
void onAction(const ActionEvent &e) override
Override to handle behavior when user clicks the menu item.
bool disabled
Definition MenuItem.hpp:15
std::string text
Definition MenuItem.hpp:13
virtual Menu * createChildMenu()
Definition MenuItem.hpp:23
PRIVATE void drawOffset(NVGcontext *vg, float offset=0)
void onEnter(const EnterEvent &e) override
std::string rightText
Definition MenuItem.hpp:14
void step() override
Advances the module by one frame.
void onDragDrop(const DragDropEvent &e) override
Definition Menu.hpp:11
Occurs after a certain action is triggered on a Widget.
Definition Widget.hpp:445
Occurs when the mouse button is released over a Widget while dragging.
Definition Widget.hpp:423
Definition Widget.hpp:141
Occurs when a Widget begins consuming the Hover event.
Definition Widget.hpp:327