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"
39 //must go #include "bbtkUtilities.h"
40 //must go #include "bbtkConfigurationFile.h"
43 #include <InterpreterBBS.h>
47 //=========================================================================
48 wxGUIEditorGraphicBBS::wxGUIEditorGraphicBBS(wxFrame *parent) :
49 wxFrame(parent, -1, _T("bbtkGEditor"), wxDefaultPosition, wxSize(
52 _frameAUIMgr = new wxAuiManager(this);
54 /*std::string datadir( crea::System::GetExecutablePath() );
55 std::string datadir (".");
56 cout<<"RaC //------------------"<<endl;
57 cout<<"RaC //TODO wxGUIEditorGraphicBBS constructor.Initialize datadir with crea::System::GetExecutablePath() ."<<endl;
58 cout<<"RaC //------------------"<<endl;
60 #ifdef LINUX // assume this is OSX
61 datadir=datadir+"/../share/creaContours";
64 #ifdef MACOSX // assume this is OSX
65 datadir=datadir+"/../../../../share/creaContours";
72 initTabPanelsManager();
74 // JGGR & CM initHelpHTMLBrowser();
75 _helpHtmlBrowser = NULL;
77 _frameAUIMgr->Update();
78 _actualPkgBrowserBoxName = "";
79 _actualPkgBrowserPkgName = "";
82 /////////////////////////////////
83 /// IMPORTANT!! FOR SAVE&LOAD PROCESSES THE VERSION IS VERY IMPORTANT.
84 /// RaC 2012 2nd Hackfest
85 _currentBBGversion="1.4";
88 //=========================================================================
89 wxGUIEditorGraphicBBS::~wxGUIEditorGraphicBBS() {
91 printf("EED %p ~wxGUIEditorGraphicBBS()\n", this);
93 //EED02JUIN2010 delete _tabsMgr;
95 _frameAUIMgr->UnInit();
103 //=========================================================================
104 void wxGUIEditorGraphicBBS::initToolbar() {
105 wxBitmap bmp_new(new_xpm);
106 wxBitmap bmp_open(open_xpm);
107 wxBitmap bmp_save(save_xpm);
108 wxBitmap bmp_run(run_xpm);
109 wxBitmap bmp_delete(delete_xpm);
110 wxBitmap bmp_centerview(centerview_xpm);
111 wxBitmap bmp_box(box_xpm);
112 wxBitmap bmp_executablebox(executablebox_xpm);
113 wxBitmap bmp_complexbox(complexbox_xpm);
114 wxBitmap bmp_complexinputport(complexinputport_xpm);
115 wxBitmap bmp_complexoutputport(complexoutputport_xpm);
116 wxBitmap bmp_undo(undo_xpm);
117 wxBitmap bmp_redo(redo_xpm);
118 wxBitmap bmp_editProperties(editProperties_xpm);
119 wxToolBar *toolbar = new wxToolBar(this, wxID_ANY);
121 //Adds a tool btn to the toolbar
122 toolbar->AddTool(ID_NEW, _T("New"), bmp_new, wxNullBitmap, wxITEM_NORMAL,
123 _T("New tab"), _T("Create a new panel tab"));
124 toolbar->AddTool(ID_OPEN, _T("Open diagram"), bmp_open, wxNullBitmap,
125 wxITEM_NORMAL, _T("Open a diagram"), _T("Open a diagram"));
126 toolbar->AddTool(ID_SAVE_DIAGRAM, _T("Save Diagram"), bmp_save,
127 wxNullBitmap, wxITEM_NORMAL, _T("Saves the current diagram"),
128 _T("Saves the current diagram")); //DFCH
129 //toolbar->AddTool(ID_SAVE_AS_DIAGRAM,_T("Save Diagram As"),bmp_save, wxNullBitmap, wxITEM_NORMAL,_T("Saves the current diagram"), _T("Saves the current diagram")); //DFCH
130 toolbar->AddTool(ID_RUN, _T("Run"), bmp_run, wxNullBitmap, wxITEM_NORMAL,
131 _T("Execute actual diagram"), _T("Execute actual diagram"));
132 toolbar->AddTool(ID_DELETEALL, _T("Delete all"), bmp_delete, wxNullBitmap,
133 wxITEM_NORMAL, _T("Delete all boxes"), _T("Delete all boxes"));
134 toolbar->AddTool(ID_CENTERVIEW, _T("Center view"), bmp_centerview,
135 wxNullBitmap, wxITEM_NORMAL, _T("Center view"), _T("Center view"));
136 toolbar->AddSeparator();
137 toolbar->AddTool(ID_BTNBOX, _T("New Box"), bmp_box, wxNullBitmap,
138 wxITEM_NORMAL, _T("New Box"), _T("Nex Box"));
139 toolbar->AddSeparator();
140 toolbar->AddTool(ID_BTEXECUTABLEBOX, _T("Select as executable Box"),
141 bmp_executablebox, wxNullBitmap, wxITEM_NORMAL,
142 _T("Select as executable Box"), _T("Select as executable Box"));
143 toolbar->AddSeparator();
144 toolbar->AddTool(ID_BTNCOMPLEXBOX, _T("Complex box"), complexbox_xpm,
145 wxNullBitmap, wxITEM_NORMAL, _T("Complex box"), _T("Complex box"));
146 toolbar->SetToggle(ID_BTNCOMPLEXBOX, true);
148 // RaC 2012 2nd HackFest - Now Complex inputs are any external input
149 // toolbar->AddTool(ID_ADDCOMPLEXBOXINPUT, _T("Add input to Complex box"),
150 // bmp_complexinputport, wxNullBitmap, wxITEM_NORMAL,
151 // _T("Add input to Complex box"), _T("Add input to Complex box"));
152 toolbar->AddTool(ID_ADDCOMPLEXBOXINPUT, _T("Add external input (Complex box or console app)"),
153 bmp_complexinputport, wxNullBitmap, wxITEM_NORMAL,
154 _T("Add external input (Complex box or console app)"), _T("Add external input (Complex box or console app)"));
156 toolbar->AddTool(ID_ADDCOMPLEXBOXOUTPUT, _T("Add output to Complex box"),
157 bmp_complexoutputport, wxNullBitmap, wxITEM_NORMAL,
158 _T("Add output Complex box"), _T("Add output Complex box"));
160 // toolbar->EnableTool(ID_ADDCOMPLEXBOXINPUT, false); RaC2012 2nd HackFest
161 toolbar->EnableTool(ID_ADDCOMPLEXBOXINPUT, true);
163 toolbar->EnableTool(ID_ADDCOMPLEXBOXOUTPUT, false);
164 toolbar->AddSeparator();
165 toolbar->AddTool(ID_UNDO, _T("Undo"),bmp_undo, wxNullBitmap, wxITEM_NORMAL, _T("Undo"), _T("Undo"));
166 toolbar->AddTool(ID_REDO, _T("Redo"),bmp_redo, wxNullBitmap, wxITEM_NORMAL, _T("Redo"), _T("Redo"));
167 toolbar->AddSeparator();
168 toolbar->AddTool(ID_EDITPROPERTIES, _T("Edit diagram properties"),bmp_editProperties, wxNullBitmap, wxITEM_NORMAL, _T("Edit diagram properties"), _T("Edit diagram properties"));
169 toolbar->EnableTool(ID_EDITPROPERTIES, false);
171 toolbar->EnableTool(ID_UNDO, false);
172 toolbar->EnableTool(ID_REDO, false);
173 toolbar->SetMargins(2, 2);
178 // connect command event handlers
180 Connect(ID_NEW, wxEVT_COMMAND_TOOL_CLICKED,
181 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCreateNewTab));
182 Connect(ID_OPEN, wxEVT_COMMAND_TOOL_CLICKED,
183 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnOpenDiagram));
184 Connect(ID_SAVE_DIAGRAM, wxEVT_COMMAND_TOOL_CLICKED,
185 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveActualDiagram)); //DFCH
186 Connect(ID_SAVE_AS_DIAGRAM, wxEVT_COMMAND_TOOL_CLICKED,
187 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveAsActualDiagram)); //DFCH
190 wxEVT_COMMAND_TOOL_CLICKED,
191 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnExecuteActualDiagram));
194 wxEVT_COMMAND_TOOL_CLICKED,
195 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnDeleteAllBoxesActualDiagram));
198 wxEVT_COMMAND_TOOL_CLICKED,
199 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCenterViewActualDiagram));
200 Connect(ID_BTNBOX, wxEVT_COMMAND_TOOL_CLICKED,
201 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnClickBtnBox));
204 wxEVT_COMMAND_TOOL_CLICKED,
205 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnClickBtnExecutableBox));
206 Connect(ID_BTNCOMPLEXBOX, wxEVT_COMMAND_TOOL_CLICKED,
207 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnClickBtnComplexBox));
208 Connect(ID_ADDCOMPLEXBOXINPUT, wxEVT_COMMAND_TOOL_CLICKED,
209 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnAddComplexBoxInput));
210 Connect(ID_ADDCOMPLEXBOXOUTPUT, wxEVT_COMMAND_TOOL_CLICKED,
211 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnAddComplexBoxOutput));
212 Connect(ID_UNDO,wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnUndo));
213 Connect(ID_REDO,wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnRedo));
214 Connect(ID_CHANGENAME, wxEVT_COMMAND_RIGHT_CLICK, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnChangeName));
215 Connect(ID_EDITPROPERTIES,wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnEditDiagramProperties));
218 //=========================================================================
219 void wxGUIEditorGraphicBBS::initHelpHTMLBrowser() {
221 _helpHtmlBrowser = new WxGUIHtmlBrowser(this, wxSize(200, 0));
227 //=========================================================================
228 void wxGUIEditorGraphicBBS::initMenu() {
229 // Create File menu and its items
230 wxMenu *fileMenu = new wxMenu();
231 fileMenu->Append(ID_NEW, _T("New diagram"), _T("New"));
232 fileMenu->Append(ID_SAVE_DIAGRAM, _T("Save Diagram"), _T("Save Diagram")); //DFCH
233 fileMenu->Append(ID_SAVE_AS_DIAGRAM, _T("Save Diagram As"),
234 _T("Save Diagram As")); //DFCH
235 fileMenu->Append(ID_OPEN_BBS, _T("Open BBS"), _T("Open BBS"));
237 fileMenu->Append(ID_OPEN, _T("Open a diagram"), _T("Open a diagram"));
238 fileMenu->Append(ID_SAVE_AS_BBS, _T("Save BBS"), _T("Save BBS"));
239 fileMenu->Append(ID_SAVE_AS_COMPLEXBOX, _T("Save complex box"),
240 _T("Save complex box"));
241 fileMenu->Append(ID_EXPORT_CONSOLEAPP, _T("Export console commands"),
242 _T("Export console execution commands"));
243 fileMenu->Append(wxID_EXIT, _T("E&xit"), _T("Exit"));
245 Connect(ID_NEW, wxEVT_COMMAND_MENU_SELECTED,
246 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCreateNewTab));
247 Connect(ID_SAVE_DIAGRAM, wxEVT_COMMAND_MENU_SELECTED,
248 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveActualDiagram)); //DFCH
249 Connect(ID_SAVE_AS_DIAGRAM, wxEVT_COMMAND_MENU_SELECTED,
250 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveAsActualDiagram));
251 Connect(ID_OPEN_BBS, wxEVT_COMMAND_MENU_SELECTED,
252 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnOpenBBS));
253 Connect(ID_SAVE_AS_BBS, wxEVT_COMMAND_MENU_SELECTED,
254 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveActualBBS));
256 ID_SAVE_AS_COMPLEXBOX,
257 wxEVT_COMMAND_MENU_SELECTED,
258 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveActualComplexBox));
260 ID_EXPORT_CONSOLEAPP,
261 wxEVT_COMMAND_MENU_SELECTED,
262 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnExportConsoleExecCommand));
263 Connect(wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED,
264 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnExit));
266 // Create Help menu and its items
267 wxMenu *editMenu = new wxMenu;
268 editMenu->Append(ID_COPY_TO_COMPLEXDIAGRAM,
269 _T("Copy selected to complex box"),
270 _T("Creates a new complex box diagram with selected boxes"));
273 ID_COPY_TO_COMPLEXDIAGRAM,
274 wxEVT_COMMAND_MENU_SELECTED,
275 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCopySelectedToComplexDiagram));
277 // Create Help menu and its items
278 wxMenu *helpMenu = new wxMenu;
279 helpMenu->Append(wxID_ABOUT, _T("&About..."), _T("About"));
280 helpMenu->Append(ID_HELP_BBEDITOR, _T("&Help..."), _T("Help"));
281 Connect(ID_HELP_BBEDITOR, wxEVT_COMMAND_MENU_SELECTED,
282 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnHelpBBeditor));
285 wxMenu *menuTools = new wxMenu;
286 menuTools->Append(ID_bbEditor_Tool_Menu_CreatePackage,
287 _T("Create &package") );
288 menuTools->Append(ID_bbEditor_Tool_Menu_CreateBlackBox,
289 _T("Create &blackbox") );
290 menuTools->Append(ID_bbEditor_Tool_Menu_PlugPackage, _T("Plug package") );
291 menuTools->Append(ID_bbEditor_Tool_Menu_EditConfig, _T("&Edit bbtk config") );
292 menuTools->Append(ID_bbEditor_Tool_Menu_ShowHTMLDoc,
293 _T("Show &HTML documentation") );
294 menuTools->Append(ID_bbEditor_Tool_Menu_CreateIndex, _T("&Generate index") );
296 Connect(ID_bbEditor_Tool_Menu_CreatePackage, wxEVT_COMMAND_MENU_SELECTED,
297 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCreatePackage));
298 Connect(ID_bbEditor_Tool_Menu_CreateBlackBox, wxEVT_COMMAND_MENU_SELECTED,
299 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCreateBlackBox));
300 Connect(ID_bbEditor_Tool_Menu_PlugPackage, wxEVT_COMMAND_MENU_SELECTED,
301 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnPlugPackage));
302 Connect(ID_bbEditor_Tool_Menu_EditConfig, wxEVT_COMMAND_MENU_SELECTED,
303 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnEditConfig));
304 Connect(ID_bbEditor_Tool_Menu_ShowHTMLDoc, wxEVT_COMMAND_MENU_SELECTED,
305 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnShowHTMLDoc));
306 Connect(ID_bbEditor_Tool_Menu_CreateIndex, wxEVT_COMMAND_MENU_SELECTED,
307 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCreateIndex));
309 // Append the created menu to the menu bar
310 wxMenuBar *menuBar = new wxMenuBar();
311 menuBar->Append(fileMenu, _T("&File") );
312 menuBar->Append(editMenu, _T("&Edit") );
313 menuBar->Append(menuTools, _T("&Tool") );
314 menuBar->Append(helpMenu, _T("&Help") );
316 // Attach this menu bar to the frame
320 //=========================================================================
321 void wxGUIEditorGraphicBBS::initTabPanelsManager()
323 _notebook = new wxAuiNotebook(this, wxID_NOTEBOOK, wxDefaultPosition,
324 wxDefaultSize, wxAUI_NB_TOP | wxAUI_NB_TAB_MOVE
325 | wxAUI_NB_CLOSE_ON_ACTIVE_TAB | wxAUI_NB_TAB_FIXED_WIDTH
326 | wxAUI_NB_WINDOWLIST_BUTTON);
327 _tabsMgr = new wxTabPanelsManager(this);
328 _frameAUIMgr->AddPane(_notebook, wxAuiPaneInfo().CenterPane());
331 //=========================================================================
332 void wxGUIEditorGraphicBBS::initPackageBrowser()
334 _pkgBrowser = new WxGUIPackageBrowser2(this);
335 _pkgBrowser->IncludeAll();
336 _frameAUIMgr->AddPane(_pkgBrowser, wxAuiPaneInfo().Left().MinSize(30, 500).BestSize(750,500).CloseButton(false));
339 //================================================================
341 void wxGUIEditorGraphicBBS::DoRegeneratePackageDoc(const std::string& pack)
343 std::string mess("Regenerating doc for package '");
347 mess = "Regenerating doc for all packages";
350 mess += " ... please wait";
352 SetStatusText(std2wx(mess));
360 command += ConfigurationFile::GetInstance().Get_bin_path();
361 command += ConfigurationFile::GetInstance().Get_file_separator();
362 command += "bbRegeneratePackageDoc";
367 command += " " + pack + " -q";
368 bbtkMessage("debug",1,"Executing system command '"<<command<<"'"<<std::endl);
370 if (!system(command.c_str())) {
371 SetStatusText(_T("Done !"));
373 wxMessageBox(_T("Done !"),_T("Regenerate package '")
374 +std2wx(pack)+_T("' doc"),
375 wxOK | wxICON_INFORMATION);
378 SetStatusText(_T("Done !"));
379 wxString err(_T("An error occured while running '"));
380 err += bbtk::std2wx(command) + _T("'");
381 wxMessageBox(err, _T("Regenerate package doc"), wxOK | wxICON_ERROR);
385 //================================================================
386 void wxGUIEditorGraphicBBS::DoRegenerateBoxesLists() {
387 SetStatusText(_T("Regenerating boxes lists ... please wait"));
394 command += ConfigurationFile::GetInstance().Get_bin_path();
395 command += ConfigurationFile::GetInstance().Get_file_separator();
396 command += "bbRegenerateBoxesLists";
403 bbtkMessage("debug",1,"Executing system command '"<<command<<"'"<<std::endl);
405 if (!system(command.c_str())) {
406 SetStatusText(_T("Done !"));
408 wxMessageBox(_T("Done !"),_T("Regenerate boxes lists"),
409 wxOK | wxICON_INFORMATION);
412 SetStatusText(_T("Done !"));
413 wxString err(_T("An error occured while running '"));
414 err += bbtk::std2wx(command) + _T("'");
415 wxMessageBox(err, _T("Regenerate boxes lists"), wxOK | wxICON_ERROR);
419 //================================================================
420 void wxGUIEditorGraphicBBS::RegenerateAll() {
421 DoRegeneratePackageDoc("-a");
422 DoRegenerateBoxesLists();
425 //================================================================
427 wxAuiNotebook* wxGUIEditorGraphicBBS::getAuiNotebook() {
431 //================================================================
433 void wxGUIEditorGraphicBBS::displayBlackBoxInfo(std::string packageName,
434 std::string boxName) {
435 if (_actualPkgBrowserPkgName != packageName || _actualPkgBrowserBoxName
437 _actualPkgBrowserPkgName = packageName;
438 _actualPkgBrowserBoxName = boxName;
440 BlackBoxDescriptor::Pointer descriptor =
441 GObjectsMVCFactory::getInstance()->getBlackBoxDescriptor(
442 packageName, boxName);
443 _pkgBrowser->WxGUIBlackBoxListUserOnSelected(descriptor.get());
447 //=========================================================================
449 void wxGUIEditorGraphicBBS::editBlackBox(GBlackBoxModel *bbmodel) {
450 wxBlackBoxEditionDialog* dialog =
451 new wxBlackBoxEditionDialog(this, bbmodel);
455 //=========================================================================
457 bool wxGUIEditorGraphicBBS::boxNameExists(std::string boxname) {
459 return this->_tabsMgr->getActualTabPanel()->getSceneManager()->boxExist(boxname);
462 //=========================================================================
464 void wxGUIEditorGraphicBBS::updateStatusBar(std::string textStatus) {
465 SetStatusText(crea::std2wx(textStatus));
468 //=========================================================================
470 void wxGUIEditorGraphicBBS::executeScript(std::string script) {
471 std::string separator =
472 ConfigurationFile::GetInstance().Get_file_separator();
473 std::string dir = ConfigurationFile::GetInstance().Get_default_temp_dir();
474 std::string filename = dir + separator + "tmp_bbtk.bbs";
477 tempFile.open(filename.c_str());
481 std::string command = "";
484 command += "start /b ";
487 // command += "\""+ crea::System::GetExecutablePath();
489 // command += separator + "../../../bbi.app/Contents/MacOS";
493 command += "\"" + filename + "\"";
499 printf("RaC wxGUIEditorGraphicBBS::executeScript %s \n", command.c_str());
500 system(command.c_str());
503 //=========================================================================
504 std::string wxGUIEditorGraphicBBS::CheckExtension(std::string filename, std::string extension) {
505 if(filename.size() > extension.size() ){
506 if( (filename.compare(filename.size()-extension.size(), extension.size(),extension)) !=0 ){
507 filename.append(extension);
510 filename.append(extension);
514 //=========================================================================
516 //=========================================================================
518 void wxGUIEditorGraphicBBS::OnCreateNewTab(wxCommandEvent& event) {
519 _tabsMgr->addNewTab();
520 refreshGUIControls();
523 void wxGUIEditorGraphicBBS::OnUndo(wxCommandEvent& event) {
524 unsigned short disable;
528 _tabsMgr->loadTempDiagram(0);
529 disable = _tabsMgr->getUndoState(stundo);
532 std::string name = _tabsMgr->GetNameTabPanel();
533 if(name[name.length() - 1] == '*')
535 name =name.substr(0,name.length()-1);
537 _tabsMgr->SetNameTabPanel(wxString (name.c_str(), wxConvUTF8));
540 GetToolBar()->EnableTool(ID_UNDO,disable);
541 GetToolBar()->SetToolShortHelp(ID_UNDO,crea::std2wx(stundo));
542 GetToolBar()->EnableTool(ID_REDO,_tabsMgr->getRedoState(stredo));
543 GetToolBar()->SetToolShortHelp(ID_REDO,crea::std2wx(stredo));
544 refreshGUIControls();
547 //=========================================================================
549 void wxGUIEditorGraphicBBS::OnRedo(wxCommandEvent& event) {
550 unsigned short disable;
554 _tabsMgr->loadTempDiagram(1);
555 std::string name = _tabsMgr->GetNameTabPanel();
556 if(name[name.length() - 1] != '*')
558 _tabsMgr->SetNameTabPanel(wxString (name.c_str(), wxConvUTF8));
559 GetToolBar()->EnableTool(ID_UNDO,_tabsMgr->getUndoState(stundo));
560 GetToolBar()->SetToolShortHelp(ID_UNDO,crea::std2wx(stundo));
561 GetToolBar()->EnableTool(ID_REDO,_tabsMgr->getRedoState(stredo));
562 GetToolBar()->SetToolShortHelp(ID_REDO,crea::std2wx(stredo));
563 refreshGUIControls();
566 void wxGUIEditorGraphicBBS::OnChangeName(wxCommandEvent& event){
569 //=========================================================================
571 void wxGUIEditorGraphicBBS::OnEditDiagramProperties(wxCommandEvent& event)
573 wxDiagramPropertiesEditionDialog* dialog =
574 new wxDiagramPropertiesEditionDialog(this);
578 //=========================================================================
580 void wxGUIEditorGraphicBBS::OnExecuteActualDiagram(wxCommandEvent& event) {
581 std::string script1 = _tabsMgr->getActualDiagramBBS(true);
582 cout << endl << "RaC wxGUIEditorGraphicBBS::executeActualDiagram SCRIPT"
584 cout << script1 << endl;
586 std::string script2 = _tabsMgr->getActualDiagramBBS(false);
587 executeScript(script2);
590 //=========================================================================
592 //=========================================================================
593 void wxGUIEditorGraphicBBS::OnOpenBBS(wxCommandEvent& event) {
594 wxFileDialog * openFileDialog = new wxFileDialog(this, wxT("Open BBS"),
595 wxEmptyString, wxT("NewBBS"), wxT("*.bbs"), wxOPEN);
596 if (openFileDialog->ShowModal() == wxID_OK) {
597 wxString fileName = openFileDialog->GetPath();
599 _tabsMgr->addNewTab(openFileDialog->GetFilename());
601 bbtk::InterpreterBBS::Pointer I = bbtk::InterpreterBBS::New(
602 this->_tabsMgr->getActualTabPanel()->getSceneManager(),
603 _pkgBrowser->GetFactory());
605 // We tell the interpreter to throw exceptions on error
607 // Interpret the file supposed to define a box called 'Processing'
608 I->InterpretFile((const char*) (fileName.mb_str()));
610 refreshGUIControls();
613 void wxGUIEditorGraphicBBS::SaveActualBBS(std::string filename) {
616 //EED file.open(fileName.c_str());
617 file.open(filename.c_str());
618 std::string content = "";
619 // writing file header
620 content += "# ----------------------------------\n";
621 content += "# - BBTKGEditor v ";
622 content += _currentBBGversion; //VERSION
623 content += " BBS BlackBox Script\n";
627 content += "# ----------------------------------\n";
629 content += _tabsMgr->getActualDiagramBBS();
634 void wxGUIEditorGraphicBBS::OnSaveActualBBS(wxCommandEvent& event) {
635 wxFileDialog * saveFileDialog = new wxFileDialog(this,
636 wxT("Save actual BBS"), wxEmptyString, wxT("NewBBS"),
637 wxT("*.bbs"), wxSAVE | wxOVERWRITE_PROMPT);
638 if (saveFileDialog->ShowModal() == wxID_OK) {
639 wxString fileName = saveFileDialog->GetPath();
640 std::string filename = (const char*) (fileName.mb_str());
641 filename=CheckExtension (filename, ".bbs");
642 SaveActualBBS(filename);
647 void wxGUIEditorGraphicBBS::AskComplexBoxConfiguration() {
648 std::string cbName = _tabsMgr->GetCbName();
649 std::string paName = _tabsMgr->GetCbPackageName();
651 wxTextEntryDialog *cbNameDialog = new wxTextEntryDialog(this,
652 wxT("Complex Box name"));
653 wxTextEntryDialog *paNameDialog = new wxTextEntryDialog(this,
654 wxT("Package name"));
656 cbNameDialog->SetValue(wxString(cbName.c_str(), wxConvUTF8));
657 paNameDialog->SetValue(wxString(paName.c_str(), wxConvUTF8));
659 if (cbNameDialog->ShowModal() == wxID_OK) {
660 wxString complexboxname = cbNameDialog->GetValue();
661 cbName = (const char*) (complexboxname.mb_str());
664 if (paNameDialog->ShowModal() == wxID_OK) {
665 wxString packagename = paNameDialog->GetValue();
666 paName = (const char*) (packagename.mb_str());
669 _tabsMgr->SetCbName(cbName);
670 _tabsMgr->SetCbPackageName(paName);
673 //=========================================================================
675 void wxGUIEditorGraphicBBS::SaveActualComplexBox(std::string filename) {
677 file.open(filename.c_str());
679 std::string content = "";
681 // writing file header
682 content += "# ----------------------------------\n";
683 content += "# - BBTKGEditor v ";
684 content += _currentBBGversion;//VERSION
685 content += " BBS BlackBox Script (Complex Box)\n";
689 content += "# ----------------------------------\n";
691 content += _tabsMgr->getActualComplexBoxBBS();
696 //=========================================================================
698 void wxGUIEditorGraphicBBS::OnSaveActualComplexBox(wxCommandEvent& event) {
699 wxFileDialog * saveFileDialog = new wxFileDialog(this,
700 wxT("Save Complex Box BBS"), wxEmptyString,
701 _T("ComplexBoxName"), wxT("*.bbs"), wxSAVE
702 | wxOVERWRITE_PROMPT);
703 if (saveFileDialog->ShowModal() == wxID_OK) {
704 wxString fileName = saveFileDialog->GetPath();
705 std::string filename = (const char*) (fileName.mb_str());
706 filename=CheckExtension (filename, ".bbs");
707 SaveActualComplexBox(filename);
711 //=========================================================================
712 void wxGUIEditorGraphicBBS::SaveActualDiagram(std::string filename) {
714 file.open(filename.c_str());
716 std::string content = "";
718 // writing file header
719 content += "# ----------------------------------\n";
720 content += "# - BBTKGEditor v ";
721 content += _currentBBGversion; //VERSION
722 content += " BBG BlackBox Diagram file\n";
728 content += "# ----------------------------------\n";
730 content += "APP_START\n";
731 _tabsMgr->saveActualDiagram(content, filename); //DFCH
732 content += "APP_END\n";
737 //=========================================================================
738 void wxGUIEditorGraphicBBS::SaveTempActualDiagram(const std::string &action)
742 std::string name = _tabsMgr->GetNameTabPanel();
743 if(name[name.length() - 1] != '*')
745 _tabsMgr->SetNameTabPanel(wxString (name.c_str(), wxConvUTF8));
746 _tabsMgr->saveTempActualDiagram(action);
747 GetToolBar()->EnableTool(ID_UNDO,_tabsMgr->getUndoState(stundo));
748 GetToolBar()->SetToolShortHelp(ID_UNDO,crea::std2wx(stundo));
749 GetToolBar()->EnableTool(ID_REDO,_tabsMgr->getRedoState(stredo));
750 GetToolBar()->SetToolShortHelp(ID_REDO,crea::std2wx(stredo));
753 //=========================================================================
755 //The following method allows to save the current diagram asking the filename
757 void wxGUIEditorGraphicBBS::SaveCurrentDiagramAs() {
758 wxFileDialog * saveFileDialog = new wxFileDialog(this,
759 wxT("Save current diagram"), wxEmptyString, wxT("NewDiagram"),
760 wxT("*.bbg"), wxSAVE | wxOVERWRITE_PROMPT);
761 if (saveFileDialog->ShowModal() == wxID_OK) {
762 //_tabsMgr->SetNameTabPanel(saveFileDialog->GetFilename());
763 wxString pathfileName = saveFileDialog->GetPath();
764 std::string pathfilename = (const char*) (pathfileName.mb_str());
765 pathfilename=CheckExtension (pathfilename, ".bbg");
767 //modify the tab name accordingly
768 wxString fileName = saveFileDialog->GetFilename();
769 std::string filename = (const char*) (fileName.mb_str());
770 filename=CheckExtension (filename, ".bbg");
771 _tabsMgr->SetNameTabPanel( wxString (filename.c_str(), wxConvUTF8) );
773 std::string pathfilenamebbs = pathfilename;
774 pathfilenamebbs[pathfilenamebbs.length() - 1] = 's';
775 if (_tabsMgr->isActualDiagramComplexBox() == false) {
776 SaveActualDiagram(pathfilename);
777 SaveActualBBS(pathfilenamebbs);
779 AskComplexBoxConfiguration();
780 SaveActualDiagram(pathfilename);
781 SaveActualComplexBox(pathfilenamebbs);
782 } //if isActualDiagramComplexBox
783 } // if saveFileDialog
785 //=========================================================================
787 void wxGUIEditorGraphicBBS::OnSaveActualDiagram(wxCommandEvent& event) {
788 std::string pathfilename = _tabsMgr->GetCurrentTabPanelPath();
789 if (pathfilename.empty()) {
790 SaveCurrentDiagramAs();
792 std::string pathfilenamebbs = pathfilename;
793 pathfilenamebbs[pathfilenamebbs.length() - 1] = 's';
795 if (_tabsMgr->isActualDiagramComplexBox() == false) {
796 std::string name = _tabsMgr->GetNameTabPanel();
797 if(name[name.length() - 1] == '*')
799 name =name.substr(0,name.length()-1);
801 _tabsMgr->SetNameTabPanel(wxString (name.c_str(), wxConvUTF8));
802 SaveActualDiagram(pathfilename);
803 SaveActualBBS(pathfilenamebbs);
805 AskComplexBoxConfiguration();
806 SaveActualDiagram(pathfilename);
807 SaveActualComplexBox(pathfilenamebbs);
808 } //if isActualDiagramComplexBox
811 //=========================================================================
813 void wxGUIEditorGraphicBBS::OnSaveAsActualDiagram(wxCommandEvent& event) {
814 SaveCurrentDiagramAs();
817 //=========================================================================
818 void wxGUIEditorGraphicBBS::OnExportConsoleExecCommand(wxCommandEvent& event)
820 wxFileDialog * saveFileDialog = new wxFileDialog(this,
821 wxT("Export console command"), wxEmptyString, wxT("ConsoleApp.txt"),
822 wxT("*.txt;*.bbs;*.bbg;*.sh;*.bat"), wxSAVE | wxOVERWRITE_PROMPT);
824 if (saveFileDialog->ShowModal() == wxID_OK)
826 wxString fileName = saveFileDialog->GetPath();
827 std::string filename = (const char*) (fileName.mb_str());
828 filename=CheckExtension (filename, ".txt");
831 file.open(filename.c_str());
833 std::vector<std::string> extInputs = _tabsMgr->getActualTabPanel()->getSceneManager()->GetExternalInputsNames();
835 //TODO PUT IN A METHOD OF A FILES AND TEXT MANAGER CLASS !!!
836 //std::string inputsInCommentsWin="";
837 //std::string inputsInCommentsUnix="";
838 //std::string inputsInOneLineWin="";
839 std::string inputsInOneLineUnix="";
840 for (unsigned int i = 0; i < extInputs.size(); ++i)
842 /* No gusto la idea al jefe pero por si acaso ...
843 * RaC 2012 2nd HackFest
845 inputsInCommentsWin+="REM ";
846 inputsInCommentsWin+=extInputs[i];
847 inputsInCommentsWin+="=\"value\"\n";
848 inputsInCommentsUnix+="# ";
849 inputsInCommentsUnix+=extInputs[i];
850 inputsInCommentsUnix+="=\"value\"\n";
853 sprintf (buffer, "%d", (i+1));
854 inputsInOneLineWin+=extInputs[i];
855 inputsInOneLineWin+="=\"%";
856 inputsInOneLineWin+=buffer;
857 inputsInOneLineWin+="\" ";
859 inputsInOneLineUnix+=extInputs[i];
860 inputsInOneLineUnix+="=\"<value>\" ";
865 std::string content = "";
866 // writing file header
867 content += "# ----------------------------------\n";
868 content += "# - BBTKGEditor v ";
869 content += _currentBBGversion; //VERSION
870 content += " Console Commands to execute BBS application\n";
874 content += "# ----------------------------------\n";
877 content += "# Command to execute bbi\n";
878 content += "bbi <bbs_path> ";
879 content += inputsInOneLineUnix;
881 /* No gusto la idea al jefe pero por si acaso ...
882 * RaC 2012 2nd HackFest
883 content += "# For Windows (copy the following lines to a .bat file)\n";
884 content += "REM BBS application\n";
885 content += "REM Inputs:\n";
886 content += inputsInCommentsWin;
887 content += "REM To use previous inputs, put %$inputName% in the corresponding input of the execution bbi line\n";
888 content += "bbi applicationBBS.bbs ";
889 content += inputsInOneLineWin;
892 content += "# For Linux or Mac (copy the following lines to a .sh file)\n";
893 content += "#!/bin/bash\n";
894 content += "# BBS application\n";
895 content += "# Inputs:\n";
896 content += inputsInCommentsUnix;
897 content += "# To use previous inputs, put $inputName in the corresponding input of the execution bbi line\n";
898 content += "bbi applicationBBS.bbs ";
899 content += inputsInOneLineUnix;
910 //=========================================================================
912 void wxGUIEditorGraphicBBS::refreshGUIControls() {
915 //RaC2012 2ndHackFest Next line seems weird ... To keep in mind for other devels
916 wxToolBar* toolbar = GetToolBar();
917 if (_tabsMgr->isActualDiagramComplexBox()) {
918 toolbar->ToggleTool(ID_BTNCOMPLEXBOX, true);
919 //toolbar->EnableTool(ID_ADDCOMPLEXBOXINPUT, true); RaC2012 2nd HackFest
920 toolbar->EnableTool(ID_ADDCOMPLEXBOXOUTPUT, true);
922 GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_COMPLEXBOX, true);
923 GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_BBS, false);
924 GetMenuBar()->GetMenu(0)->Enable(ID_EXPORT_CONSOLEAPP, false);
926 toolbar->ToggleTool(ID_BTNCOMPLEXBOX, false);
927 //toolbar->EnableTool(ID_ADDCOMPLEXBOXINPUT, false); RaC2012 2nd HackFest
928 toolbar->EnableTool(ID_ADDCOMPLEXBOXOUTPUT, false);
930 GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_COMPLEXBOX, false);
931 GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_BBS, true);
932 GetMenuBar()->GetMenu(0)->Enable(ID_EXPORT_CONSOLEAPP, true);
935 //RaC2012 2ndHackFest
936 GetToolBar()->EnableTool(ID_EDITPROPERTIES,true);
938 GetToolBar()->EnableTool(ID_UNDO,_tabsMgr->getUndoState(stundo));
939 GetToolBar()->SetToolShortHelp(ID_UNDO,crea::std2wx(stundo));
940 GetToolBar()->EnableTool(ID_REDO,_tabsMgr->getRedoState(stredo));
941 GetToolBar()->SetToolShortHelp(ID_REDO,crea::std2wx(stredo));
943 if (_tabsMgr->getNumActualSelectedObjects() > 0) {
944 GetMenuBar()->GetMenu(1)->Enable(ID_COPY_TO_COMPLEXDIAGRAM, true);
946 ///TODO Fix the possibility to say from the SceneManager to the GUI to refresh the options
947 GetMenuBar()->GetMenu(1)->Enable(ID_COPY_TO_COMPLEXDIAGRAM, true);
952 //=========================================================================
954 void wxGUIEditorGraphicBBS::OnDeleteAllBoxesActualDiagram(wxCommandEvent& event) {
955 wxMessageDialog *dial = new wxMessageDialog(NULL,
956 wxT("Are you sure to delete all boxes of the diagram?"),
957 wxT("Delete all boxes"), wxYES_NO | wxNO_DEFAULT
959 if (dial->ShowModal() == wxID_YES) {
960 _tabsMgr->deleteAllBoxesActualDiagram();
964 //=========================================================================
966 void wxGUIEditorGraphicBBS::OnCenterViewActualDiagram(wxCommandEvent& event) {
967 _tabsMgr->centerViewActualDiagram();
970 //=========================================================================
972 void wxGUIEditorGraphicBBS::OnOpenDiagram(wxCommandEvent& event) {
973 wxFileDialog * openFileDialog = new wxFileDialog(this, wxT("Open diagram"),
974 wxEmptyString, wxT(""), wxT("*.bbg"), wxOPEN | wxFILE_MUST_EXIST);
975 printf("SCP: wxGUIEditorGraphicBBS::OnOpenDiagram \n");
976 if (openFileDialog->ShowModal() == wxID_OK) {
977 wxString fileName = openFileDialog->GetPath();
978 ifstream inputStream;
979 std::string fName = (const char*) (fileName.mb_str());
981 inputStream.open(fName.c_str());
982 assert(inputStream.good()); // fails
983 _tabsMgr->addNewTab(openFileDialog->GetFilename());
984 _tabsMgr->loadDiagram(inputStream, fName);
985 _tabsMgr->saveTempActualDiagram("load diagram");
986 GetToolBar()->EnableTool(ID_UNDO, false);
987 GetToolBar()->EnableTool(ID_UNDO, false);
990 refreshGUIControls();
993 //=========================================================================
996 void wxGUIEditorGraphicBBS::OnClickBtnBox(wxCommandEvent& event) {
997 BlackBoxDescriptor *bbDes = _pkgBrowser->GetActualSelected();
999 std::string typeName = bbDes->GetTypeName();
1000 std::string packageName = bbDes->GetPackage()->GetName();
1002 wxGEditorTabPanel *pnl = this->_tabsMgr->getActualTabPanel();
1006 wxVtkSceneManager *scn = pnl->getSceneManager();
1007 scn->createGBlackBox(50, 50, packageName, typeName);
1011 SaveTempActualDiagram("New Box");
1016 //=========================================================================
1018 void wxGUIEditorGraphicBBS::OnClickBtnExecutableBox(wxCommandEvent& event) {
1020 wxGEditorTabPanel *pnl = this->_tabsMgr->getActualTabPanel();
1023 wxVtkSceneManager *scn = pnl->getSceneManager();
1024 if( scn->MakeBoxExecutable() )
1025 std::cout<<"DFCH: wxGUIEditorGraphicBBS::OnClickBtnExecutableBox...successful"<<std::endl;
1027 std::cout<<"DFCH: wxGUIEditorGraphicBBS::OnClickBtnExecutableBox...Error!!"<<std::endl;
1033 //=========================================================================
1035 void wxGUIEditorGraphicBBS::OnClickBtnComplexBox(wxCommandEvent& event) {
1036 wxToolBar* toolbar = GetToolBar();
1037 bool temp = toolbar->GetToolState(ID_BTNCOMPLEXBOX);
1041 disableComplexBox();
1045 //=========================================================================
1047 void wxGUIEditorGraphicBBS::OnAddComplexBoxInput(wxCommandEvent& event) {
1048 wxTextEntryDialog *nameDialog = new wxTextEntryDialog(this,
1049 wxT("Name of input port"));
1050 if (nameDialog->ShowModal() == wxID_OK) {
1051 wxString fileName = nameDialog->GetValue();
1052 if (!fileName.IsEmpty()) {
1053 std::string portName = (const char*) (fileName.mb_str());
1054 _tabsMgr->addActualDiagramComplexInputPort(portName);
1059 //=========================================================================
1061 void wxGUIEditorGraphicBBS::OnAddComplexBoxOutput(wxCommandEvent& event) {
1062 wxTextEntryDialog *nameDialog = new wxTextEntryDialog(this,
1063 wxT("Name of output port"));
1064 if (nameDialog->ShowModal() == wxID_OK) {
1065 wxString fileName = nameDialog->GetValue();
1066 if (!fileName.IsEmpty()) {
1067 std::string portName = (const char*) (fileName.mb_str());
1068 _tabsMgr->addActualDiagramComplexOutputPort(portName);
1073 //=========================================================================
1075 void wxGUIEditorGraphicBBS::OnCopySelectedToComplexDiagram(
1076 wxCommandEvent& event) {
1077 _tabsMgr->copySelectedBBoxesToComplexDiagram();
1080 void wxGUIEditorGraphicBBS::OnHelpBBeditor(wxCommandEvent& event) {
1081 printf("wxGUIEditorGraphicBBS::OnHelpBBeditor ....not implemented..\n");
1084 //=========================================================================
1085 void wxGUIEditorGraphicBBS::OnCreatePackage(wxCommandEvent& event) {
1087 bbtkSystemTools::CreatePackage();
1090 //=========================================================================
1091 void wxGUIEditorGraphicBBS::OnCreateBlackBox(wxCommandEvent& event) {
1092 bbtkSystemTools::CreateBlackBox();
1094 //=========================================================================
1095 void wxGUIEditorGraphicBBS::OnPlugPackage(wxCommandEvent& event) {
1096 //DFGO2012 Plug Package functionnalities
1097 long style = wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST;
1100 _T("Select package directory"),
1106 userResponse = FD->ShowModal();
1107 if(userResponse==wxID_OK)
1109 std::string path = wx2std (FD->GetPath()) ;
1110 std::string fname = path + "/bbtkPackage";
1111 std::cout << "Path chosen = \"" << FD->GetPath() << "\"" << std::endl;
1112 if ( Utilities::FileExists( fname ) )
1115 f.open(fname.c_str());
1120 bbtk::ConfigurationFile::GetInstance().AddPackagePathsAndWrite( path );
1122 DoRegeneratePackageDoc(pname);
1123 DoRegenerateBoxesLists();
1125 _pkgBrowser->RebuildList();
1127 wxMessageBox(_T("Package successfully plugged. Please restart bbEditor to see the new package in the package browser."),_T("Plug package"),wxOK | wxICON_INFORMATION);
1128 userResponse = wxID_CANCEL;
1132 std::string err = "The directory \"" + path + "\" does not contain a 'bbtkPackage' file.";
1135 err += "\nNote: If you are on Linux please select the folder and click \"Open\", don't enter in it.";
1139 wxMessageBox(crea::std2wx(err), _T("Plug package"),wxOK | wxICON_ERROR);
1140 // THE FOLLOWING LINE GIVES ERRORS BECAUSE IT IS NECESSARY TO USE std2wx
1141 //wxMessageBox( _T( err) , _T("Plug package"),wxOK | wxICON_ERROR);
1144 }while(userResponse != wxID_CANCEL);
1147 //=========================================================================
1148 void wxGUIEditorGraphicBBS::OnEditConfig(wxCommandEvent& event) {
1149 std::string commandStr;
1150 std::string configFile = ConfigurationFile::GetInstance().Get_config_xml_full_path();
1152 commandStr = "notepad.exe ";
1154 commandStr = "gedit ";
1156 commandStr = commandStr + configFile;
1157 std::cout << "system: " << commandStr << std::endl;
1158 system ( commandStr.c_str() );
1160 //=========================================================================
1162 void wxGUIEditorGraphicBBS::OnShowHTMLDoc(wxCommandEvent& event) {
1164 if (_helpHtmlBrowser != NULL){
1165 _frameAUIMgr->DetachPane(_helpHtmlBrowser);
1166 _helpHtmlBrowser->Destroy();
1168 initHelpHTMLBrowser();
1169 _frameAUIMgr->AddPane(_helpHtmlBrowser, wxAuiPaneInfo().Right().MinSize(200, 200));
1170 _frameAUIMgr->Update();
1171 refreshGUIControls();
1175 //=========================================================================
1176 void wxGUIEditorGraphicBBS::OnCreateIndex(wxCommandEvent& event) {
1177 printf("EED wxGUIEditorGraphicBBS::OnCreateIndex ... not implemented ..\n");
1180 //=========================================================================
1182 void wxGUIEditorGraphicBBS::OnExit(wxCommandEvent& event) {
1186 //=========================================================================
1188 void wxGUIEditorGraphicBBS::enableComplexBox() {
1189 _tabsMgr->setActualDiagramComplexBox(true);
1190 refreshGUIControls();
1193 //=========================================================================
1195 void wxGUIEditorGraphicBBS::disableComplexBox() {
1196 _tabsMgr->setActualDiagramComplexBox(false);
1197 refreshGUIControls();
1200 //=========================================================================
1202 void wxGUIEditorGraphicBBS::setCurrentDiagramDescription(std::string description)
1204 _tabsMgr->SetDescription(description);
1207 //=========================================================================
1209 void wxGUIEditorGraphicBBS::setCurrentDiagramAuthor(std::string author)
1211 _tabsMgr->SetAuthor(author);
1214 //=========================================================================
1216 void wxGUIEditorGraphicBBS::setCurrentDiagramCategory(std::string category)
1218 _tabsMgr->SetCategory(category);
1221 //=========================================================================
1223 std::string wxGUIEditorGraphicBBS::getCurrentDiagramDescription()
1225 return _tabsMgr->GetDescription();
1228 //=========================================================================
1230 std::string wxGUIEditorGraphicBBS::getCurrentDiagramAuthor()
1232 return _tabsMgr->GetAuthor();
1235 //=========================================================================
1238 std::string wxGUIEditorGraphicBBS::getCurrentDiagramCategory()
1240 return _tabsMgr->GetCategory();
1243 //=========================================================================
1245 bool wxGUIEditorGraphicBBS::isCurrentDiagramComplexBox()
1247 return _tabsMgr->isActualDiagramComplexBox();
1251 } // EO namespace bbtk