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

Method addNewComponent

Source/UIComponents/CtrlrPanel/CtrlrPanelCanvas.cpp:399–414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397}
398
399CtrlrComponent *CtrlrPanelCanvas::addNewComponent (const Identifier &componentType, const Point<int> insertAt, Component *componentToAddTo)
400{
401 CtrlrModulator *modulator = addModulator(componentType);
402 modulator->setComponentType (componentType, false);
403
404 CtrlrComponent *ctrlrComponent = modulator->getComponent();
405
406 if (ctrlrComponent != 0)
407 {
408 ctrlrComponent->setTopLeftPosition (insertAt.getX(), insertAt.getY());
409 return (attach (ctrlrComponent, componentToAddTo));
410 }
411
412 jassertfalse; // ctrlrComponent == 0
413 return (nullptr);
414}
415
416CtrlrComponent *CtrlrPanelCanvas::addNewComponent (const Identifier &componentType, const Rectangle<int> componentBounds)
417{

Callers

nothing calls this directly

Calls 11

setComponentTypeMethod · 0.80
getComponentMethod · 0.45
getXMethod · 0.45
getYMethod · 0.45
getPositionMethod · 0.45
setBoundsMethod · 0.45
isValidMethod · 0.45
getPropertyMethod · 0.45
toStringMethod · 0.45
restoreStateMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected