MCPcopy Create free account
hub / github.com/christophhart/HISE / showCallback

Method showCallback

hi_scripting/scripting/components/ScriptingEditor.cpp:307–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

305}
306
307void ScriptingEditor::showCallback(int callbackIndex, int lineToScroll/*=-1*/)
308{
309 if (currentCallbackIndex != callbackIndex && callbackIndex < callbackButtons.size())
310 {
311 if (codeEditor != nullptr)
312 lastPositions.set(currentCallbackIndex, CommonEditorFunctions::getCaretPos(codeEditor).getPosition());;
313
314 currentCallbackIndex = callbackIndex;
315
316 callbackButtons[callbackIndex]->setToggleState(true, dontSendNotification);
317
318 auto jp = dynamic_cast<JavascriptProcessor*>(getProcessor());
319
320 auto d = jp->getSnippet(callbackIndex);
321
322 addAndMakeVisible(codeEditor = new PopupIncludeEditor(jp, d->getCallbackName()));
323
324 CodeDocument::Position pos(*d, lastPositions[callbackIndex]);
325 CommonEditorFunctions::moveCaretTo(codeEditor, pos, false);
326
327 }
328 else
329 {
330 currentCallbackIndex = -1;
331 codeEditor = nullptr;
332 }
333
334 refreshBodySize();
335 resized();
336}
337
338void ScriptingEditor::showOnInitCallback()
339{

Callers

nothing calls this directly

Calls 9

getCaretPosFunction · 0.85
getProcessorFunction · 0.85
resizedFunction · 0.50
sizeMethod · 0.45
setMethod · 0.45
getPositionMethod · 0.45
setToggleStateMethod · 0.45
getSnippetMethod · 0.45
getCallbackNameMethod · 0.45

Tested by

no test coverage detected