diff --git a/SHADE_Managed/src/Editor/Editor.cxx b/SHADE_Managed/src/Editor/Editor.cxx index d1672929..c481e0b8 100644 --- a/SHADE_Managed/src/Editor/Editor.cxx +++ b/SHADE_Managed/src/Editor/Editor.cxx @@ -181,7 +181,12 @@ namespace SHADE SHEditorUI::Text(Convert::ToNative(field->Name)); SHEditorUI::SameLine(); - SHEditorUI::Button("+"); + if (SHEditorUI::Button("+")) + { + System::Object^ obj = System::Activator::CreateInstance(listType); + iList->Add(obj); + registerUndoListAddAction(listType, iList, iList->Count - 1, obj); + } SHEditorUI::Indent(); for (int i = 0; i < iList->Count; ++i) @@ -195,7 +200,14 @@ namespace SHADE registerUndoListChangeAction(listType, iList, i, obj, oldObj); } SHEditorUI::SameLine(); - SHEditorUI::Button("-"); + if (SHEditorUI::Button("-")) + { + System::Object^ obj = iList[i]; + iList->RemoveAt(i); + registerUndoListRemoveAction(listType, iList, i, obj); + SHEditorUI::PopID(); + break; + } SHEditorUI::PopID(); } SHEditorUI::Unindent(); @@ -367,6 +379,9 @@ namespace SHADE return; actionStack.Add(gcnew ListElementAddCommand(list, index, data)); + + // Inform the C++ Undo-Redo stack + SHCommandManager::RegisterCommand(std::reinterpret_pointer_cast(std::make_shared())); } void Editor::registerUndoListRemoveAction(System::Type^ type, System::Collections::IList^ list, int index, System::Object^ data) @@ -375,6 +390,9 @@ namespace SHADE return; actionStack.Add(gcnew ListElementRemoveCommand(list, index, data)); + + // Inform the C++ Undo-Redo stack + SHCommandManager::RegisterCommand(std::reinterpret_pointer_cast(std::make_shared())); } generic