X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FEditorGraphicBBS%2FbbsWxGUIEditorGraphic%2FbbtkwxGUIEditorGraphicBBS.cxx;fp=lib%2FEditorGraphicBBS%2FbbsWxGUIEditorGraphic%2FbbtkwxGUIEditorGraphicBBS.cxx;h=978202515800e80f31016afc4d9319792412b0b7;hb=e12e7f1b6c5a32373366ffe4172e5ddcd1a05209;hp=93596627446f3930b78bfa3236751bb5df35d858;hpb=06bcddb8e6657b112895c5a0a4679f63d6e6865e;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx index 9359662..9782025 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx @@ -1094,18 +1094,28 @@ void wxGUIEditorGraphicBBS::OnClickBtnComplexBox(wxCommandEvent& event) } //========================================================================= - +//EED01 void wxGUIEditorGraphicBBS::OnAddComplexBoxInput(wxCommandEvent& event) { wxTextEntryDialog *nameDialog = new wxTextEntryDialog(this, wxT("Name of input port")); - if (nameDialog->ShowModal() == wxID_OK) { + if (nameDialog->ShowModal() == wxID_OK) + { wxString fileName = nameDialog->GetValue(); - if (!fileName.IsEmpty()) { + if (!fileName.IsEmpty()) + { std::string portName = (const char*) (fileName.mb_str()); - _tabsMgr->addActualDiagramComplexInputPort(portName); - } - } + if ( !boxNameExists(portName) ) + { + _tabsMgr->addActualDiagramComplexInputPort(portName); + } else { + wxMessageDialog *dial = new wxMessageDialog(NULL, + wxT("Impossible to create Box. The name already exists. Please provide another name"), + wxT("Change name: name already exists"), wxOK | wxICON_EXCLAMATION | wxSTAY_ON_TOP); + dial->ShowModal(); + } + } // if !fileName + } // if namaDialog } //========================================================================= @@ -1113,13 +1123,24 @@ void wxGUIEditorGraphicBBS::OnAddComplexBoxOutput(wxCommandEvent& event) { wxTextEntryDialog *nameDialog = new wxTextEntryDialog(this, wxT("Name of output port")); - if (nameDialog->ShowModal() == wxID_OK) { + if (nameDialog->ShowModal() == wxID_OK) + { wxString fileName = nameDialog->GetValue(); - if (!fileName.IsEmpty()) { + if (!fileName.IsEmpty()) + { std::string portName = (const char*) (fileName.mb_str()); + if ( !boxNameExists(portName) ) + { _tabsMgr->addActualDiagramComplexOutputPort(portName); - } - } + } else { + wxMessageDialog *dial = new wxMessageDialog(NULL, + wxT("Impossible to create Box. The name already exists. Please provide another name"), + wxT("Change name: name already exists"), wxOK | wxICON_EXCLAMATION | wxSTAY_ON_TOP); + dial->ShowModal(); + } + + } // if !filename + } // namaDialog } //=========================================================================