1 /*=========================================================================
7 =========================================================================*/
9 /* ---------------------------------------------------------------------
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
14 * This software is governed by the CeCILL-B license under French law and
15 * abiding by the rules of distribution of free software. You can use,
16 * modify and/ or redistribute the software under the terms of the CeCILL-B
17 * license as circulated by CEA, CNRS and INRIA at the following URL
18 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
19 * or in the file LICENSE.txt.
21 * As a counterpart to the access to the source code and rights to copy,
22 * modify and redistribute granted by the license, users are provided only
23 * with a limited warranty and the software's author, the holder of the
24 * economic rights, and the successive licensors have only limited
27 * The fact that you are presently reading this means that you have had
28 * knowledge of the CeCILL-B license and that you accept its terms.
29 * ------------------------------------------------------------------------ */
33 * \brief Class bbtk::WxInterfaceEditorGraphicBBS .
36 #include "bbtkwxGUIEditorGraphicBBS.h"
38 #include "creaSystem.h"
40 #include <InterpreterBBS.h>
48 //=========================================================================
49 wxGUIEditorGraphicBBS::wxGUIEditorGraphicBBS(wxFrame *parent)
50 : wxFrame(parent, -1, _T("bbtkGEditor"),wxDefaultPosition, wxSize(1200,800))
53 _frameAUIMgr = new wxAuiManager(this);
56 /*std::string datadir( crea::System::GetExecutablePath() );
57 std::string datadir (".");
58 cout<<"RaC //------------------"<<endl;
59 cout<<"RaC //TODO wxGUIEditorGraphicBBS constructor.Initialize datadir with crea::System::GetExecutablePath() ."<<endl;
60 cout<<"RaC //------------------"<<endl;
62 #ifdef LINUX // assume this is OSX
63 datadir=datadir+"/../share/creaContours";
66 #ifdef MACOSX // assume this is OSX
67 datadir=datadir+"/../../../../share/creaContours";
74 initTabPanelsManager();
76 initHelpHTMLBrowser();
79 _frameAUIMgr->Update();
80 _actualPkgBrowserBoxName="";
81 _actualPkgBrowserPkgName="";
86 //=========================================================================
87 wxGUIEditorGraphicBBS::~wxGUIEditorGraphicBBS()
89 printf ("EED %p ~wxGUIEditorGraphicBBS()\n" , this );
91 //EED02JUIN2010 delete _tabsMgr;
93 _frameAUIMgr->UnInit();
98 //=========================================================================
99 void wxGUIEditorGraphicBBS::initToolbar()
101 wxBitmap bmp_new(new_xpm);
102 wxBitmap bmp_open(open_xpm);
103 wxBitmap bmp_save(save_xpm);
104 wxBitmap bmp_run(run_xpm);
105 wxBitmap bmp_delete(delete_xpm);
106 wxBitmap bmp_centerview(centerview_xpm);
107 wxBitmap bmp_complexbox(complexbox_xpm);
108 wxBitmap bmp_complexinputport(complexinputport_xpm);
109 wxBitmap bmp_complexoutputport(complexoutputport_xpm);
111 wxToolBar *toolbar = new wxToolBar(this, wxID_ANY);
113 //Adds a tool btn to the toolbar
114 toolbar->AddTool(ID_NEW,_T("New"),bmp_new, wxNullBitmap, wxITEM_NORMAL,_T("New tab"), _T("Create a new panel tab"));
115 toolbar->AddTool(ID_OPEN,_T("Open diagram"),bmp_open, wxNullBitmap, wxITEM_NORMAL,_T("Open a diagram"), _T("Open a diagram"));
116 toolbar->AddTool(ID_SAVE_AS_DIAGRAM,_T("Save diagram"),bmp_save, wxNullBitmap, wxITEM_NORMAL,_T("Saves actual diagram"), _T("Saves actual diagram"));
117 toolbar->AddTool(ID_RUN,_T("Run"),bmp_run, wxNullBitmap, wxITEM_NORMAL,_T("Execute actual diagram"), _T("Execute actual diagram"));
118 toolbar->AddTool(ID_DELETEALL,_T("Delete all"),bmp_delete, wxNullBitmap, wxITEM_NORMAL,_T("Delete all boxes"), _T("Delete all boxes"));
119 toolbar->AddTool(ID_CENTERVIEW,_T("Center view"),bmp_centerview, wxNullBitmap, wxITEM_NORMAL,_T("Center view"), _T("Center view"));
120 toolbar->AddSeparator();
121 toolbar->AddTool(ID_BTNCOMPLEXBOX,_T("Complex box"),complexbox_xpm, wxNullBitmap, wxITEM_NORMAL,_T("Complex box"), _T("Complex box"));
122 toolbar->SetToggle(ID_BTNCOMPLEXBOX,true);
123 toolbar->AddTool(ID_ADDCOMPLEXBOXINPUT,_T("Add input to Complex box"),bmp_complexinputport, wxNullBitmap, wxITEM_NORMAL,_T("Add input to Complex box"), _T("Add input to Complex box"));
124 toolbar->AddTool(ID_ADDCOMPLEXBOXOUTPUT,_T("Add output to Complex box"),bmp_complexoutputport, wxNullBitmap, wxITEM_NORMAL,_T("Add output Complex box"), _T("Add output Complex box"));
125 toolbar->EnableTool(ID_ADDCOMPLEXBOXINPUT,false);
126 toolbar->EnableTool(ID_ADDCOMPLEXBOXOUTPUT,false);
128 toolbar->SetMargins( 2, 2 );
132 // connect command event handlers
133 Connect(ID_NEW,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCreateNewTab));
134 Connect(ID_OPEN,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnOpenDiagram));
135 Connect(ID_SAVE_AS_DIAGRAM,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveActualDiagram));
136 Connect(ID_RUN,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnExecuteActualDiagram));
137 Connect(ID_DELETEALL,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnDeleteAllBoxesActualDiagram));
138 Connect(ID_CENTERVIEW,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCenterViewActualDiagram));
139 Connect(ID_BTNCOMPLEXBOX,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnClickBtnComplexBox));
140 Connect(ID_ADDCOMPLEXBOXINPUT,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnAddComplexBoxInput));
141 Connect(ID_ADDCOMPLEXBOXOUTPUT,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnAddComplexBoxOutput));
144 //=========================================================================
145 void wxGUIEditorGraphicBBS::initHelpHTMLBrowser()
147 //TO FIX THE PATH OF BBTK BIN IN ORDER TO USE REGENERATE EXECUTABLES
149 _helpHtmlBrowser = new WxGUIHtmlBrowser(this,wxSize(200,0));
150 _frameAUIMgr->AddPane(_helpHtmlBrowser,wxAuiPaneInfo().Right().MinSize(200,200));
153 //=========================================================================
154 void wxGUIEditorGraphicBBS::initMenu()
156 // Create File menu and its items
157 wxMenu *fileMenu = new wxMenu();
158 fileMenu->Append(ID_NEW, _T("New diagram"), _T("New"));
159 fileMenu->Append(ID_SAVE_AS_DIAGRAM, _T("Save diagram"), _T("Save diagram"));
160 fileMenu->Append(ID_OPEN_BBS, _T("Open BBS"), _T("Open BBS"));
161 fileMenu->Append(ID_SAVE_AS_BBS, _T("Save BBS"), _T("Save BBS"));
162 fileMenu->Append(ID_SAVE_AS_COMPLEXBOX, _T("Save complex box"), _T("Save complex box"));
163 fileMenu->Append(wxID_EXIT, _T("E&xit"), _T("Exit"));
165 Connect(ID_NEW,wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCreateNewTab));
166 Connect(ID_SAVE_AS_DIAGRAM,wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveActualDiagram));
167 Connect(ID_OPEN_BBS,wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnOpenBBS));
168 Connect(ID_SAVE_AS_BBS,wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveActualBBS));
169 Connect(ID_SAVE_AS_COMPLEXBOX,wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveActualComplexBox));
170 Connect(wxID_EXIT,wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnExit));
172 // Create Help menu and its items
173 wxMenu *editMenu = new wxMenu;
174 editMenu->Append(ID_COPY_TO_COMPLEXDIAGRAM, _T("Copy selected to complex box"), _T("Creates a new complex box diagram with selected boxes"));
176 Connect(ID_COPY_TO_COMPLEXDIAGRAM,wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCopySelectedToComplexDiagram));
178 // Create Help menu and its items
179 wxMenu *helpMenu = new wxMenu;
180 helpMenu->Append(wxID_ABOUT, _T("&About..."), _T("About"));
182 // Append the created menu to the menu bar
183 wxMenuBar *menuBar = new wxMenuBar();
184 menuBar->Append(fileMenu, _T("&File"));
185 menuBar->Append(editMenu, _T("&Edit"));
186 menuBar->Append(helpMenu, _T("&Help"));
188 // Attach this menu bar to the frame
192 //=========================================================================
193 void wxGUIEditorGraphicBBS::initTabPanelsManager()
195 _notebook = new wxAuiNotebook(this,wxID_NOTEBOOK,wxDefaultPosition,wxDefaultSize,wxAUI_NB_TOP|wxAUI_NB_TAB_MOVE|wxAUI_NB_CLOSE_ON_ACTIVE_TAB|wxAUI_NB_TAB_FIXED_WIDTH|wxAUI_NB_WINDOWLIST_BUTTON);
196 _tabsMgr = new wxTabPanelsManager(this);
197 _frameAUIMgr->AddPane(_notebook,wxAuiPaneInfo().CenterPane());
201 //=========================================================================
202 void wxGUIEditorGraphicBBS::initPackageBrowser()
204 _pkgBrowser = new WxGUIPackageBrowser2(this);
205 _pkgBrowser->IncludeAll();
206 _frameAUIMgr->AddPane(_pkgBrowser,wxAuiPaneInfo().Left().MinSize(200,200).CloseButton(false));
209 //================================================================
211 void wxGUIEditorGraphicBBS::DoRegeneratePackageDoc( const std::string& pack )
213 std::string mess("Regenerating doc for package '");
219 mess = "Regenerating doc for all packages";
222 mess += " ... please wait";
224 SetStatusText( std2wx(mess) );
232 command += ConfigurationFile::GetInstance().Get_bin_path();
233 command += ConfigurationFile::GetInstance().Get_file_separator();
234 command += "bbRegeneratePackageDoc";
239 command += " " + pack + " -q";
240 bbtkMessage("debug",1,"Executing system command '"<<command<<"'"<<std::endl);
242 if ( ! system ( command.c_str() ) )
244 SetStatusText( _T("Done !"));
246 wxMessageBox(_T("Done !"),_T("Regenerate package '")
247 +std2wx(pack)+_T("' doc"),
248 wxOK | wxICON_INFORMATION);
253 SetStatusText( _T("Done !"));
254 wxString err(_T("An error occured while running '"));
255 err += bbtk::std2wx(command) + _T("'");
256 wxMessageBox(err,_T("Regenerate package doc"),wxOK | wxICON_ERROR);
260 //================================================================
261 void wxGUIEditorGraphicBBS::DoRegenerateBoxesLists()
263 SetStatusText( _T("Regenerating boxes lists ... please wait") );
270 command += ConfigurationFile::GetInstance().Get_bin_path();
271 command += ConfigurationFile::GetInstance().Get_file_separator();
272 command += "bbRegenerateBoxesLists";
279 bbtkMessage("debug",1,"Executing system command '"<<command<<"'"<<std::endl);
281 if ( ! system ( command.c_str() ) )
283 SetStatusText( _T("Done !"));
285 wxMessageBox(_T("Done !"),_T("Regenerate boxes lists"),
286 wxOK | wxICON_INFORMATION);
291 SetStatusText( _T("Done !"));
292 wxString err(_T("An error occured while running '"));
293 err += bbtk::std2wx(command) + _T("'");
294 wxMessageBox(err,_T("Regenerate boxes lists"),wxOK | wxICON_ERROR);
298 //================================================================
299 void wxGUIEditorGraphicBBS::RegenerateAll()
301 DoRegeneratePackageDoc("-a");
302 DoRegenerateBoxesLists();
305 //================================================================
307 wxAuiNotebook* wxGUIEditorGraphicBBS::getAuiNotebook()
312 //================================================================
314 void wxGUIEditorGraphicBBS::displayBlackBoxInfo(std::string packageName, std::string boxName)
316 if(_actualPkgBrowserPkgName != packageName || _actualPkgBrowserBoxName != boxName )
318 _actualPkgBrowserPkgName = packageName;
319 _actualPkgBrowserBoxName = boxName;
321 BlackBoxDescriptor::Pointer descriptor = GObjectsMVCFactory::getInstance()->getBlackBoxDescriptor(packageName, boxName);
322 _pkgBrowser->WxGUIBlackBoxListUserOnSelected(descriptor.get());
326 //=========================================================================
328 void wxGUIEditorGraphicBBS::editBlackBox(GBlackBoxModel *bbmodel)
330 wxBlackBoxEditionDialog* dialog = new wxBlackBoxEditionDialog(this,bbmodel);
334 //=========================================================================
336 void wxGUIEditorGraphicBBS::updateStatusBar(std::string textStatus)
338 SetStatusText(crea::std2wx(textStatus));
341 //=========================================================================
343 void wxGUIEditorGraphicBBS::executeScript(std::string script)
345 std::string separator = ConfigurationFile::GetInstance().Get_file_separator ();
346 std::string dir = ConfigurationFile::GetInstance().Get_default_temp_dir();
347 std::string filename = dir + separator + "tmp_bbtk.bbs";
350 tempFile.open(filename.c_str());
354 std::string command = "\""+ crea::System::GetExecutablePath();
358 command += separator + "../../../bbi.app/Contents/MacOS";
367 //command += ConfigurationFile::GetInstance().Get_bin_path();
368 //EED command +="C:/temp/bbtkBIN/RelWithDebInfo//";
369 //EED command +="C:/Program Files/CreaTools/bbtk-0.9.5/bin";
373 command += separator + "usr/local/bin/bbi.app/Contents/MacOS/bbi\" ";
376 command += separator + "bbi\" ";
379 command += separator + "bbi\" ";
380 command += "\""+filename + "\"";
387 printf ("RaC wxGUIEditorGraphicBBS::executeScript %s \n" , command.c_str() );
388 system( command.c_str() );
391 //=========================================================================
393 //=========================================================================
395 void wxGUIEditorGraphicBBS::OnCreateNewTab(wxCommandEvent& event)
397 _tabsMgr->addNewTab();
398 refreshGUIControls();
401 //=========================================================================
403 void wxGUIEditorGraphicBBS::OnExecuteActualDiagram(wxCommandEvent& event)
405 std::string script = _tabsMgr->getActualDiagramBBS();
406 cout<<"RaC wxGUIEditorGraphicBBS::executeActualDiagram SCRIPT"<<endl;
409 executeScript(script);
413 //=========================================================================
415 //=========================================================================
416 void wxGUIEditorGraphicBBS::OnOpenBBS(wxCommandEvent& event)
418 wxFileDialog * openFileDialog = new wxFileDialog(this,wxT("Open BBS"),wxEmptyString,wxT("NewBBS"),wxT("*.bbs"),wxOPEN);
419 if (openFileDialog->ShowModal() == wxID_OK)
421 wxString fileName = openFileDialog->GetPath( );
422 printf("EED wxGUIEditorGraphicBBS::OnOpenBBS file=%s\n", (const char*) (fileName.mb_str()) );
425 _tabsMgr->addNewTab();
428 // bbtk::EExecuterBBSG::Pointer exe = bbtk::EExecuterBBSG::New( this->_tabsMgr->getActualTabPanel()->getSceneManager() , _pkgBrowser->GetFactory() );
429 bbtk::InterpreterBBS::Pointer I = bbtk::InterpreterBBS::New( this->_tabsMgr->getActualTabPanel()->getSceneManager() , _pkgBrowser->GetFactory());
431 // We tell the interpreter to throw exceptions on error
433 // Interpret the file supposed to define a box called 'Processing'
434 I->InterpretFile( (const char*) (fileName.mb_str()) );
436 refreshGUIControls();
439 void wxGUIEditorGraphicBBS::OnSaveActualBBS(wxCommandEvent& event)
441 wxFileDialog * saveFileDialog = new wxFileDialog(this,wxT("Save actual BBS"),wxEmptyString,wxT("NewBBS"),wxT("*.bbs"),wxSAVE|wxOVERWRITE_PROMPT);
442 if (saveFileDialog->ShowModal() == wxID_OK)
444 wxString fileName = saveFileDialog->GetPath( );
448 //EED file.open(fileName.c_str());
449 file.open( (const char*) (fileName.mb_str()) );
451 std::string content="";
453 // writing file header
454 content += "# ----------------------------------\n";
455 content += "# - BBTKGEditor v 1.0 BBS BlackBox Script\n";
456 content += "# ----------------------------------\n";
458 content += _tabsMgr->getActualDiagramBBS();
465 //=========================================================================
467 void wxGUIEditorGraphicBBS::OnSaveActualComplexBox(wxCommandEvent& event)
469 wxTextEntryDialog *nameDialog = new wxTextEntryDialog(this,wxT("Name of complex box"));
470 std::string cbName="";
471 if (nameDialog->ShowModal() == wxID_OK)
473 wxString fileName = nameDialog->GetValue();
474 cbName=(const char*) (fileName.mb_str());
479 wxFileDialog * saveFileDialog = new wxFileDialog(this ,wxT("Save Complex Box BBS") ,wxEmptyString, wxString( cbName.c_str(), wxConvUTF8),wxT("*.bbs"), wxSAVE | wxOVERWRITE_PROMPT);
480 if (saveFileDialog->ShowModal() == wxID_OK)
482 wxString fileName = saveFileDialog->GetPath();
485 file.open( (const char*) (fileName.mb_str()) );
487 std::string content="";
489 // writing file header
490 content += "# ----------------------------------\n";
491 content += "# - BBTKGEditor v 1.1 BBS BlackBox Script (Complex Box)\n";
492 content += "# ----------------------------------\n";
494 content += _tabsMgr->getActualComplexBoxBBS(cbName);
502 //=========================================================================
504 void wxGUIEditorGraphicBBS::OnSaveActualDiagram(wxCommandEvent& event)
506 wxFileDialog * saveFileDialog = new wxFileDialog(this,wxT("Save actual diagram"),wxEmptyString,wxT("NewDiagram"),wxT("*.bbg"),wxSAVE|wxOVERWRITE_PROMPT);
507 if (saveFileDialog->ShowModal() == wxID_OK)
509 wxString fileName = saveFileDialog->GetPath();
512 file.open( (const char*) (fileName.mb_str()) );
514 std::string content="";
516 // writing file header
517 content += "# ----------------------------------\n";
518 content += "# - BBTKGEditor v 1.0 BBG BlackBox Diagram file\n";
521 content += (const char*) (fileName.mb_str());
524 content += "# ----------------------------------\n";
526 content += "APP_START\n";
527 _tabsMgr->saveActualDiagram(content);
528 content += "APP_END\n";
535 //=========================================================================
537 void wxGUIEditorGraphicBBS::refreshGUIControls()
539 wxToolBar* toolbar = GetToolBar();
540 if(_tabsMgr->isActualDiagramComplexBox())
542 toolbar->ToggleTool(ID_BTNCOMPLEXBOX,true);
543 toolbar->EnableTool(ID_ADDCOMPLEXBOXINPUT,true);
544 toolbar->EnableTool(ID_ADDCOMPLEXBOXOUTPUT,true);
546 GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_COMPLEXBOX,true);
547 GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_BBS,false);
551 toolbar->ToggleTool(ID_BTNCOMPLEXBOX,false);
552 toolbar->EnableTool(ID_ADDCOMPLEXBOXINPUT,false);
553 toolbar->EnableTool(ID_ADDCOMPLEXBOXOUTPUT,false);
555 GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_COMPLEXBOX,false);
556 GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_BBS,true);
559 if(_tabsMgr->getNumActualSelectedObjects()>0)
561 GetMenuBar()->GetMenu(1)->Enable(ID_COPY_TO_COMPLEXDIAGRAM,true);
565 ///TODO Fix the possibility to say from the SceneManager to the GUI to refresh the options
566 GetMenuBar()->GetMenu(1)->Enable(ID_COPY_TO_COMPLEXDIAGRAM,true);
571 //=========================================================================
573 void wxGUIEditorGraphicBBS::OnDeleteAllBoxesActualDiagram(wxCommandEvent& event)
575 wxMessageDialog *dial = new wxMessageDialog(NULL, wxT("Are you sure to delete all boxes of the diagram?"), wxT("Delete all boxes"), wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION);
576 if(dial->ShowModal() == wxID_YES)
578 _tabsMgr->deleteAllBoxesActualDiagram();
582 //=========================================================================
584 void wxGUIEditorGraphicBBS::OnCenterViewActualDiagram(wxCommandEvent& event)
586 _tabsMgr->centerViewActualDiagram();
589 //=========================================================================
592 void wxGUIEditorGraphicBBS::OnOpenDiagram(wxCommandEvent& event)
594 wxFileDialog * openFileDialog = new wxFileDialog(this,wxT("Open diagram"),wxEmptyString,wxT(""),wxT("*.bbg"),wxOPEN|wxFILE_MUST_EXIST);
595 if (openFileDialog->ShowModal() == wxID_OK)
597 wxString fileName = openFileDialog->GetPath();
599 ifstream inputStream;
601 //EED inputStream.open(fileName.c_str());
602 inputStream.open( (const char*) (fileName.mb_str()) );
606 _tabsMgr->addNewTab();
607 _tabsMgr->loadDiagram(inputStream);
611 refreshGUIControls();
614 //=========================================================================
616 void wxGUIEditorGraphicBBS::OnClickBtnComplexBox(wxCommandEvent& event)
618 wxToolBar* toolbar = GetToolBar();
619 bool temp = toolbar->GetToolState(ID_BTNCOMPLEXBOX);
622 _tabsMgr->setActualDiagramComplexBox(true);
626 _tabsMgr->setActualDiagramComplexBox(false);
628 refreshGUIControls();
631 //=========================================================================
633 void wxGUIEditorGraphicBBS::OnAddComplexBoxInput(wxCommandEvent& event)
635 wxTextEntryDialog *nameDialog = new wxTextEntryDialog(this,wxT("Name of input port"));
636 if (nameDialog->ShowModal() == wxID_OK)
638 wxString fileName = nameDialog->GetValue();
639 if(!fileName.IsEmpty())
641 std::string portName=(const char*) (fileName.mb_str());
642 _tabsMgr->addActualDiagramComplexInputPort(portName);
647 //=========================================================================
649 void wxGUIEditorGraphicBBS::OnAddComplexBoxOutput(wxCommandEvent& event)
651 wxTextEntryDialog *nameDialog = new wxTextEntryDialog(this,wxT("Name of output port"));
652 if (nameDialog->ShowModal() == wxID_OK)
654 wxString fileName = nameDialog->GetValue();
655 if(!fileName.IsEmpty())
657 std::string portName=(const char*) (fileName.mb_str());
658 _tabsMgr->addActualDiagramComplexOutputPort(portName);
663 //=========================================================================
665 void wxGUIEditorGraphicBBS::OnCopySelectedToComplexDiagram(wxCommandEvent& event)
667 _tabsMgr->copySelectedBBoxesToComplexDiagram();
670 //=========================================================================
672 void wxGUIEditorGraphicBBS::OnExit(wxCommandEvent& event)
677 //=========================================================================
679 } // EO namespace bbtk