From 341b4a77d2b4c69a99370065af166d92071c9207 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Thu, 20 Apr 2017 18:41:00 -0300 Subject: Export/Import implemented --- Project/ControlEditor.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'Project/ControlEditor.cpp') diff --git a/Project/ControlEditor.cpp b/Project/ControlEditor.cpp index 5d64c5c..e457d0f 100644 --- a/Project/ControlEditor.cpp +++ b/Project/ControlEditor.cpp @@ -734,6 +734,21 @@ void ControlEditor::OnImportClick(wxCommandEvent& event) wxOK | wxCENTRE | wxICON_ERROR); msgDialog.ShowModal(); } + + //Get the highest id number + int majorElementID = 0; + for(auto it = m_elementList.begin(), itEnd = m_elementList.end(); it != itEnd; ++it) { + ControlElement* element = *it; + if(element->GetID() > majorElementID) + majorElementID = element->GetID(); + } + for(auto it = m_connectionList.begin(), itEnd = m_connectionList.end(); it != itEnd; ++it) { + ConnectionLine* line = *it; + if(line->GetID() > majorElementID) + majorElementID = line->GetID(); + } + m_lastElementID = ++majorElementID; + Redraw(); event.Skip(); } -- cgit