MCPcopy Create free account
hub / github.com/VCVRack/Rack / onEnter

Method onEnter

src/ui/MenuItem.cpp:63–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63void MenuItem::onEnter(const EnterEvent& e) {
64 Menu* parentMenu = dynamic_cast<Menu*>(parent);
65 if (!parentMenu)
66 return;
67
68 parentMenu->activeEntry = NULL;
69
70 // Try to create child menu
71 Menu* childMenu = createChildMenu();
72 if (childMenu) {
73 parentMenu->activeEntry = this;
74 childMenu->box.pos = parent->box.pos.plus(box.getTopRight());
75 }
76 parentMenu->setChildMenu(childMenu);
77}
78
79void MenuItem::onDragDrop(const DragDropEvent& e) {
80 if (e.origin == this && !disabled) {

Callers 1

setHoveredWidgetMethod · 0.45

Calls 3

plusMethod · 0.80
getTopRightMethod · 0.80
setChildMenuMethod · 0.80

Tested by

no test coverage detected