void wxGUIEditorGraphicBBS::SaveActualComplexBox(std::string filename)
{
- wxTextEntryDialog *nameDialog = new wxTextEntryDialog(this,wxT("Name of complex box"));
+ wxTextEntryDialog *cbNameDialog = new wxTextEntryDialog(this,wxT("Complex Box name"));
+ cbNameDialog->SetValue(_T("BBBBoxName"));
std::string cbName="";
- if (nameDialog->ShowModal() == wxID_OK)
+ if (cbNameDialog->ShowModal() == wxID_OK)
{
- wxString complexboxname = nameDialog->GetValue();
+ wxString complexboxname = cbNameDialog->GetValue();
cbName=(const char*) (complexboxname.mb_str());
}
- if(!cbName.empty())
+ wxTextEntryDialog *paNameDialog = new wxTextEntryDialog(this,wxT("Package name"));
+ paNameDialog->SetValue(_T("PPPPackageName"));
+ std::string paName="";
+ if (paNameDialog->ShowModal() == wxID_OK)
+ {
+ wxString packagename = paNameDialog->GetValue();
+ paName=(const char*) (packagename.mb_str());
+ }
+
+ if( (!cbName.empty()) || (!paName.empty()) )
{
ofstream file;
content += "\n";
content += "# ----------------------------------\n";
content += "\n";
- content += _tabsMgr->getActualComplexBoxBBS(cbName);
+ content += _tabsMgr->getActualComplexBoxBBS(cbName,paName);
file << content;
file.close();
}
{
wxString fileName = saveFileDialog->GetPath();
std::string filename = (const char*) (fileName.mb_str());
- std::string filenamebbs = filename+"s";
+ std::string filenamebbs = filename;
+ filenamebbs[filename.length()-1]='s';
SaveActualDiagram( filename );
if (_tabsMgr->isActualDiagramComplexBox()==false)
//=========================================================================
- std::string wxGEditorTabPanel::saveComplexBoxBBS(std::string cbName,std::string cbAuthor,std::string cbCategory,std::string cbDescription)
+ std::string wxGEditorTabPanel::saveComplexBoxBBS(std::string cbName, std:string paName,std::string cbAuthor,std::string cbCategory,std::string cbDescription)
{
- return _sceneManager->saveComplexBoxBBS(cbName,cbAuthor,cbCategory,cbDescription);
+ return _sceneManager->saveComplexBoxBBS(cbName,paName,cbAuthor,cbCategory,cbDescription);
}
//=========================================================================
// Saves the actual BBS as complex box
// RaC TOFIX It must be included the package of the complex box
- std::string saveComplexBoxBBS(std::string cbName,std::string cbAuthor="",std::string cbCategory="",std::string cbDescription="");
+ std::string saveComplexBoxBBS(std::string cbName,std::string paName,std::string cbAuthor="",std::string cbCategory="",std::string cbDescription="");
// Shows the dialog to edit black box parameters
void editBlackBox(GBlackBoxModel *bbmodel);
//=========================================================================
- std::string wxTabPanelsManager::getActualComplexBoxBBS(std::string cbName,std::string cbAuthor,std::string cbCategory,std::string cbDescription)
+ std::string wxTabPanelsManager::getActualComplexBoxBBS(std::string cbName, std::string paName,std::string cbAuthor,std::string cbCategory,std::string cbDescription)
{
- return _actual->saveComplexBoxBBS(cbName,cbAuthor,cbCategory,cbDescription);
+ return _actual->saveComplexBoxBBS(cbName,paName,cbAuthor,cbCategory,cbDescription);
}
//=========================================================================
void updateStatusBar(std::string textStatus);
std::string getActualDiagramBBS(bool wln=false);
- std::string getActualComplexBoxBBS(std::string cbName,std::string cbAuthor="",std::string cbCategory="",std::string cbDescription="");
+ std::string getActualComplexBoxBBS(std::string cbName, std::string std::string paName,std::string cbAuthor="",std::string cbCategory="",std::string cbDescription="");
void editBlackBox(GBlackBoxModel *bbmodel);
void deleteAllBoxesActualDiagram();
//=========================================================================
- std::string wxVtkSceneManager::saveComplexBoxBBS(std::string cbName,std::string cbAuthor,std::string cbCategory,std::string cbDescription)
+ std::string wxVtkSceneManager::saveComplexBoxBBS(std::string cbName,std::string paName,std::string cbAuthor,std::string cbCategory,std::string cbDescription)
{
std::vector<std::string> packages;
// Definition of a complex box
script+="define ";
- script+=cbName;
+ script+=cbName+" "+paName;
script+="\n";
script+="\n";
std::string getDiagramBBS(bool wln=false);
//Returns a string with the BBS script of the complex box.
- std::string saveComplexBoxBBS(std::string cbName,std::string cbAuthor="",std::string cbCategory="",std::string cbDescription="");
+ std::string saveComplexBoxBBS(std::string cbName,std::string paName,std::string cbAuthor="",std::string cbCategory="",std::string cbDescription="");
//Delete the object in the list of controllers with the id given by parameter.
void deleteObject(int id);