| 234 | } |
| 235 | |
| 236 | void 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 | |
| 264 | StringArray CtrlrLuaConsole::getMenuBarNames() |
| 265 | { |
nothing calls this directly
no test coverage detected