}
//=========================================================================
-
+//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
}
//=========================================================================
if(userResponse==wxID_OK)
{
std::string path = wx2std (FD->GetPath()) ;
+ #ifdef WIN32
+ std::string fname = path + "\\bbtkPackage";
+ #else
std::string fname = path + "/bbtkPackage";
+ #endif
+
std::cout << "Path chosen = \"" << FD->GetPath() << "\"" << std::endl;
if ( Utilities::FileExists( fname ) )
{
f.open(fname.c_str());
std::string pname;
f >> pname;
+ while(pname[0] == '#')
+ {
+ getline(f, pname, '\n');
+ f >> pname;
+ }
f.close();
bbtk::ConfigurationFile::GetInstance().AddPackagePathsAndWrite( path );