summaryrefslogtreecommitdiffstats
path: root/Project/ControlEditor.cpp
diff options
context:
space:
mode:
authorThales Lima Oliveira <thaleslima.ufu@gmail.com>2017-04-20 18:41:00 -0300
committerThales Lima Oliveira <thaleslima.ufu@gmail.com>2017-04-20 18:41:00 -0300
commit341b4a77d2b4c69a99370065af166d92071c9207 (patch)
tree1d575b5a7fc953108f123b3b1b001d9acf25fc12 /Project/ControlEditor.cpp
parent3f7d8736dcbe13e21562bd324c1bc0deb0ceaf6b (diff)
downloadPSP.git-341b4a77d2b4c69a99370065af166d92071c9207.tar.gz
PSP.git-341b4a77d2b4c69a99370065af166d92071c9207.tar.xz
PSP.git-341b4a77d2b4c69a99370065af166d92071c9207.zip
Export/Import implemented
Diffstat (limited to 'Project/ControlEditor.cpp')
-rw-r--r--Project/ControlEditor.cpp15
1 files changed, 15 insertions, 0 deletions
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();
}