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
8
namespace
rack
{
9
namespace
ui {
10
11
12
struct
MenuItem
:
MenuEntry
{
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
34
struct
ColorDotMenuItem
:
MenuItem
{
35
NVGcolor
color
=
color::BLACK_TRANSPARENT
;
36
37
void
draw
(
const
DrawArgs
& args)
override
;
38
void
step
()
override
;
39
};
40
41
42
}
// namespace ui
43
}
// namespace rack
MenuEntry.hpp
Menu.hpp
PRIVATE
#define PRIVATE
Attribute for private functions not intended to be called by plugins.
Definition
common.hpp:32
context.hpp
rack::color::BLACK_TRANSPARENT
static const NVGcolor BLACK_TRANSPARENT
Definition
color.hpp:13
rack
Root namespace for the Rack API.
Definition
AudioDisplay.hpp:9
rack::ui::ColorDotMenuItem
Definition
MenuItem.hpp:34
rack::ui::ColorDotMenuItem::draw
void draw(const DrawArgs &args) override
Draws the widget to the NanoVG context.
rack::ui::ColorDotMenuItem::step
void step() override
Advances the module by one frame.
rack::ui::ColorDotMenuItem::color
NVGcolor color
Definition
MenuItem.hpp:35
rack::ui::MenuEntry
Definition
MenuEntry.hpp:10
rack::ui::MenuItem
Definition
MenuItem.hpp:12
rack::ui::MenuItem::draw
void draw(const DrawArgs &args) override
Draws the widget to the NanoVG context.
rack::ui::MenuItem::doAction
void doAction(bool consume=true)
rack::ui::MenuItem::onAction
void onAction(const ActionEvent &e) override
Override to handle behavior when user clicks the menu item.
rack::ui::MenuItem::disabled
bool disabled
Definition
MenuItem.hpp:15
rack::ui::MenuItem::text
std::string text
Definition
MenuItem.hpp:13
rack::ui::MenuItem::createChildMenu
virtual Menu * createChildMenu()
Definition
MenuItem.hpp:23
rack::ui::MenuItem::drawOffset
PRIVATE void drawOffset(NVGcontext *vg, float offset=0)
rack::ui::MenuItem::onEnter
void onEnter(const EnterEvent &e) override
rack::ui::MenuItem::rightText
std::string rightText
Definition
MenuItem.hpp:14
rack::ui::MenuItem::step
void step() override
Advances the module by one frame.
rack::ui::MenuItem::onDragDrop
void onDragDrop(const DragDropEvent &e) override
rack::ui::Menu
Definition
Menu.hpp:11
rack::widget::Widget::ActionEvent
Occurs after a certain action is triggered on a Widget.
Definition
Widget.hpp:445
rack::widget::Widget::DragDropEvent
Occurs when the mouse button is released over a Widget while dragging.
Definition
Widget.hpp:423
rack::widget::Widget::DrawArgs
Definition
Widget.hpp:141
rack::widget::Widget::EnterEvent
Occurs when a Widget begins consuming the Hover event.
Definition
Widget.hpp:327
common.hpp
include
ui
MenuItem.hpp
Generated by
1.12.0