MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / snipsItemClicked

Method snipsItemClicked

Source/UIComponents/CtrlrLua/CtrlrLuaConsole.cpp:236–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234}
235
236void CtrlrLuaConsole::snipsItemClicked(Button *b)
237{
238 PopupMenu m;
239 m.addItem (1, "Add input to snips");
240 m.addSubMenu ("Run snip", getSnipsMenu(1024));
241 m.addSubMenu ("Remove snip", getSnipsMenu(4096));
242 m.addItem (2, "Toggle input removal after run", true, (bool)owner.getProperty(Ids::uiLuaConsoleInputRemoveAfterRun));
243 const int ret = m.showAt(b);
244
245 if (ret == 1)
246 {
247 snips.add (inputDocument.getAllContent());
248 }
249 if (ret >= 1024 && ret < 4096)
250 {
251 runCode (snips[ret-1024]);
252 }
253 if (ret >= 4096)
254 {
255 snips.remove (ret-4096);
256 }
257 if (ret == 2)
258 {
259 owner.setProperty (Ids::uiLuaConsoleInputRemoveAfterRun, !owner.getProperty(Ids::uiLuaConsoleInputRemoveAfterRun));
260 }
261 owner.setProperty (Ids::uiLuaConsoleSnips, snips.joinIntoString("$"));
262}
263
264StringArray CtrlrLuaConsole::getMenuBarNames()
265{

Callers

nothing calls this directly

Calls 9

getAllContentMethod · 0.80
joinIntoStringMethod · 0.80
addItemMethod · 0.45
addSubMenuMethod · 0.45
getPropertyMethod · 0.45
showAtMethod · 0.45
addMethod · 0.45
removeMethod · 0.45
setPropertyMethod · 0.45

Tested by

no test coverage detected