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(1200,800) )
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";
73 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, std::string boxName)
435 if (_actualPkgBrowserPkgName != packageName || _actualPkgBrowserBoxName != boxName)
437 _actualPkgBrowserPkgName = packageName;
438 _actualPkgBrowserBoxName = boxName;
440 //EED 15 oct 2012 BlackBoxDescriptor::Pointer descriptor = GObjectsMVCFactory::getInstance()->getBlackBoxDescriptor(packageName, boxName);
443 BlackBoxDescriptor::Pointer descriptor;
444 std::map< std::string, BlackBoxDescriptor::Pointer> mapDesc;
445 k = _pkgBrowser->GetFactory()->GetPackage(packageName);
446 mapDesc = k->GetDescriptorMap();
447 descriptor = mapDesc[boxName];
449 _pkgBrowser->WxGUIBlackBoxListUserOnSelected(descriptor.get());
453 //=========================================================================
455 void wxGUIEditorGraphicBBS::editBlackBox(GBlackBoxModel *bbmodel) {
456 wxBlackBoxEditionDialog* dialog =
457 new wxBlackBoxEditionDialog(this, bbmodel);
461 //=========================================================================
463 bool wxGUIEditorGraphicBBS::boxNameExists(std::string boxname) {
465 return this->_tabsMgr->getActualTabPanel()->getSceneManager()->boxExist(boxname);
468 //=========================================================================
470 void wxGUIEditorGraphicBBS::updateStatusBar(std::string textStatus) {
471 SetStatusText(crea::std2wx(textStatus));
474 //=========================================================================
476 void wxGUIEditorGraphicBBS::executeScript(std::string script) {
477 std::string separator =
478 ConfigurationFile::GetInstance().Get_file_separator();
479 std::string dir = ConfigurationFile::GetInstance().Get_default_temp_dir();
480 std::string filename = dir + separator + "tmp_bbtk.bbs";
483 tempFile.open(filename.c_str());
487 std::string command = "";
490 command += "start /b ";
493 // command += "\""+ crea::System::GetExecutablePath();
495 // command += separator + "../../../bbi.app/Contents/MacOS";
499 command += "\"" + filename + "\"";
505 printf("RaC wxGUIEditorGraphicBBS::executeScript %s \n", command.c_str());
506 system(command.c_str());
509 //=========================================================================
510 std::string wxGUIEditorGraphicBBS::CheckExtension(std::string filename, std::string extension) {
511 if(filename.size() > extension.size() ){
512 if( (filename.compare(filename.size()-extension.size(), extension.size(),extension)) !=0 ){
513 filename.append(extension);
516 filename.append(extension);
520 //=========================================================================
522 //=========================================================================
524 void wxGUIEditorGraphicBBS::OnCreateNewTab(wxCommandEvent& event) {
525 _tabsMgr->addNewTab();
526 refreshGUIControls();
529 void wxGUIEditorGraphicBBS::OnUndo(wxCommandEvent& event) {
530 unsigned short disable;
534 _tabsMgr->loadTempDiagram(0);
535 disable = _tabsMgr->getUndoState(stundo);
538 std::string name = _tabsMgr->GetNameTabPanel();
539 if(name[name.length() - 1] == '*')
541 name =name.substr(0,name.length()-1);
543 _tabsMgr->SetNameTabPanel(wxString (name.c_str(), wxConvUTF8));
546 GetToolBar()->EnableTool(ID_UNDO,disable);
547 GetToolBar()->SetToolShortHelp(ID_UNDO,crea::std2wx(stundo));
548 GetToolBar()->EnableTool(ID_REDO,_tabsMgr->getRedoState(stredo));
549 GetToolBar()->SetToolShortHelp(ID_REDO,crea::std2wx(stredo));
550 refreshGUIControls();
553 //=========================================================================
555 void wxGUIEditorGraphicBBS::OnRedo(wxCommandEvent& event) {
556 unsigned short disable;
560 _tabsMgr->loadTempDiagram(1);
561 std::string name = _tabsMgr->GetNameTabPanel();
562 if(name[name.length() - 1] != '*')
564 _tabsMgr->SetNameTabPanel(wxString (name.c_str(), wxConvUTF8));
565 GetToolBar()->EnableTool(ID_UNDO,_tabsMgr->getUndoState(stundo));
566 GetToolBar()->SetToolShortHelp(ID_UNDO,crea::std2wx(stundo));
567 GetToolBar()->EnableTool(ID_REDO,_tabsMgr->getRedoState(stredo));
568 GetToolBar()->SetToolShortHelp(ID_REDO,crea::std2wx(stredo));
569 refreshGUIControls();
572 void wxGUIEditorGraphicBBS::OnChangeName(wxCommandEvent& event){
575 //=========================================================================
577 void wxGUIEditorGraphicBBS::OnEditDiagramProperties(wxCommandEvent& event)
579 wxDiagramPropertiesEditionDialog* dialog =
580 new wxDiagramPropertiesEditionDialog(this);
584 //=========================================================================
586 void wxGUIEditorGraphicBBS::OnExecuteActualDiagram(wxCommandEvent& event) {
587 std::string script1 = _tabsMgr->getActualDiagramBBS(true);
588 cout << endl << "RaC wxGUIEditorGraphicBBS::executeActualDiagram SCRIPT"
590 cout << script1 << endl;
592 std::string script2 = _tabsMgr->getActualDiagramBBS(false);
593 executeScript(script2);
596 //=========================================================================
598 //=========================================================================
599 void wxGUIEditorGraphicBBS::OnOpenBBS(wxCommandEvent& event) {
600 wxFileDialog * openFileDialog = new wxFileDialog(this, wxT("Open BBS"),
601 wxEmptyString, wxT("NewBBS"), wxT("*.bbs"), wxOPEN);
602 if (openFileDialog->ShowModal() == wxID_OK) {
603 wxString fileName = openFileDialog->GetPath();
605 _tabsMgr->addNewTab(openFileDialog->GetFilename());
607 bbtk::InterpreterBBS::Pointer I = bbtk::InterpreterBBS::New(
608 this->_tabsMgr->getActualTabPanel()->getSceneManager(),
609 _pkgBrowser->GetFactory());
611 // We tell the interpreter to throw exceptions on error
613 // Interpret the file supposed to define a box called 'Processing'
614 I->InterpretFile((const char*) (fileName.mb_str()));
616 refreshGUIControls();
619 void wxGUIEditorGraphicBBS::SaveActualBBS(std::string filename) {
622 //EED file.open(fileName.c_str());
623 file.open(filename.c_str());
624 std::string content = "";
625 // writing file header
626 content += "# ----------------------------------\n";
627 content += "# - BBTKGEditor v ";
628 content += _currentBBGversion; //VERSION
629 content += " BBS BlackBox Script\n";
633 content += "# ----------------------------------\n";
635 content += _tabsMgr->getActualDiagramBBS();
640 void wxGUIEditorGraphicBBS::OnSaveActualBBS(wxCommandEvent& event) {
641 wxFileDialog * saveFileDialog = new wxFileDialog(this,
642 wxT("Save actual BBS"), wxEmptyString, wxT("NewBBS"),
643 wxT("*.bbs"), wxSAVE | wxOVERWRITE_PROMPT);
644 if (saveFileDialog->ShowModal() == wxID_OK) {
645 wxString fileName = saveFileDialog->GetPath();
646 std::string filename = (const char*) (fileName.mb_str());
647 filename=CheckExtension (filename, ".bbs");
648 SaveActualBBS(filename);
653 void wxGUIEditorGraphicBBS::AskComplexBoxConfiguration() {
654 std::string cbName = _tabsMgr->GetCbName();
655 std::string paName = _tabsMgr->GetCbPackageName();
657 wxTextEntryDialog *cbNameDialog = new wxTextEntryDialog(this,
658 wxT("Complex Box name"));
659 wxTextEntryDialog *paNameDialog = new wxTextEntryDialog(this,
660 wxT("Package name"));
662 cbNameDialog->SetValue(wxString(cbName.c_str(), wxConvUTF8));
663 paNameDialog->SetValue(wxString(paName.c_str(), wxConvUTF8));
665 if (cbNameDialog->ShowModal() == wxID_OK) {
666 wxString complexboxname = cbNameDialog->GetValue();
667 cbName = (const char*) (complexboxname.mb_str());
670 if (paNameDialog->ShowModal() == wxID_OK) {
671 wxString packagename = paNameDialog->GetValue();
672 paName = (const char*) (packagename.mb_str());
675 _tabsMgr->SetCbName(cbName);
676 _tabsMgr->SetCbPackageName(paName);
679 //=========================================================================
681 void wxGUIEditorGraphicBBS::SaveActualComplexBox(std::string filename) {
683 file.open(filename.c_str());
685 std::string content = "";
687 // writing file header
688 content += "# ----------------------------------\n";
689 content += "# - BBTKGEditor v ";
690 content += _currentBBGversion;//VERSION
691 content += " BBS BlackBox Script (Complex Box)\n";
695 content += "# ----------------------------------\n";
697 content += _tabsMgr->getActualComplexBoxBBS();
702 //=========================================================================
704 void wxGUIEditorGraphicBBS::OnSaveActualComplexBox(wxCommandEvent& event) {
705 wxFileDialog * saveFileDialog = new wxFileDialog(this,
706 wxT("Save Complex Box BBS"), wxEmptyString,
707 _T("ComplexBoxName"), wxT("*.bbs"), wxSAVE
708 | wxOVERWRITE_PROMPT);
709 if (saveFileDialog->ShowModal() == wxID_OK) {
710 wxString fileName = saveFileDialog->GetPath();
711 std::string filename = (const char*) (fileName.mb_str());
712 filename=CheckExtension (filename, ".bbs");
713 SaveActualComplexBox(filename);
717 //=========================================================================
718 void wxGUIEditorGraphicBBS::SaveActualDiagram(std::string filename) {
720 file.open(filename.c_str());
722 std::string content = "";
724 // writing file header
725 content += "# ----------------------------------\n";
726 content += "# - BBTKGEditor v ";
727 content += _currentBBGversion; //VERSION
728 content += " BBG BlackBox Diagram file\n";
734 content += "# ----------------------------------\n";
736 content += "APP_START\n";
737 _tabsMgr->saveActualDiagram(content, filename); //DFCH
738 content += "APP_END\n";
743 //=========================================================================
744 void wxGUIEditorGraphicBBS::SaveTempActualDiagram(const std::string &action)
748 std::string name = _tabsMgr->GetNameTabPanel();
749 if(name[name.length() - 1] != '*')
751 _tabsMgr->SetNameTabPanel(wxString (name.c_str(), wxConvUTF8));
752 _tabsMgr->saveTempActualDiagram(action);
753 GetToolBar()->EnableTool(ID_UNDO,_tabsMgr->getUndoState(stundo));
754 GetToolBar()->SetToolShortHelp(ID_UNDO,crea::std2wx(stundo));
755 GetToolBar()->EnableTool(ID_REDO,_tabsMgr->getRedoState(stredo));
756 GetToolBar()->SetToolShortHelp(ID_REDO,crea::std2wx(stredo));
759 //=========================================================================
761 //The following method allows to save the current diagram asking the filename
763 void wxGUIEditorGraphicBBS::SaveCurrentDiagramAs() {
764 wxFileDialog * saveFileDialog = new wxFileDialog(this,
765 wxT("Save current diagram"), wxEmptyString, wxT("NewDiagram"),
766 wxT("*.bbg"), wxSAVE | wxOVERWRITE_PROMPT);
767 if (saveFileDialog->ShowModal() == wxID_OK) {
768 //_tabsMgr->SetNameTabPanel(saveFileDialog->GetFilename());
769 wxString pathfileName = saveFileDialog->GetPath();
770 std::string pathfilename = (const char*) (pathfileName.mb_str());
771 pathfilename=CheckExtension (pathfilename, ".bbg");
773 //modify the tab name accordingly
774 wxString fileName = saveFileDialog->GetFilename();
775 std::string filename = (const char*) (fileName.mb_str());
776 filename=CheckExtension (filename, ".bbg");
777 _tabsMgr->SetNameTabPanel( wxString (filename.c_str(), wxConvUTF8) );
779 std::string pathfilenamebbs = pathfilename;
780 pathfilenamebbs[pathfilenamebbs.length() - 1] = 's';
781 if (_tabsMgr->isActualDiagramComplexBox() == false) {
782 SaveActualDiagram(pathfilename);
783 SaveActualBBS(pathfilenamebbs);
785 AskComplexBoxConfiguration();
786 SaveActualDiagram(pathfilename);
787 SaveActualComplexBox(pathfilenamebbs);
788 } //if isActualDiagramComplexBox
789 } // if saveFileDialog
791 //=========================================================================
793 void wxGUIEditorGraphicBBS::OnSaveActualDiagram(wxCommandEvent& event) {
794 std::string pathfilename = _tabsMgr->GetCurrentTabPanelPath();
795 if (pathfilename.empty()) {
796 SaveCurrentDiagramAs();
798 std::string pathfilenamebbs = pathfilename;
799 pathfilenamebbs[pathfilenamebbs.length() - 1] = 's';
801 if (_tabsMgr->isActualDiagramComplexBox() == false) {
802 std::string name = _tabsMgr->GetNameTabPanel();
803 if(name[name.length() - 1] == '*')
805 name =name.substr(0,name.length()-1);
807 _tabsMgr->SetNameTabPanel(wxString (name.c_str(), wxConvUTF8));
808 SaveActualDiagram(pathfilename);
809 SaveActualBBS(pathfilenamebbs);
811 AskComplexBoxConfiguration();
812 SaveActualDiagram(pathfilename);
813 SaveActualComplexBox(pathfilenamebbs);
814 } //if isActualDiagramComplexBox
817 //=========================================================================
819 void wxGUIEditorGraphicBBS::OnSaveAsActualDiagram(wxCommandEvent& event) {
820 SaveCurrentDiagramAs();
823 //=========================================================================
824 void wxGUIEditorGraphicBBS::OnExportConsoleExecCommand(wxCommandEvent& event)
826 wxFileDialog * saveFileDialog = new wxFileDialog(this,
827 wxT("Export console command"), wxEmptyString, wxT("ConsoleApp.txt"),
828 wxT("*.txt;*.bbs;*.bbg;*.sh;*.bat"), wxSAVE | wxOVERWRITE_PROMPT);
830 if (saveFileDialog->ShowModal() == wxID_OK)
832 wxString fileName = saveFileDialog->GetPath();
833 std::string filename = (const char*) (fileName.mb_str());
834 filename=CheckExtension (filename, ".txt");
837 file.open(filename.c_str());
839 std::vector<std::string> extInputs = _tabsMgr->getActualTabPanel()->getSceneManager()->GetExternalInputsNames();
841 //TODO PUT IN A METHOD OF A FILES AND TEXT MANAGER CLASS !!!
842 //std::string inputsInCommentsWin="";
843 //std::string inputsInCommentsUnix="";
844 //std::string inputsInOneLineWin="";
845 std::string inputsInOneLineUnix="";
846 for (unsigned int i = 0; i < extInputs.size(); ++i)
848 /* No gusto la idea al jefe pero por si acaso ...
849 * RaC 2012 2nd HackFest
851 inputsInCommentsWin+="REM ";
852 inputsInCommentsWin+=extInputs[i];
853 inputsInCommentsWin+="=\"value\"\n";
854 inputsInCommentsUnix+="# ";
855 inputsInCommentsUnix+=extInputs[i];
856 inputsInCommentsUnix+="=\"value\"\n";
859 sprintf (buffer, "%d", (i+1));
860 inputsInOneLineWin+=extInputs[i];
861 inputsInOneLineWin+="=\"%";
862 inputsInOneLineWin+=buffer;
863 inputsInOneLineWin+="\" ";
865 inputsInOneLineUnix+=extInputs[i];
866 inputsInOneLineUnix+="=\"<value>\" ";
871 std::string content = "";
872 // writing file header
873 content += "# ----------------------------------\n";
874 content += "# - BBTKGEditor v ";
875 content += _currentBBGversion; //VERSION
876 content += " Console Commands to execute BBS application\n";
880 content += "# ----------------------------------\n";
883 content += "# Command to execute bbi\n";
884 content += "bbi <bbs_path> ";
885 content += inputsInOneLineUnix;
887 /* No gusto la idea al jefe pero por si acaso ...
888 * RaC 2012 2nd HackFest
889 content += "# For Windows (copy the following lines to a .bat file)\n";
890 content += "REM BBS application\n";
891 content += "REM Inputs:\n";
892 content += inputsInCommentsWin;
893 content += "REM To use previous inputs, put %$inputName% in the corresponding input of the execution bbi line\n";
894 content += "bbi applicationBBS.bbs ";
895 content += inputsInOneLineWin;
898 content += "# For Linux or Mac (copy the following lines to a .sh file)\n";
899 content += "#!/bin/bash\n";
900 content += "# BBS application\n";
901 content += "# Inputs:\n";
902 content += inputsInCommentsUnix;
903 content += "# To use previous inputs, put $inputName in the corresponding input of the execution bbi line\n";
904 content += "bbi applicationBBS.bbs ";
905 content += inputsInOneLineUnix;
916 //=========================================================================
918 void wxGUIEditorGraphicBBS::refreshGUIControls() {
921 //RaC2012 2ndHackFest Next line seems weird ... To keep in mind for other devels
922 wxToolBar* toolbar = GetToolBar();
923 if (_tabsMgr->isActualDiagramComplexBox()) {
924 toolbar->ToggleTool(ID_BTNCOMPLEXBOX, true);
925 //toolbar->EnableTool(ID_ADDCOMPLEXBOXINPUT, true); RaC2012 2nd HackFest
926 toolbar->EnableTool(ID_ADDCOMPLEXBOXOUTPUT, true);
928 GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_COMPLEXBOX, true);
929 GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_BBS, false);
930 GetMenuBar()->GetMenu(0)->Enable(ID_EXPORT_CONSOLEAPP, false);
932 toolbar->ToggleTool(ID_BTNCOMPLEXBOX, false);
933 //toolbar->EnableTool(ID_ADDCOMPLEXBOXINPUT, false); RaC2012 2nd HackFest
934 toolbar->EnableTool(ID_ADDCOMPLEXBOXOUTPUT, false);
936 GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_COMPLEXBOX, false);
937 GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_BBS, true);
938 GetMenuBar()->GetMenu(0)->Enable(ID_EXPORT_CONSOLEAPP, true);
941 //RaC2012 2ndHackFest
942 GetToolBar()->EnableTool(ID_EDITPROPERTIES,true);
944 GetToolBar()->EnableTool(ID_UNDO,_tabsMgr->getUndoState(stundo));
945 GetToolBar()->SetToolShortHelp(ID_UNDO,crea::std2wx(stundo));
946 GetToolBar()->EnableTool(ID_REDO,_tabsMgr->getRedoState(stredo));
947 GetToolBar()->SetToolShortHelp(ID_REDO,crea::std2wx(stredo));
949 if (_tabsMgr->getNumActualSelectedObjects() > 0) {
950 GetMenuBar()->GetMenu(1)->Enable(ID_COPY_TO_COMPLEXDIAGRAM, true);
952 ///TODO Fix the possibility to say from the SceneManager to the GUI to refresh the options
953 GetMenuBar()->GetMenu(1)->Enable(ID_COPY_TO_COMPLEXDIAGRAM, true);
958 //=========================================================================
960 void wxGUIEditorGraphicBBS::OnDeleteAllBoxesActualDiagram(wxCommandEvent& event) {
961 wxMessageDialog *dial = new wxMessageDialog(NULL,
962 wxT("Are you sure to delete all boxes of the diagram?"),
963 wxT("Delete all boxes"), wxYES_NO | wxNO_DEFAULT
965 if (dial->ShowModal() == wxID_YES) {
966 _tabsMgr->deleteAllBoxesActualDiagram();
970 //=========================================================================
972 void wxGUIEditorGraphicBBS::OnCenterViewActualDiagram(wxCommandEvent& event) {
973 _tabsMgr->centerViewActualDiagram();
976 //=========================================================================
978 void wxGUIEditorGraphicBBS::OnOpenDiagram(wxCommandEvent& event) {
979 wxFileDialog * openFileDialog = new wxFileDialog(this, wxT("Open diagram"),
980 wxEmptyString, wxT(""), wxT("*.bbg"), wxOPEN | wxFILE_MUST_EXIST);
981 printf("SCP: wxGUIEditorGraphicBBS::OnOpenDiagram \n");
982 if (openFileDialog->ShowModal() == wxID_OK) {
983 wxString fileName = openFileDialog->GetPath();
984 ifstream inputStream;
985 std::string fName = (const char*) (fileName.mb_str());
987 inputStream.open(fName.c_str());
988 assert(inputStream.good()); // fails
989 _tabsMgr->addNewTab(openFileDialog->GetFilename());
990 _tabsMgr->loadDiagram(inputStream, fName);
991 _tabsMgr->saveTempActualDiagram("load diagram");
992 GetToolBar()->EnableTool(ID_UNDO, false);
993 GetToolBar()->EnableTool(ID_UNDO, false);
996 refreshGUIControls();
999 //=========================================================================
1002 void wxGUIEditorGraphicBBS::OnClickBtnBox(wxCommandEvent& event) {
1003 BlackBoxDescriptor *bbDes = _pkgBrowser->GetActualSelected();
1004 if (bbDes != NULL) {
1005 std::string typeName = bbDes->GetTypeName();
1006 std::string packageName = bbDes->GetPackage()->GetName();
1008 wxGEditorTabPanel *pnl = this->_tabsMgr->getActualTabPanel();
1012 wxVtkSceneManager *scn = pnl->getSceneManager();
1013 printf("EED wxGUIEditorGraphicBBS::OnClickBtnBox 1.\n");
1014 scn->createGBlackBox(50, 50, packageName, typeName);
1015 printf("EED wxGUIEditorGraphicBBS::OnClickBtnBox 2.\n");
1019 SaveTempActualDiagram("New Box");
1024 //=========================================================================
1026 void wxGUIEditorGraphicBBS::OnClickBtnExecutableBox(wxCommandEvent& event) {
1028 wxGEditorTabPanel *pnl = this->_tabsMgr->getActualTabPanel();
1031 wxVtkSceneManager *scn = pnl->getSceneManager();
1032 if( scn->MakeBoxExecutable() )
1033 std::cout<<"DFCH: wxGUIEditorGraphicBBS::OnClickBtnExecutableBox...successful"<<std::endl;
1035 std::cout<<"DFCH: wxGUIEditorGraphicBBS::OnClickBtnExecutableBox...Error!!"<<std::endl;
1041 //=========================================================================
1043 void wxGUIEditorGraphicBBS::OnClickBtnComplexBox(wxCommandEvent& event) {
1044 wxToolBar* toolbar = GetToolBar();
1045 bool temp = toolbar->GetToolState(ID_BTNCOMPLEXBOX);
1049 disableComplexBox();
1053 //=========================================================================
1055 void wxGUIEditorGraphicBBS::OnAddComplexBoxInput(wxCommandEvent& event) {
1056 wxTextEntryDialog *nameDialog = new wxTextEntryDialog(this,
1057 wxT("Name of input port"));
1058 if (nameDialog->ShowModal() == wxID_OK) {
1059 wxString fileName = nameDialog->GetValue();
1060 if (!fileName.IsEmpty()) {
1061 std::string portName = (const char*) (fileName.mb_str());
1062 _tabsMgr->addActualDiagramComplexInputPort(portName);
1067 //=========================================================================
1069 void wxGUIEditorGraphicBBS::OnAddComplexBoxOutput(wxCommandEvent& event) {
1070 wxTextEntryDialog *nameDialog = new wxTextEntryDialog(this,
1071 wxT("Name of output port"));
1072 if (nameDialog->ShowModal() == wxID_OK) {
1073 wxString fileName = nameDialog->GetValue();
1074 if (!fileName.IsEmpty()) {
1075 std::string portName = (const char*) (fileName.mb_str());
1076 _tabsMgr->addActualDiagramComplexOutputPort(portName);
1081 //=========================================================================
1083 void wxGUIEditorGraphicBBS::OnCopySelectedToComplexDiagram(
1084 wxCommandEvent& event) {
1085 _tabsMgr->copySelectedBBoxesToComplexDiagram();
1088 void wxGUIEditorGraphicBBS::OnHelpBBeditor(wxCommandEvent& event) {
1089 printf("wxGUIEditorGraphicBBS::OnHelpBBeditor ....not implemented..\n");
1092 //=========================================================================
1093 void wxGUIEditorGraphicBBS::OnCreatePackage(wxCommandEvent& event) {
1095 bbtkSystemTools::CreatePackage();
1098 //=========================================================================
1099 void wxGUIEditorGraphicBBS::OnCreateBlackBox(wxCommandEvent& event) {
1100 bbtkSystemTools::CreateBlackBox();
1102 //=========================================================================
1103 void wxGUIEditorGraphicBBS::OnPlugPackage(wxCommandEvent& event) {
1104 //DFGO2012 Plug Package functionnalities
1105 long style = wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST;
1108 _T("Select package directory"),
1114 userResponse = FD->ShowModal();
1115 if(userResponse==wxID_OK)
1117 std::string path = wx2std (FD->GetPath()) ;
1118 std::string fname = path + "/bbtkPackage";
1119 std::cout << "Path chosen = \"" << FD->GetPath() << "\"" << std::endl;
1120 if ( Utilities::FileExists( fname ) )
1123 f.open(fname.c_str());
1128 bbtk::ConfigurationFile::GetInstance().AddPackagePathsAndWrite( path );
1130 DoRegeneratePackageDoc(pname);
1131 DoRegenerateBoxesLists();
1133 _pkgBrowser->RebuildList();
1135 wxMessageBox(_T("Package successfully plugged. Please restart bbEditor to see the new package in the package browser."),_T("Plug package"),wxOK | wxICON_INFORMATION);
1136 userResponse = wxID_CANCEL;
1140 std::string err = "The directory \"" + path + "\" does not contain a 'bbtkPackage' file.";
1143 err += "\nNote: If you are on Linux please select the folder and click \"Open\", don't enter in it.";
1147 wxMessageBox(crea::std2wx(err), _T("Plug package"),wxOK | wxICON_ERROR);
1148 // THE FOLLOWING LINE GIVES ERRORS BECAUSE IT IS NECESSARY TO USE std2wx
1149 //wxMessageBox( _T( err) , _T("Plug package"),wxOK | wxICON_ERROR);
1152 }while(userResponse != wxID_CANCEL);
1155 //=========================================================================
1156 void wxGUIEditorGraphicBBS::OnEditConfig(wxCommandEvent& event) {
1157 std::string commandStr;
1158 std::string configFile = ConfigurationFile::GetInstance().Get_config_xml_full_path();
1160 commandStr = "notepad.exe ";
1162 commandStr = "gedit ";
1164 commandStr = commandStr + configFile;
1165 std::cout << "system: " << commandStr << std::endl;
1166 system ( commandStr.c_str() );
1168 //=========================================================================
1170 void wxGUIEditorGraphicBBS::OnShowHTMLDoc(wxCommandEvent& event) {
1172 if (_helpHtmlBrowser != NULL){
1173 _frameAUIMgr->DetachPane(_helpHtmlBrowser);
1174 _helpHtmlBrowser->Destroy();
1176 initHelpHTMLBrowser();
1177 _frameAUIMgr->AddPane(_helpHtmlBrowser, wxAuiPaneInfo().Right().MinSize(200, 200));
1178 _frameAUIMgr->Update();
1179 refreshGUIControls();
1183 //=========================================================================
1184 void wxGUIEditorGraphicBBS::OnCreateIndex(wxCommandEvent& event) {
1185 printf("EED wxGUIEditorGraphicBBS::OnCreateIndex ... not implemented ..\n");
1188 //=========================================================================
1190 void wxGUIEditorGraphicBBS::OnExit(wxCommandEvent& event) {
1194 Factory::Pointer wxGUIEditorGraphicBBS::GetBBTKFactory()
1196 if (_pkgBrowser==NULL)
1198 printf ("EED ERROR! wxGUIEditorGraphicBBS::GetBBTKFactory _pkgBrowser = NULL\n");
1200 return _pkgBrowser->GetFactory();
1203 //=========================================================================
1205 void wxGUIEditorGraphicBBS::enableComplexBox() {
1206 _tabsMgr->setActualDiagramComplexBox(true);
1207 refreshGUIControls();
1210 //=========================================================================
1212 void wxGUIEditorGraphicBBS::disableComplexBox() {
1213 _tabsMgr->setActualDiagramComplexBox(false);
1214 refreshGUIControls();
1217 //=========================================================================
1219 void wxGUIEditorGraphicBBS::setCurrentDiagramDescription(std::string description)
1221 _tabsMgr->SetDescription(description);
1224 //=========================================================================
1226 void wxGUIEditorGraphicBBS::setCurrentDiagramAuthor(std::string author)
1228 _tabsMgr->SetAuthor(author);
1231 //=========================================================================
1233 void wxGUIEditorGraphicBBS::setCurrentDiagramCategory(std::string category)
1235 _tabsMgr->SetCategory(category);
1238 //=========================================================================
1240 std::string wxGUIEditorGraphicBBS::getCurrentDiagramDescription()
1242 return _tabsMgr->GetDescription();
1245 //=========================================================================
1247 std::string wxGUIEditorGraphicBBS::getCurrentDiagramAuthor()
1249 return _tabsMgr->GetAuthor();
1252 //=========================================================================
1255 std::string wxGUIEditorGraphicBBS::getCurrentDiagramCategory()
1257 return _tabsMgr->GetCategory();
1261 //=========================================================================
1263 bool wxGUIEditorGraphicBBS::isCurrentDiagramComplexBox()
1265 return _tabsMgr->isActualDiagramComplexBox();
1269 } // EO namespace bbtk