mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-25 02:04:23 +00:00
Allow daisy-chaining when adding children to ValueTree
This commit is contained in:
parent
6c32c4df87
commit
f868969e79
2 changed files with 10 additions and 4 deletions
|
|
@ -244,7 +244,7 @@ public:
|
|||
return children.indexOf (child.object);
|
||||
}
|
||||
|
||||
void addChild (SharedObject* child, int index, UndoManager* undoManager)
|
||||
ValueTree& addChild (SharedObject* child, int index, UndoManager* undoManager)
|
||||
{
|
||||
if (child != nullptr && child->parent != this)
|
||||
{
|
||||
|
|
@ -283,9 +283,11 @@ public:
|
|||
jassertfalse;
|
||||
}
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
void removeChild (int childIndex, UndoManager* undoManager)
|
||||
ValueTree& removeChild (int childIndex, UndoManager* undoManager)
|
||||
{
|
||||
if (auto child = Ptr (children.getObjectPointer (childIndex)))
|
||||
{
|
||||
|
|
@ -301,6 +303,8 @@ public:
|
|||
undoManager->perform (new AddOrRemoveChildAction (*this, childIndex, {}));
|
||||
}
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
void removeAllChildren (UndoManager* undoManager)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue