}
//=========================================================================
-
+//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
}
//=========================================================================
{
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
}
//=========================================================================