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 <bbtkInterpreter.h>
40 #include <ExecuterBBSG.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 = "\"";
360 //command += ConfigurationFile::GetInstance().Get_bin_path();
361 //EED command +="C:/temp/bbtkBIN/RelWithDebInfo//";
362 //EED command +="C:/Program Files/CreaTools/bbtk-0.9.5/bin";
366 command += separator + "usr/local/bin/bbi.app/Contents/MacOS/bbi\" ";
369 command += separator + "bbi\" ";
371 command += "\""+filename + "\"";
379 printf ("RaC wxGUIEditorGraphicBBS::executeScript %s \n" , command.c_str() );
380 system( command.c_str() );
383 //=========================================================================
385 //=========================================================================
387 void wxGUIEditorGraphicBBS::OnCreateNewTab(wxCommandEvent& event)
389 _tabsMgr->addNewTab();
390 refreshGUIControls();
393 //=========================================================================
395 void wxGUIEditorGraphicBBS::OnExecuteActualDiagram(wxCommandEvent& event)
397 std::string script = _tabsMgr->getActualDiagramBBS();
398 cout<<"RaC wxGUIEditorGraphicBBS::executeActualDiagram SCRIPT"<<endl;
401 executeScript(script);
405 //=========================================================================
407 //=========================================================================
408 void wxGUIEditorGraphicBBS::OnOpenBBS(wxCommandEvent& event)
410 wxFileDialog * openFileDialog = new wxFileDialog(this,wxT("Open BBS"),wxEmptyString,wxT("NewBBS"),wxT("*.bbs"),wxOPEN);
411 if (openFileDialog->ShowModal() == wxID_OK)
413 wxString fileName = openFileDialog->GetPath( );
414 printf("EED wxGUIEditorGraphicBBS::OnOpenBBS file=%s\n", (const char*) (fileName.mb_str()) );
416 bbtk::EExecuterBBSG::Pointer exe = bbtk::EExecuterBBSG::New();
417 // EExecuterBBSG *exe = new EExecuterBBSG();
418 bbtk::Interpreter::Pointer I = bbtk::Interpreter::New( boost::static_pointer_cast<VirtualExec>(exe) );
419 // bbtk::Interpreter::Pointer I = bbtk::Interpreter::New( ExecuterBBSG::New() );
420 // bbtk::Interpreter::Pointer I = bbtk::Interpreter::New( );
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()) );
431 void wxGUIEditorGraphicBBS::OnSaveActualBBS(wxCommandEvent& event)
433 wxFileDialog * saveFileDialog = new wxFileDialog(this,wxT("Save actual BBS"),wxEmptyString,wxT("NewBBS"),wxT("*.bbs"),wxSAVE|wxOVERWRITE_PROMPT);
434 if (saveFileDialog->ShowModal() == wxID_OK)
436 wxString fileName = saveFileDialog->GetPath( );
440 //EED file.open(fileName.c_str());
441 file.open( (const char*) (fileName.mb_str()) );
443 std::string content="";
445 // writing file header
446 content += "# ----------------------------------\n";
447 content += "# - BBTKGEditor v 1.0 BBS BlackBox Script\n";
448 content += "# ----------------------------------\n";
450 content += _tabsMgr->getActualDiagramBBS();
457 //=========================================================================
459 void wxGUIEditorGraphicBBS::OnSaveActualComplexBox(wxCommandEvent& event)
461 wxTextEntryDialog *nameDialog = new wxTextEntryDialog(this,wxT("Name of complex box"));
462 std::string cbName="";
463 if (nameDialog->ShowModal() == wxID_OK)
465 wxString fileName = nameDialog->GetValue();
466 //EED cbName=fileName;
467 cbName=(const char*) (fileName.mb_str());
472 wxFileDialog * saveFileDialog = new wxFileDialog(this ,wxT("Save Complex Box BBS") ,wxEmptyString, wxString( cbName.c_str(), wxConvUTF8),wxT("*.bbs"), wxSAVE | wxOVERWRITE_PROMPT);
473 if (saveFileDialog->ShowModal() == wxID_OK)
475 wxString fileName = saveFileDialog->GetPath();
478 //EED file.open(fileName.c_str());
479 file.open( (const char*) (fileName.mb_str()) );
481 std::string content="";
483 // writing file header
484 content += "# ----------------------------------\n";
485 content += "# - BBTKGEditor v 1.1 BBS BlackBox Script (Complex Box)\n";
486 content += "# ----------------------------------\n";
488 content += _tabsMgr->getActualComplexBoxBBS(cbName);
496 //=========================================================================
498 void wxGUIEditorGraphicBBS::OnSaveActualDiagram(wxCommandEvent& event)
500 wxFileDialog * saveFileDialog = new wxFileDialog(this,wxT("Save actual diagram"),wxEmptyString,wxT("NewDiagram"),wxT("*.bbg"),wxSAVE|wxOVERWRITE_PROMPT);
501 if (saveFileDialog->ShowModal() == wxID_OK)
503 wxString fileName = saveFileDialog->GetPath();
506 //EED file.open(fileName.c_str());
507 file.open( (const char*) (fileName.mb_str()) );
509 std::string content="";
511 // writing file header
512 content += "# ----------------------------------\n";
513 content += "# - BBTKGEditor v 1.0 BBG BlackBox Diagram file\n";
516 //EED content += fileName;
517 content += (const char*) (fileName.mb_str());
520 content += "# ----------------------------------\n";
522 content += "APP_START\n";
523 _tabsMgr->saveActualDiagram(content);
524 content += "APP_END\n";
531 //=========================================================================
533 void wxGUIEditorGraphicBBS::refreshGUIControls()
535 wxToolBar* toolbar = GetToolBar();
536 if(_tabsMgr->isActualDiagramComplexBox())
538 toolbar->ToggleTool(ID_BTNCOMPLEXBOX,true);
539 toolbar->EnableTool(ID_ADDCOMPLEXBOXINPUT,true);
540 toolbar->EnableTool(ID_ADDCOMPLEXBOXOUTPUT,true);
542 GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_COMPLEXBOX,true);
543 GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_BBS,false);
547 toolbar->ToggleTool(ID_BTNCOMPLEXBOX,false);
548 toolbar->EnableTool(ID_ADDCOMPLEXBOXINPUT,false);
549 toolbar->EnableTool(ID_ADDCOMPLEXBOXOUTPUT,false);
551 GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_COMPLEXBOX,false);
552 GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_BBS,true);
555 if(_tabsMgr->getNumActualSelectedObjects()>0)
557 GetMenuBar()->GetMenu(1)->Enable(ID_COPY_TO_COMPLEXDIAGRAM,true);
561 ///TODO Fix the possibility to say from the SceneManager to the GUI to refresh the options
562 GetMenuBar()->GetMenu(1)->Enable(ID_COPY_TO_COMPLEXDIAGRAM,true);
567 //=========================================================================
569 void wxGUIEditorGraphicBBS::OnDeleteAllBoxesActualDiagram(wxCommandEvent& event)
571 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);
572 if(dial->ShowModal() == wxID_YES)
574 _tabsMgr->deleteAllBoxesActualDiagram();
578 //=========================================================================
580 void wxGUIEditorGraphicBBS::OnCenterViewActualDiagram(wxCommandEvent& event)
582 _tabsMgr->centerViewActualDiagram();
585 //=========================================================================
588 void wxGUIEditorGraphicBBS::OnOpenDiagram(wxCommandEvent& event)
590 wxFileDialog * openFileDialog = new wxFileDialog(this,wxT("Open diagram"),wxEmptyString,wxT(""),wxT("*.bbg"),wxOPEN|wxFILE_MUST_EXIST);
591 if (openFileDialog->ShowModal() == wxID_OK)
593 wxString fileName = openFileDialog->GetPath();
595 ifstream inputStream;
597 //EED inputStream.open(fileName.c_str());
598 inputStream.open( (const char*) (fileName.mb_str()) );
602 _tabsMgr->addNewTab();
603 _tabsMgr->loadDiagram(inputStream);
607 refreshGUIControls();
610 //=========================================================================
612 void wxGUIEditorGraphicBBS::OnClickBtnComplexBox(wxCommandEvent& event)
614 wxToolBar* toolbar = GetToolBar();
615 bool temp = toolbar->GetToolState(ID_BTNCOMPLEXBOX);
618 _tabsMgr->setActualDiagramComplexBox(true);
622 _tabsMgr->setActualDiagramComplexBox(false);
624 refreshGUIControls();
627 //=========================================================================
629 void wxGUIEditorGraphicBBS::OnAddComplexBoxInput(wxCommandEvent& event)
631 wxTextEntryDialog *nameDialog = new wxTextEntryDialog(this,wxT("Name of input port"));
632 if (nameDialog->ShowModal() == wxID_OK)
634 wxString fileName = nameDialog->GetValue();
635 if(!fileName.IsEmpty())
637 std::string portName=(const char*) (fileName.mb_str());
638 _tabsMgr->addActualDiagramComplexInputPort(portName);
643 //=========================================================================
645 void wxGUIEditorGraphicBBS::OnAddComplexBoxOutput(wxCommandEvent& event)
647 wxTextEntryDialog *nameDialog = new wxTextEntryDialog(this,wxT("Name of output port"));
648 if (nameDialog->ShowModal() == wxID_OK)
650 wxString fileName = nameDialog->GetValue();
651 if(!fileName.IsEmpty())
653 std::string portName=(const char*) (fileName.mb_str());
654 _tabsMgr->addActualDiagramComplexOutputPort(portName);
659 //=========================================================================
661 void wxGUIEditorGraphicBBS::OnCopySelectedToComplexDiagram(wxCommandEvent& event)
663 _tabsMgr->copySelectedBBoxesToComplexDiagram();
666 //=========================================================================
668 void wxGUIEditorGraphicBBS::OnExit(wxCommandEvent& event)
673 //=========================================================================
675 } // EO namespace bbtk