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"
39 #include <InterpreterBBS.h>
47 //=========================================================================
48 wxGUIEditorGraphicBBS::wxGUIEditorGraphicBBS(wxFrame *parent)
49 : wxFrame(parent, -1, _T("bbtkGEditor"),wxDefaultPosition, wxSize(1200,800))
52 _frameAUIMgr = new wxAuiManager(this);
55 /*std::string datadir( crea::System::GetExecutablePath() );
56 std::string datadir (".");
57 cout<<"RaC //------------------"<<endl;
58 cout<<"RaC //TODO wxGUIEditorGraphicBBS constructor.Initialize datadir with crea::System::GetExecutablePath() ."<<endl;
59 cout<<"RaC //------------------"<<endl;
61 #ifdef LINUX // assume this is OSX
62 datadir=datadir+"/../share/creaContours";
65 #ifdef MACOSX // assume this is OSX
66 datadir=datadir+"/../../../../share/creaContours";
73 initTabPanelsManager();
75 initHelpHTMLBrowser();
78 _frameAUIMgr->Update();
79 _actualPkgBrowserBoxName="";
80 _actualPkgBrowserPkgName="";
85 //=========================================================================
86 wxGUIEditorGraphicBBS::~wxGUIEditorGraphicBBS()
88 printf ("EED %p ~wxGUIEditorGraphicBBS()\n" , this );
90 //EED02JUIN2010 delete _tabsMgr;
92 _frameAUIMgr->UnInit();
97 //=========================================================================
98 void wxGUIEditorGraphicBBS::initToolbar()
100 wxBitmap bmp_new(new_xpm);
101 wxBitmap bmp_open(open_xpm);
102 wxBitmap bmp_save(save_xpm);
103 wxBitmap bmp_run(run_xpm);
104 wxBitmap bmp_delete(delete_xpm);
105 wxBitmap bmp_centerview(centerview_xpm);
106 wxBitmap bmp_complexbox(complexbox_xpm);
107 wxBitmap bmp_complexinputport(complexinputport_xpm);
108 wxBitmap bmp_complexoutputport(complexoutputport_xpm);
110 wxToolBar *toolbar = new wxToolBar(this, wxID_ANY);
112 //Adds a tool btn to the toolbar
113 toolbar->AddTool(ID_NEW,_T("New"),bmp_new, wxNullBitmap, wxITEM_NORMAL,_T("New tab"), _T("Create a new panel tab"));
114 toolbar->AddTool(ID_OPEN,_T("Open diagram"),bmp_open, wxNullBitmap, wxITEM_NORMAL,_T("Open a diagram"), _T("Open a diagram"));
115 toolbar->AddTool(ID_SAVE_AS_DIAGRAM,_T("Save diagram"),bmp_save, wxNullBitmap, wxITEM_NORMAL,_T("Saves actual diagram"), _T("Saves actual diagram"));
116 toolbar->AddTool(ID_RUN,_T("Run"),bmp_run, wxNullBitmap, wxITEM_NORMAL,_T("Execute actual diagram"), _T("Execute actual diagram"));
117 toolbar->AddTool(ID_DELETEALL,_T("Delete all"),bmp_delete, wxNullBitmap, wxITEM_NORMAL,_T("Delete all boxes"), _T("Delete all boxes"));
118 toolbar->AddTool(ID_CENTERVIEW,_T("Center view"),bmp_centerview, wxNullBitmap, wxITEM_NORMAL,_T("Center view"), _T("Center view"));
119 toolbar->AddSeparator();
120 toolbar->AddTool(ID_BTNCOMPLEXBOX,_T("Complex box"),complexbox_xpm, wxNullBitmap, wxITEM_NORMAL,_T("Complex box"), _T("Complex box"));
121 toolbar->SetToggle(ID_BTNCOMPLEXBOX,true);
122 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"));
123 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"));
124 toolbar->EnableTool(ID_ADDCOMPLEXBOXINPUT,false);
125 toolbar->EnableTool(ID_ADDCOMPLEXBOXOUTPUT,false);
127 toolbar->SetMargins( 2, 2 );
131 // connect command event handlers
132 Connect(ID_NEW,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCreateNewTab));
133 Connect(ID_OPEN,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnOpenDiagram));
134 Connect(ID_SAVE_AS_DIAGRAM,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveActualDiagram));
135 Connect(ID_RUN,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnExecuteActualDiagram));
136 Connect(ID_DELETEALL,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnDeleteAllBoxesActualDiagram));
137 Connect(ID_CENTERVIEW,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCenterViewActualDiagram));
138 Connect(ID_BTNCOMPLEXBOX,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnClickBtnComplexBox));
139 Connect(ID_ADDCOMPLEXBOXINPUT,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnAddComplexBoxInput));
140 Connect(ID_ADDCOMPLEXBOXOUTPUT,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnAddComplexBoxOutput));
143 //=========================================================================
144 void wxGUIEditorGraphicBBS::initHelpHTMLBrowser()
146 //TO FIX THE PATH OF BBTK BIN IN ORDER TO USE REGENERATE EXECUTABLES
148 _helpHtmlBrowser = new WxGUIHtmlBrowser(this,wxSize(200,0));
149 _frameAUIMgr->AddPane(_helpHtmlBrowser,wxAuiPaneInfo().Right().MinSize(200,200));
152 //=========================================================================
153 void wxGUIEditorGraphicBBS::initMenu()
155 // Create File menu and its items
156 wxMenu *fileMenu = new wxMenu();
157 fileMenu->Append(ID_NEW, _T("New diagram"), _T("New"));
158 fileMenu->Append(ID_SAVE_AS_DIAGRAM, _T("Save diagram"), _T("Save diagram"));
159 fileMenu->Append(ID_OPEN_BBS, _T("Open BBS"), _T("Open BBS"));
160 fileMenu->Append(ID_SAVE_AS_BBS, _T("Save BBS"), _T("Save BBS"));
161 fileMenu->Append(ID_SAVE_AS_COMPLEXBOX, _T("Save complex box"), _T("Save complex box"));
162 fileMenu->Append(wxID_EXIT, _T("E&xit"), _T("Exit"));
164 Connect(ID_NEW,wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCreateNewTab));
165 Connect(ID_SAVE_AS_DIAGRAM,wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveActualDiagram));
166 Connect(ID_OPEN_BBS,wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnOpenBBS));
167 Connect(ID_SAVE_AS_BBS,wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveActualBBS));
168 Connect(ID_SAVE_AS_COMPLEXBOX,wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveActualComplexBox));
169 Connect(wxID_EXIT,wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnExit));
171 // Create Help menu and its items
172 wxMenu *editMenu = new wxMenu;
173 editMenu->Append(ID_COPY_TO_COMPLEXDIAGRAM, _T("Copy selected to complex box"), _T("Creates a new complex box diagram with selected boxes"));
175 Connect(ID_COPY_TO_COMPLEXDIAGRAM,wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCopySelectedToComplexDiagram));
177 // Create Help menu and its items
178 wxMenu *helpMenu = new wxMenu;
179 helpMenu->Append(wxID_ABOUT, _T("&About..."), _T("About"));
181 // Append the created menu to the menu bar
182 wxMenuBar *menuBar = new wxMenuBar();
183 menuBar->Append(fileMenu, _T("&File"));
184 menuBar->Append(editMenu, _T("&Edit"));
185 menuBar->Append(helpMenu, _T("&Help"));
187 // Attach this menu bar to the frame
191 //=========================================================================
192 void wxGUIEditorGraphicBBS::initTabPanelsManager()
194 _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);
195 _tabsMgr = new wxTabPanelsManager(this);
196 _frameAUIMgr->AddPane(_notebook,wxAuiPaneInfo().CenterPane());
200 //=========================================================================
201 void wxGUIEditorGraphicBBS::initPackageBrowser()
203 _pkgBrowser = new WxGUIPackageBrowser2(this);
204 _pkgBrowser->IncludeAll();
205 _frameAUIMgr->AddPane(_pkgBrowser,wxAuiPaneInfo().Left().MinSize(200,200).CloseButton(false));
208 //================================================================
210 void wxGUIEditorGraphicBBS::DoRegeneratePackageDoc( const std::string& pack )
212 std::string mess("Regenerating doc for package '");
218 mess = "Regenerating doc for all packages";
221 mess += " ... please wait";
223 SetStatusText( std2wx(mess) );
231 command += ConfigurationFile::GetInstance().Get_bin_path();
232 command += ConfigurationFile::GetInstance().Get_file_separator();
233 command += "bbRegeneratePackageDoc";
238 command += " " + pack + " -q";
239 bbtkMessage("debug",1,"Executing system command '"<<command<<"'"<<std::endl);
241 if ( ! system ( command.c_str() ) )
243 SetStatusText( _T("Done !"));
245 wxMessageBox(_T("Done !"),_T("Regenerate package '")
246 +std2wx(pack)+_T("' doc"),
247 wxOK | wxICON_INFORMATION);
252 SetStatusText( _T("Done !"));
253 wxString err(_T("An error occured while running '"));
254 err += bbtk::std2wx(command) + _T("'");
255 wxMessageBox(err,_T("Regenerate package doc"),wxOK | wxICON_ERROR);
259 //================================================================
260 void wxGUIEditorGraphicBBS::DoRegenerateBoxesLists()
262 SetStatusText( _T("Regenerating boxes lists ... please wait") );
269 command += ConfigurationFile::GetInstance().Get_bin_path();
270 command += ConfigurationFile::GetInstance().Get_file_separator();
271 command += "bbRegenerateBoxesLists";
278 bbtkMessage("debug",1,"Executing system command '"<<command<<"'"<<std::endl);
280 if ( ! system ( command.c_str() ) )
282 SetStatusText( _T("Done !"));
284 wxMessageBox(_T("Done !"),_T("Regenerate boxes lists"),
285 wxOK | wxICON_INFORMATION);
290 SetStatusText( _T("Done !"));
291 wxString err(_T("An error occured while running '"));
292 err += bbtk::std2wx(command) + _T("'");
293 wxMessageBox(err,_T("Regenerate boxes lists"),wxOK | wxICON_ERROR);
297 //================================================================
298 void wxGUIEditorGraphicBBS::RegenerateAll()
300 DoRegeneratePackageDoc("-a");
301 DoRegenerateBoxesLists();
304 //================================================================
306 wxAuiNotebook* wxGUIEditorGraphicBBS::getAuiNotebook()
311 //================================================================
313 void wxGUIEditorGraphicBBS::displayBlackBoxInfo(std::string packageName, std::string boxName)
315 if(_actualPkgBrowserPkgName != packageName || _actualPkgBrowserBoxName != boxName )
317 _actualPkgBrowserPkgName = packageName;
318 _actualPkgBrowserBoxName = boxName;
320 BlackBoxDescriptor::Pointer descriptor = GObjectsMVCFactory::getInstance()->getBlackBoxDescriptor(packageName, boxName);
321 _pkgBrowser->WxGUIBlackBoxListUserOnSelected(descriptor.get());
325 //=========================================================================
327 void wxGUIEditorGraphicBBS::editBlackBox(GBlackBoxModel *bbmodel)
329 wxBlackBoxEditionDialog* dialog = new wxBlackBoxEditionDialog(this,bbmodel);
333 //=========================================================================
335 void wxGUIEditorGraphicBBS::updateStatusBar(std::string textStatus)
337 SetStatusText(crea::std2wx(textStatus));
340 //=========================================================================
342 void wxGUIEditorGraphicBBS::executeScript(std::string script)
344 std::string separator = ConfigurationFile::GetInstance().Get_file_separator ();
345 std::string dir = ConfigurationFile::GetInstance().Get_default_temp_dir();
346 std::string filename = dir + separator + "tmp_bbtk.bbs";
349 tempFile.open(filename.c_str());
353 std::string command = "\"";
359 //command += ConfigurationFile::GetInstance().Get_bin_path();
360 //EED command +="C:/temp/bbtkBIN/RelWithDebInfo//";
361 //EED command +="C:/Program Files/CreaTools/bbtk-0.9.5/bin";
365 command += separator + "usr/local/bin/bbi.app/Contents/MacOS/bbi\" ";
368 command += separator + "bbi\" ";
370 command += "\""+filename + "\"";
378 printf ("RaC wxGUIEditorGraphicBBS::executeScript %s \n" , command.c_str() );
379 system( command.c_str() );
382 //=========================================================================
384 //=========================================================================
386 void wxGUIEditorGraphicBBS::OnCreateNewTab(wxCommandEvent& event)
388 _tabsMgr->addNewTab();
389 refreshGUIControls();
392 //=========================================================================
394 void wxGUIEditorGraphicBBS::OnExecuteActualDiagram(wxCommandEvent& event)
396 std::string script = _tabsMgr->getActualDiagramBBS();
397 cout<<"RaC wxGUIEditorGraphicBBS::executeActualDiagram SCRIPT"<<endl;
400 executeScript(script);
404 //=========================================================================
406 //=========================================================================
407 void wxGUIEditorGraphicBBS::OnOpenBBS(wxCommandEvent& event)
409 wxFileDialog * openFileDialog = new wxFileDialog(this,wxT("Open BBS"),wxEmptyString,wxT("NewBBS"),wxT("*.bbs"),wxOPEN);
410 if (openFileDialog->ShowModal() == wxID_OK)
412 wxString fileName = openFileDialog->GetPath( );
413 printf("EED wxGUIEditorGraphicBBS::OnOpenBBS file=%s\n", (const char*) (fileName.mb_str()) );
416 _tabsMgr->addNewTab();
419 // bbtk::EExecuterBBSG::Pointer exe = bbtk::EExecuterBBSG::New( this->_tabsMgr->getActualTabPanel()->getSceneManager() , _pkgBrowser->GetFactory() );
420 bbtk::InterpreterBBS::Pointer I = bbtk::InterpreterBBS::New( this->_tabsMgr->getActualTabPanel()->getSceneManager() , _pkgBrowser->GetFactory());
422 // We tell the interpreter to throw exceptions on error
424 // Interpret the file supposed to define a box called 'Processing'
425 I->InterpretFile( (const char*) (fileName.mb_str()) );
427 refreshGUIControls();
430 void wxGUIEditorGraphicBBS::OnSaveActualBBS(wxCommandEvent& event)
432 wxFileDialog * saveFileDialog = new wxFileDialog(this,wxT("Save actual BBS"),wxEmptyString,wxT("NewBBS"),wxT("*.bbs"),wxSAVE|wxOVERWRITE_PROMPT);
433 if (saveFileDialog->ShowModal() == wxID_OK)
435 wxString fileName = saveFileDialog->GetPath( );
439 //EED file.open(fileName.c_str());
440 file.open( (const char*) (fileName.mb_str()) );
442 std::string content="";
444 // writing file header
445 content += "# ----------------------------------\n";
446 content += "# - BBTKGEditor v 1.0 BBS BlackBox Script\n";
447 content += "# ----------------------------------\n";
449 content += _tabsMgr->getActualDiagramBBS();
456 //=========================================================================
458 void wxGUIEditorGraphicBBS::OnSaveActualComplexBox(wxCommandEvent& event)
460 wxTextEntryDialog *nameDialog = new wxTextEntryDialog(this,wxT("Name of complex box"));
461 std::string cbName="";
462 if (nameDialog->ShowModal() == wxID_OK)
464 wxString fileName = nameDialog->GetValue();
465 cbName=(const char*) (fileName.mb_str());
470 wxFileDialog * saveFileDialog = new wxFileDialog(this ,wxT("Save Complex Box BBS") ,wxEmptyString, wxString( cbName.c_str(), wxConvUTF8),wxT("*.bbs"), wxSAVE | wxOVERWRITE_PROMPT);
471 if (saveFileDialog->ShowModal() == wxID_OK)
473 wxString fileName = saveFileDialog->GetPath();
476 file.open( (const char*) (fileName.mb_str()) );
478 std::string content="";
480 // writing file header
481 content += "# ----------------------------------\n";
482 content += "# - BBTKGEditor v 1.1 BBS BlackBox Script (Complex Box)\n";
483 content += "# ----------------------------------\n";
485 content += _tabsMgr->getActualComplexBoxBBS(cbName);
493 //=========================================================================
495 void wxGUIEditorGraphicBBS::OnSaveActualDiagram(wxCommandEvent& event)
497 wxFileDialog * saveFileDialog = new wxFileDialog(this,wxT("Save actual diagram"),wxEmptyString,wxT("NewDiagram"),wxT("*.bbg"),wxSAVE|wxOVERWRITE_PROMPT);
498 if (saveFileDialog->ShowModal() == wxID_OK)
500 wxString fileName = saveFileDialog->GetPath();
503 file.open( (const char*) (fileName.mb_str()) );
505 std::string content="";
507 // writing file header
508 content += "# ----------------------------------\n";
509 content += "# - BBTKGEditor v 1.0 BBG BlackBox Diagram file\n";
512 content += (const char*) (fileName.mb_str());
515 content += "# ----------------------------------\n";
517 content += "APP_START\n";
518 _tabsMgr->saveActualDiagram(content);
519 content += "APP_END\n";
526 //=========================================================================
528 void wxGUIEditorGraphicBBS::refreshGUIControls()
530 wxToolBar* toolbar = GetToolBar();
531 if(_tabsMgr->isActualDiagramComplexBox())
533 toolbar->ToggleTool(ID_BTNCOMPLEXBOX,true);
534 toolbar->EnableTool(ID_ADDCOMPLEXBOXINPUT,true);
535 toolbar->EnableTool(ID_ADDCOMPLEXBOXOUTPUT,true);
537 GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_COMPLEXBOX,true);
538 GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_BBS,false);
542 toolbar->ToggleTool(ID_BTNCOMPLEXBOX,false);
543 toolbar->EnableTool(ID_ADDCOMPLEXBOXINPUT,false);
544 toolbar->EnableTool(ID_ADDCOMPLEXBOXOUTPUT,false);
546 GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_COMPLEXBOX,false);
547 GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_BBS,true);
550 if(_tabsMgr->getNumActualSelectedObjects()>0)
552 GetMenuBar()->GetMenu(1)->Enable(ID_COPY_TO_COMPLEXDIAGRAM,true);
556 ///TODO Fix the possibility to say from the SceneManager to the GUI to refresh the options
557 GetMenuBar()->GetMenu(1)->Enable(ID_COPY_TO_COMPLEXDIAGRAM,true);
562 //=========================================================================
564 void wxGUIEditorGraphicBBS::OnDeleteAllBoxesActualDiagram(wxCommandEvent& event)
566 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);
567 if(dial->ShowModal() == wxID_YES)
569 _tabsMgr->deleteAllBoxesActualDiagram();
573 //=========================================================================
575 void wxGUIEditorGraphicBBS::OnCenterViewActualDiagram(wxCommandEvent& event)
577 _tabsMgr->centerViewActualDiagram();
580 //=========================================================================
583 void wxGUIEditorGraphicBBS::OnOpenDiagram(wxCommandEvent& event)
585 wxFileDialog * openFileDialog = new wxFileDialog(this,wxT("Open diagram"),wxEmptyString,wxT(""),wxT("*.bbg"),wxOPEN|wxFILE_MUST_EXIST);
586 if (openFileDialog->ShowModal() == wxID_OK)
588 wxString fileName = openFileDialog->GetPath();
590 ifstream inputStream;
592 //EED inputStream.open(fileName.c_str());
593 inputStream.open( (const char*) (fileName.mb_str()) );
597 _tabsMgr->addNewTab();
598 _tabsMgr->loadDiagram(inputStream);
602 refreshGUIControls();
605 //=========================================================================
607 void wxGUIEditorGraphicBBS::OnClickBtnComplexBox(wxCommandEvent& event)
609 wxToolBar* toolbar = GetToolBar();
610 bool temp = toolbar->GetToolState(ID_BTNCOMPLEXBOX);
613 _tabsMgr->setActualDiagramComplexBox(true);
617 _tabsMgr->setActualDiagramComplexBox(false);
619 refreshGUIControls();
622 //=========================================================================
624 void wxGUIEditorGraphicBBS::OnAddComplexBoxInput(wxCommandEvent& event)
626 wxTextEntryDialog *nameDialog = new wxTextEntryDialog(this,wxT("Name of input port"));
627 if (nameDialog->ShowModal() == wxID_OK)
629 wxString fileName = nameDialog->GetValue();
630 if(!fileName.IsEmpty())
632 std::string portName=(const char*) (fileName.mb_str());
633 _tabsMgr->addActualDiagramComplexInputPort(portName);
638 //=========================================================================
640 void wxGUIEditorGraphicBBS::OnAddComplexBoxOutput(wxCommandEvent& event)
642 wxTextEntryDialog *nameDialog = new wxTextEntryDialog(this,wxT("Name of output port"));
643 if (nameDialog->ShowModal() == wxID_OK)
645 wxString fileName = nameDialog->GetValue();
646 if(!fileName.IsEmpty())
648 std::string portName=(const char*) (fileName.mb_str());
649 _tabsMgr->addActualDiagramComplexOutputPort(portName);
654 //=========================================================================
656 void wxGUIEditorGraphicBBS::OnCopySelectedToComplexDiagram(wxCommandEvent& event)
658 _tabsMgr->copySelectedBBoxesToComplexDiagram();
661 //=========================================================================
663 void wxGUIEditorGraphicBBS::OnExit(wxCommandEvent& event)
668 //=========================================================================
670 } // EO namespace bbtk