#include <bbtkwxGUIEditorGraphicBBS.h>
Public Member Functions | |
wxGUIEditorGraphicBBS (wxFrame *parent) | |
~wxGUIEditorGraphicBBS () | |
void | initToolbar () |
void | initMenu () |
void | initTabPanelsManager () |
void | initPackageBrowser () |
void | initHelpHTMLBrowser () |
wxAuiNotebook * | getAuiNotebook () |
void | displayBlackBoxInfo (std::string packageName, std::string boxName) |
void | updateStatusBar (std::string textStatus) |
void | executeScript (std::string script) |
void | editBlackBox (GBlackBoxModel *bbmodel) |
bool | boxNameExists (std::string boxname) |
std::string | CheckExtension (std::string filename, std::string extension) |
void | RegenerateAll () |
void | DoRegeneratePackageDoc (const std::string &pack) |
void | DoRegenerateBoxesLists () |
void | refreshGUIControls () |
void | SaveActualBBS (std::string filename) |
void | AskComplexBoxConfiguration () |
void | SaveActualComplexBox (std::string filename) |
void | SaveActualDiagram (std::string filename) |
void | SaveCurrentDiagramAs () |
void | SaveTempActualDiagram (const std::string &) |
void | OnCreateNewTab (wxCommandEvent &event) |
void | OnOpenDiagram (wxCommandEvent &event) |
void | OnSaveActualDiagram (wxCommandEvent &event) |
void | OnSaveAsActualDiagram (wxCommandEvent &event) |
void | OnOpenBBS (wxCommandEvent &event) |
void | OnSaveActualBBS (wxCommandEvent &event) |
void | OnSaveActualComplexBox (wxCommandEvent &event) |
void | OnExecuteActualDiagram (wxCommandEvent &event) |
void | OnClickBtnExecutableBox (wxCommandEvent &event) |
void | OnDeleteAllBoxesActualDiagram (wxCommandEvent &event) |
void | OnCenterViewActualDiagram (wxCommandEvent &event) |
void | OnClickBtnBox (wxCommandEvent &event) |
void | OnClickBtnComplexBox (wxCommandEvent &event) |
void | OnAddComplexBoxInput (wxCommandEvent &event) |
void | OnAddComplexBoxOutput (wxCommandEvent &event) |
void | OnExit (wxCommandEvent &event) |
void | OnHelpBBeditor (wxCommandEvent &event) |
void | OnUndo (wxCommandEvent &event) |
void | OnRedo (wxCommandEvent &event) |
void | OnChangeName (wxCommandEvent &event) |
void | OnCopySelectedToComplexDiagram (wxCommandEvent &event) |
void | OnCreatePackage (wxCommandEvent &event) |
void | OnCreateBlackBox (wxCommandEvent &event) |
void | OnPlugPackage (wxCommandEvent &event) |
void | OnEditConfig (wxCommandEvent &event) |
void | OnShowHTMLDoc (wxCommandEvent &event) |
void | OnCreateIndex (wxCommandEvent &event) |
Private Attributes | |
wxAuiManager * | _frameAUIMgr |
wxTabPanelsManager * | _tabsMgr |
wxAuiNotebook * | _notebook |
WxGUIPackageBrowser2 * | _pkgBrowser |
WxGUIHtmlBrowser * | _helpHtmlBrowser |
std::string | _actualPkgBrowserBoxName |
std::string | _actualPkgBrowserPkgName |
Definition at line 101 of file bbtkwxGUIEditorGraphicBBS.h.
bbtk::wxGUIEditorGraphicBBS::wxGUIEditorGraphicBBS | ( | wxFrame * | parent | ) |
Definition at line 46 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _actualPkgBrowserBoxName, _actualPkgBrowserPkgName, _frameAUIMgr, _helpHtmlBrowser, initMenu(), initPackageBrowser(), initTabPanelsManager(), initToolbar(), and refreshGUIControls().
00046 : 00047 wxFrame(parent, -1, _T("bbtkGEditor"), wxDefaultPosition, wxSize( 00048 1200, 800)) { 00049 00050 _frameAUIMgr = new wxAuiManager(this); 00051 00052 /*std::string datadir( crea::System::GetExecutablePath() ); 00053 std::string datadir ("."); 00054 cout<<"RaC //------------------"<<endl; 00055 cout<<"RaC //TODO wxGUIEditorGraphicBBS constructor.Initialize datadir with crea::System::GetExecutablePath() ."<<endl; 00056 cout<<"RaC //------------------"<<endl; 00057 00058 #ifdef LINUX // assume this is OSX 00059 datadir=datadir+"/../share/creaContours"; 00060 #endif // MACOSX 00061 00062 #ifdef MACOSX // assume this is OSX 00063 datadir=datadir+"/../../../../share/creaContours"; 00064 #endif // MACOSX 00065 00066 _dataDir = datadir;*/ 00067 00068 initMenu(); 00069 initToolbar(); 00070 initTabPanelsManager(); 00071 initPackageBrowser(); 00072 // JGGR & CM initHelpHTMLBrowser(); 00073 _helpHtmlBrowser = NULL; 00074 CreateStatusBar(); 00075 _frameAUIMgr->Update(); 00076 _actualPkgBrowserBoxName = ""; 00077 _actualPkgBrowserPkgName = ""; 00078 refreshGUIControls(); 00079 }
bbtk::wxGUIEditorGraphicBBS::~wxGUIEditorGraphicBBS | ( | ) |
Definition at line 82 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _frameAUIMgr, _notebook, and _tabsMgr.
00082 { 00083 00084 printf("EED %p ~wxGUIEditorGraphicBBS()\n", this); 00085 00086 //EED02JUIN2010 delete _tabsMgr; 00087 00088 _frameAUIMgr->UnInit(); 00089 // FCY memory leaks 00090 delete _frameAUIMgr; 00091 delete _notebook; 00092 delete _tabsMgr; 00093 00094 }
void bbtk::wxGUIEditorGraphicBBS::AskComplexBoxConfiguration | ( | ) |
Definition at line 604 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _tabsMgr, bbtk::wxTabPanelsManager::GetCbName(), bbtk::wxTabPanelsManager::GetCbPackageName(), bbtk::wxTabPanelsManager::SetCbName(), and bbtk::wxTabPanelsManager::SetCbPackageName().
Referenced by OnSaveActualDiagram(), and SaveCurrentDiagramAs().
00604 { 00605 std::string cbName = _tabsMgr->GetCbName(); 00606 std::string paName = _tabsMgr->GetCbPackageName(); 00607 00608 wxTextEntryDialog *cbNameDialog = new wxTextEntryDialog(this, 00609 wxT("Complex Box name")); 00610 wxTextEntryDialog *paNameDialog = new wxTextEntryDialog(this, 00611 wxT("Package name")); 00612 00613 cbNameDialog->SetValue(wxString(cbName.c_str(), wxConvUTF8)); 00614 paNameDialog->SetValue(wxString(paName.c_str(), wxConvUTF8)); 00615 00616 if (cbNameDialog->ShowModal() == wxID_OK) { 00617 wxString complexboxname = cbNameDialog->GetValue(); 00618 cbName = (const char*) (complexboxname.mb_str()); 00619 } 00620 00621 if (paNameDialog->ShowModal() == wxID_OK) { 00622 wxString packagename = paNameDialog->GetValue(); 00623 paName = (const char*) (packagename.mb_str()); 00624 } 00625 00626 _tabsMgr->SetCbName(cbName); 00627 _tabsMgr->SetCbPackageName(paName); 00628 }
bool bbtk::wxGUIEditorGraphicBBS::boxNameExists | ( | std::string | boxname | ) |
Definition at line 428 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _tabsMgr, bbtk::wxVtkSceneManager::boxExist(), bbtk::wxTabPanelsManager::getActualTabPanel(), and bbtk::wxGEditorTabPanel::getSceneManager().
Referenced by bbtk::wxBlackBoxEditionDialog::onClickOk().
00428 { 00429 00430 return this->_tabsMgr->getActualTabPanel()->getSceneManager()->boxExist(boxname); 00431 }
std::string bbtk::wxGUIEditorGraphicBBS::CheckExtension | ( | std::string | filename, | |
std::string | extension | |||
) |
Definition at line 475 of file bbtkwxGUIEditorGraphicBBS.cxx.
Referenced by OnSaveActualBBS(), OnSaveActualComplexBox(), and SaveCurrentDiagramAs().
00475 { 00476 if(filename.size() > extension.size() ){ 00477 if( (filename.compare(filename.size()-extension.size(), extension.size(),extension)) !=0 ){ 00478 filename.append(extension); 00479 } 00480 }else{ 00481 filename.append(extension); 00482 } 00483 return filename; 00484 }
void bbtk::wxGUIEditorGraphicBBS::displayBlackBoxInfo | ( | std::string | packageName, | |
std::string | boxName | |||
) |
Definition at line 404 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _actualPkgBrowserBoxName, _actualPkgBrowserPkgName, _pkgBrowser, bbtk::GObjectsMVCFactory::getBlackBoxDescriptor(), and bbtk::GObjectsMVCFactory::getInstance().
Referenced by bbtk::wxTabPanelsManager::displayBlackBoxInfo().
00405 { 00406 if (_actualPkgBrowserPkgName != packageName || _actualPkgBrowserBoxName 00407 != boxName) { 00408 _actualPkgBrowserPkgName = packageName; 00409 _actualPkgBrowserBoxName = boxName; 00410 00411 BlackBoxDescriptor::Pointer descriptor = 00412 GObjectsMVCFactory::getInstance()->getBlackBoxDescriptor( 00413 packageName, boxName); 00414 _pkgBrowser->WxGUIBlackBoxListUserOnSelected(descriptor.get()); 00415 } 00416 }
void bbtk::wxGUIEditorGraphicBBS::DoRegenerateBoxesLists | ( | ) |
Definition at line 357 of file bbtkwxGUIEditorGraphicBBS.cxx.
Referenced by RegenerateAll().
00357 { 00358 SetStatusText(_T("Regenerating boxes lists ... please wait")); 00359 //BBTK_BUSY_CURSOR ; 00360 00361 std::string command; 00362 #if defined(WIN32) 00363 command = "\""; 00364 #endif 00365 command += ConfigurationFile::GetInstance().Get_bin_path(); 00366 command += ConfigurationFile::GetInstance().Get_file_separator(); 00367 command += "bbRegenerateBoxesLists"; 00368 00369 #if defined(WIN32) 00370 command += "\""; 00371 #endif 00372 command += " -q"; 00373 00374 bbtkMessage("debug",1,"Executing system command '"<<command<<"'"<<std::endl); 00375 00376 if (!system(command.c_str())) { 00377 SetStatusText(_T("Done !")); 00378 /* 00379 wxMessageBox(_T("Done !"),_T("Regenerate boxes lists"), 00380 wxOK | wxICON_INFORMATION); 00381 */ 00382 } else { 00383 SetStatusText(_T("Done !")); 00384 wxString err(_T("An error occured while running '")); 00385 err += bbtk::std2wx(command) + _T("'"); 00386 wxMessageBox(err, _T("Regenerate boxes lists"), wxOK | wxICON_ERROR); 00387 } 00388 }
void bbtk::wxGUIEditorGraphicBBS::DoRegeneratePackageDoc | ( | const std::string & | pack | ) |
Definition at line 313 of file bbtkwxGUIEditorGraphicBBS.cxx.
Referenced by RegenerateAll().
00313 { 00314 std::string mess("Regenerating doc for package '"); 00315 if (pack != "-a") { 00316 mess += pack + "'"; 00317 } else { 00318 mess = "Regenerating doc for all packages"; 00319 } 00320 00321 mess += " ... please wait"; 00322 00323 SetStatusText(std2wx(mess)); 00324 00325 //BBTK_BUSY_CURSOR; 00326 00327 std::string command; 00328 #if defined(WIN32) 00329 command = "\""; 00330 #endif 00331 command += ConfigurationFile::GetInstance().Get_bin_path(); 00332 command += ConfigurationFile::GetInstance().Get_file_separator(); 00333 command += "bbRegeneratePackageDoc"; 00334 #if defined(WIN32) 00335 command += "\""; 00336 #endif 00337 00338 command += " " + pack + " -q"; 00339 bbtkMessage("debug",1,"Executing system command '"<<command<<"'"<<std::endl); 00340 00341 if (!system(command.c_str())) { 00342 SetStatusText(_T("Done !")); 00343 /* 00344 wxMessageBox(_T("Done !"),_T("Regenerate package '") 00345 +std2wx(pack)+_T("' doc"), 00346 wxOK | wxICON_INFORMATION); 00347 */ 00348 } else { 00349 SetStatusText(_T("Done !")); 00350 wxString err(_T("An error occured while running '")); 00351 err += bbtk::std2wx(command) + _T("'"); 00352 wxMessageBox(err, _T("Regenerate package doc"), wxOK | wxICON_ERROR); 00353 } 00354 }
void bbtk::wxGUIEditorGraphicBBS::editBlackBox | ( | GBlackBoxModel * | bbmodel | ) |
Definition at line 420 of file bbtkwxGUIEditorGraphicBBS.cxx.
Referenced by bbtk::wxTabPanelsManager::editBlackBox().
00420 { 00421 wxBlackBoxEditionDialog* dialog = 00422 new wxBlackBoxEditionDialog(this, bbmodel); 00423 dialog->Show(); 00424 }
void bbtk::wxGUIEditorGraphicBBS::executeScript | ( | std::string | script | ) |
Definition at line 441 of file bbtkwxGUIEditorGraphicBBS.cxx.
Referenced by OnExecuteActualDiagram().
00441 { 00442 std::string separator = 00443 ConfigurationFile::GetInstance().Get_file_separator(); 00444 std::string dir = ConfigurationFile::GetInstance().Get_default_temp_dir(); 00445 std::string filename = dir + separator + "tmp_bbtk.bbs"; 00446 00447 ofstream tempFile; 00448 tempFile.open(filename.c_str()); 00449 tempFile << script; 00450 tempFile.close(); 00451 00452 std::string command = ""; 00453 00454 #ifdef WIN32 00455 command += "start /b "; 00456 #endif 00457 00458 // command += "\""+ crea::System::GetExecutablePath(); 00459 //#ifdef MACOSX 00460 // command += separator + "../../../bbi.app/Contents/MacOS"; 00461 //#endif 00462 00463 command += "bbi "; 00464 command += "\"" + filename + "\""; 00465 00466 #ifndef WIN32 00467 command += " & "; 00468 #endif 00469 00470 printf("RaC wxGUIEditorGraphicBBS::executeScript %s \n", command.c_str()); 00471 system(command.c_str()); 00472 }
wxAuiNotebook * bbtk::wxGUIEditorGraphicBBS::getAuiNotebook | ( | ) |
Definition at line 398 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _notebook.
Referenced by bbtk::wxTabPanelsManager::wxTabPanelsManager().
00398 { 00399 return _notebook; 00400 }
void bbtk::wxGUIEditorGraphicBBS::initHelpHTMLBrowser | ( | ) |
Definition at line 197 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _helpHtmlBrowser.
Referenced by OnShowHTMLDoc().
00197 { 00198 // JGRR & CM 00199 _helpHtmlBrowser = new WxGUIHtmlBrowser(this, wxSize(200, 0)); 00200 00201 // EO JGRR & CM 00202 00203 }
void bbtk::wxGUIEditorGraphicBBS::initMenu | ( | ) |
Definition at line 206 of file bbtkwxGUIEditorGraphicBBS.cxx.
References bbtk::ID_bbEditor_Tool_Menu_CreateBlackBox, bbtk::ID_bbEditor_Tool_Menu_CreateIndex, bbtk::ID_bbEditor_Tool_Menu_CreatePackage, bbtk::ID_bbEditor_Tool_Menu_EditConfig, bbtk::ID_bbEditor_Tool_Menu_PlugPackage, bbtk::ID_bbEditor_Tool_Menu_ShowHTMLDoc, bbtk::ID_COPY_TO_COMPLEXDIAGRAM, bbtk::ID_HELP_BBEDITOR, bbtk::ID_NEW, bbtk::ID_OPEN, bbtk::ID_OPEN_BBS, bbtk::ID_SAVE_AS_BBS, bbtk::ID_SAVE_AS_COMPLEXBOX, bbtk::ID_SAVE_AS_DIAGRAM, bbtk::ID_SAVE_DIAGRAM, OnCopySelectedToComplexDiagram(), OnCreateBlackBox(), OnCreateIndex(), OnCreateNewTab(), OnCreatePackage(), OnEditConfig(), OnExit(), OnHelpBBeditor(), OnOpenBBS(), OnPlugPackage(), OnSaveActualBBS(), OnSaveActualComplexBox(), OnSaveActualDiagram(), OnSaveAsActualDiagram(), and OnShowHTMLDoc().
Referenced by wxGUIEditorGraphicBBS().
00206 { 00207 // Create File menu and its items 00208 wxMenu *fileMenu = new wxMenu(); 00209 fileMenu->Append(ID_NEW, _T("New diagram"), _T("New")); 00210 fileMenu->Append(ID_SAVE_DIAGRAM, _T("Save Diagram"), _T("Save Diagram")); //DFCH 00211 fileMenu->Append(ID_SAVE_AS_DIAGRAM, _T("Save Diagram As"), 00212 _T("Save Diagram As")); //DFCH 00213 fileMenu->Append(ID_OPEN_BBS, _T("Open BBS"), _T("Open BBS")); 00214 // CM 00215 fileMenu->Append(ID_OPEN, _T("Open a diagram"), _T("Open a diagram")); 00216 fileMenu->Append(ID_SAVE_AS_BBS, _T("Save BBS"), _T("Save BBS")); 00217 fileMenu->Append(ID_SAVE_AS_COMPLEXBOX, _T("Save complex box"), 00218 _T("Save complex box")); 00219 fileMenu->Append(wxID_EXIT, _T("E&xit"), _T("Exit")); 00220 00221 Connect(ID_NEW, wxEVT_COMMAND_MENU_SELECTED, 00222 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCreateNewTab)); 00223 Connect(ID_SAVE_DIAGRAM, wxEVT_COMMAND_MENU_SELECTED, 00224 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveActualDiagram)); //DFCH 00225 Connect(ID_SAVE_AS_DIAGRAM, wxEVT_COMMAND_MENU_SELECTED, 00226 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveAsActualDiagram)); 00227 Connect(ID_OPEN_BBS, wxEVT_COMMAND_MENU_SELECTED, 00228 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnOpenBBS)); 00229 Connect(ID_SAVE_AS_BBS, wxEVT_COMMAND_MENU_SELECTED, 00230 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveActualBBS)); 00231 Connect( 00232 ID_SAVE_AS_COMPLEXBOX, 00233 wxEVT_COMMAND_MENU_SELECTED, 00234 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveActualComplexBox)); 00235 Connect(wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED, 00236 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnExit)); 00237 00238 // Create Help menu and its items 00239 wxMenu *editMenu = new wxMenu; 00240 editMenu->Append(ID_COPY_TO_COMPLEXDIAGRAM, 00241 _T("Copy selected to complex box"), 00242 _T("Creates a new complex box diagram with selected boxes")); 00243 00244 Connect( 00245 ID_COPY_TO_COMPLEXDIAGRAM, 00246 wxEVT_COMMAND_MENU_SELECTED, 00247 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCopySelectedToComplexDiagram)); 00248 00249 // Create Help menu and its items 00250 wxMenu *helpMenu = new wxMenu; 00251 helpMenu->Append(wxID_ABOUT, _T("&About..."), _T("About")); 00252 helpMenu->Append(ID_HELP_BBEDITOR, _T("&Help..."), _T("Help")); 00253 Connect(ID_HELP_BBEDITOR, wxEVT_COMMAND_MENU_SELECTED, 00254 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnHelpBBeditor)); 00255 00256 // Create Tool menu 00257 wxMenu *menuTools = new wxMenu; 00258 menuTools->Append(ID_bbEditor_Tool_Menu_CreatePackage, 00259 _T("Create &package") ); 00260 menuTools->Append(ID_bbEditor_Tool_Menu_CreateBlackBox, 00261 _T("Create &blackbox") ); 00262 menuTools->Append(ID_bbEditor_Tool_Menu_PlugPackage, _T("Plug package") ); 00263 menuTools->Append(ID_bbEditor_Tool_Menu_EditConfig, _T("&Edit bbtk config") ); 00264 menuTools->Append(ID_bbEditor_Tool_Menu_ShowHTMLDoc, 00265 _T("Show &HTML documentation") ); 00266 menuTools->Append(ID_bbEditor_Tool_Menu_CreateIndex, _T("&Generate index") ); 00267 00268 Connect(ID_bbEditor_Tool_Menu_CreatePackage, wxEVT_COMMAND_MENU_SELECTED, 00269 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCreatePackage)); 00270 Connect(ID_bbEditor_Tool_Menu_CreateBlackBox, wxEVT_COMMAND_MENU_SELECTED, 00271 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCreateBlackBox)); 00272 Connect(ID_bbEditor_Tool_Menu_PlugPackage, wxEVT_COMMAND_MENU_SELECTED, 00273 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnPlugPackage)); 00274 Connect(ID_bbEditor_Tool_Menu_EditConfig, wxEVT_COMMAND_MENU_SELECTED, 00275 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnEditConfig)); 00276 Connect(ID_bbEditor_Tool_Menu_ShowHTMLDoc, wxEVT_COMMAND_MENU_SELECTED, 00277 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnShowHTMLDoc)); 00278 Connect(ID_bbEditor_Tool_Menu_CreateIndex, wxEVT_COMMAND_MENU_SELECTED, 00279 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCreateIndex)); 00280 00281 // Append the created menu to the menu bar 00282 wxMenuBar *menuBar = new wxMenuBar(); 00283 menuBar->Append(fileMenu, _T("&File") ); 00284 menuBar->Append(editMenu, _T("&Edit") ); 00285 menuBar->Append(menuTools, _T("&Tool") ); 00286 menuBar->Append(helpMenu, _T("&Help") ); 00287 00288 // Attach this menu bar to the frame 00289 SetMenuBar(menuBar); 00290 }
void bbtk::wxGUIEditorGraphicBBS::initPackageBrowser | ( | ) |
Definition at line 304 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _frameAUIMgr, and _pkgBrowser.
Referenced by wxGUIEditorGraphicBBS().
00304 { 00305 _pkgBrowser = new WxGUIPackageBrowser2(this); 00306 _pkgBrowser->IncludeAll(); 00307 _frameAUIMgr->AddPane(_pkgBrowser, 00308 wxAuiPaneInfo().Left().MinSize(480, 400).CloseButton(false)); 00309 }
void bbtk::wxGUIEditorGraphicBBS::initTabPanelsManager | ( | ) |
Definition at line 293 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _frameAUIMgr, _notebook, _tabsMgr, and bbtk::wxID_NOTEBOOK.
Referenced by wxGUIEditorGraphicBBS().
00293 { 00294 _notebook = new wxAuiNotebook(this, wxID_NOTEBOOK, wxDefaultPosition, 00295 wxDefaultSize, wxAUI_NB_TOP | wxAUI_NB_TAB_MOVE 00296 | wxAUI_NB_CLOSE_ON_ACTIVE_TAB | wxAUI_NB_TAB_FIXED_WIDTH 00297 | wxAUI_NB_WINDOWLIST_BUTTON); 00298 _tabsMgr = new wxTabPanelsManager(this); 00299 _frameAUIMgr->AddPane(_notebook, wxAuiPaneInfo().CenterPane()); 00300 00301 }
void bbtk::wxGUIEditorGraphicBBS::initToolbar | ( | ) |
Definition at line 97 of file bbtkwxGUIEditorGraphicBBS.cxx.
References bbtk::ID_ADDCOMPLEXBOXINPUT, bbtk::ID_ADDCOMPLEXBOXOUTPUT, bbtk::ID_BTEXECUTABLEBOX, bbtk::ID_BTNBOX, bbtk::ID_BTNCOMPLEXBOX, bbtk::ID_CENTERVIEW, bbtk::ID_CHANGENAME, bbtk::ID_DELETEALL, bbtk::ID_NEW, bbtk::ID_OPEN, bbtk::ID_REDO, bbtk::ID_RUN, bbtk::ID_SAVE_AS_DIAGRAM, bbtk::ID_SAVE_DIAGRAM, bbtk::ID_UNDO, OnAddComplexBoxInput(), OnAddComplexBoxOutput(), OnCenterViewActualDiagram(), OnChangeName(), OnClickBtnBox(), OnClickBtnComplexBox(), OnClickBtnExecutableBox(), OnCreateNewTab(), OnDeleteAllBoxesActualDiagram(), OnExecuteActualDiagram(), OnOpenDiagram(), OnRedo(), OnSaveActualDiagram(), OnSaveAsActualDiagram(), and OnUndo().
Referenced by wxGUIEditorGraphicBBS().
00097 { 00098 wxBitmap bmp_new(new_xpm); 00099 wxBitmap bmp_open(open_xpm); 00100 wxBitmap bmp_save(save_xpm); 00101 wxBitmap bmp_run(run_xpm); 00102 wxBitmap bmp_delete(delete_xpm); 00103 wxBitmap bmp_centerview(centerview_xpm); 00104 wxBitmap bmp_box(box_xpm); 00105 wxBitmap bmp_executablebox(executablebox_xpm); 00106 wxBitmap bmp_complexbox(complexbox_xpm); 00107 wxBitmap bmp_complexinputport(complexinputport_xpm); 00108 wxBitmap bmp_complexoutputport(complexoutputport_xpm); 00109 wxBitmap bmp_undo(undo_xpm); 00110 wxBitmap bmp_redo(redo_xpm); 00111 wxToolBar *toolbar = new wxToolBar(this, wxID_ANY); 00112 00113 //Adds a tool btn to the toolbar 00114 toolbar->AddTool(ID_NEW, _T("New"), bmp_new, wxNullBitmap, wxITEM_NORMAL, 00115 _T("New tab"), _T("Create a new panel tab")); 00116 toolbar->AddTool(ID_OPEN, _T("Open diagram"), bmp_open, wxNullBitmap, 00117 wxITEM_NORMAL, _T("Open a diagram"), _T("Open a diagram")); 00118 toolbar->AddTool(ID_SAVE_DIAGRAM, _T("Save Diagram"), bmp_save, 00119 wxNullBitmap, wxITEM_NORMAL, _T("Saves the current diagram"), 00120 _T("Saves the current diagram")); //DFCH 00121 //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 00122 toolbar->AddTool(ID_RUN, _T("Run"), bmp_run, wxNullBitmap, wxITEM_NORMAL, 00123 _T("Execute actual diagram"), _T("Execute actual diagram")); 00124 toolbar->AddTool(ID_DELETEALL, _T("Delete all"), bmp_delete, wxNullBitmap, 00125 wxITEM_NORMAL, _T("Delete all boxes"), _T("Delete all boxes")); 00126 toolbar->AddTool(ID_CENTERVIEW, _T("Center view"), bmp_centerview, 00127 wxNullBitmap, wxITEM_NORMAL, _T("Center view"), _T("Center view")); 00128 toolbar->AddSeparator(); 00129 toolbar->AddTool(ID_BTNBOX, _T("New Box"), bmp_box, wxNullBitmap, 00130 wxITEM_NORMAL, _T("New Box"), _T("Nex Box")); 00131 toolbar->AddSeparator(); 00132 toolbar->AddTool(ID_BTEXECUTABLEBOX, _T("Select as executable Box"), 00133 bmp_executablebox, wxNullBitmap, wxITEM_NORMAL, 00134 _T("Select as executable Box"), _T("Select as executable Box")); 00135 toolbar->AddSeparator(); 00136 toolbar->AddTool(ID_BTNCOMPLEXBOX, _T("Complex box"), complexbox_xpm, 00137 wxNullBitmap, wxITEM_NORMAL, _T("Complex box"), _T("Complex box")); 00138 toolbar->SetToggle(ID_BTNCOMPLEXBOX, true); 00139 toolbar->AddTool(ID_ADDCOMPLEXBOXINPUT, _T("Add input to Complex box"), 00140 bmp_complexinputport, wxNullBitmap, wxITEM_NORMAL, 00141 _T("Add input to Complex box"), _T("Add input to Complex box")); 00142 toolbar->AddTool(ID_ADDCOMPLEXBOXOUTPUT, _T("Add output to Complex box"), 00143 bmp_complexoutputport, wxNullBitmap, wxITEM_NORMAL, 00144 _T("Add output Complex box"), _T("Add output Complex box")); 00145 toolbar->EnableTool(ID_ADDCOMPLEXBOXINPUT, false); 00146 toolbar->EnableTool(ID_ADDCOMPLEXBOXOUTPUT, false); 00147 toolbar->AddSeparator(); 00148 toolbar->AddTool(ID_UNDO, _T("Undo"),bmp_undo, wxNullBitmap, wxITEM_NORMAL, _T("Undo"), _T("Undo")); 00149 toolbar->AddTool(ID_REDO, _T("Redo"),bmp_redo, wxNullBitmap, wxITEM_NORMAL, _T("Redo"), _T("Redo")); 00150 00151 toolbar->EnableTool(ID_UNDO, false); 00152 toolbar->EnableTool(ID_REDO, false); 00153 toolbar->SetMargins(2, 2); 00154 toolbar->Realize(); 00155 SetToolBar(toolbar); 00156 00157 00158 // connect command event handlers 00159 00160 Connect(ID_NEW, wxEVT_COMMAND_TOOL_CLICKED, 00161 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCreateNewTab)); 00162 Connect(ID_OPEN, wxEVT_COMMAND_TOOL_CLICKED, 00163 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnOpenDiagram)); 00164 Connect(ID_SAVE_DIAGRAM, wxEVT_COMMAND_TOOL_CLICKED, 00165 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveActualDiagram)); //DFCH 00166 Connect(ID_SAVE_AS_DIAGRAM, wxEVT_COMMAND_TOOL_CLICKED, 00167 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveAsActualDiagram)); //DFCH 00168 Connect( 00169 ID_RUN, 00170 wxEVT_COMMAND_TOOL_CLICKED, 00171 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnExecuteActualDiagram)); 00172 Connect( 00173 ID_DELETEALL, 00174 wxEVT_COMMAND_TOOL_CLICKED, 00175 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnDeleteAllBoxesActualDiagram)); 00176 Connect( 00177 ID_CENTERVIEW, 00178 wxEVT_COMMAND_TOOL_CLICKED, 00179 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCenterViewActualDiagram)); 00180 Connect(ID_BTNBOX, wxEVT_COMMAND_TOOL_CLICKED, 00181 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnClickBtnBox)); 00182 Connect( 00183 ID_BTEXECUTABLEBOX, 00184 wxEVT_COMMAND_TOOL_CLICKED, 00185 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnClickBtnExecutableBox)); 00186 Connect(ID_BTNCOMPLEXBOX, wxEVT_COMMAND_TOOL_CLICKED, 00187 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnClickBtnComplexBox)); 00188 Connect(ID_ADDCOMPLEXBOXINPUT, wxEVT_COMMAND_TOOL_CLICKED, 00189 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnAddComplexBoxInput)); 00190 Connect(ID_ADDCOMPLEXBOXOUTPUT, wxEVT_COMMAND_TOOL_CLICKED, 00191 wxCommandEventHandler(wxGUIEditorGraphicBBS::OnAddComplexBoxOutput)); 00192 Connect(ID_UNDO,wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnUndo)); 00193 Connect(ID_REDO,wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnRedo)); 00194 Connect(ID_CHANGENAME, wxEVT_COMMAND_RIGHT_CLICK, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnChangeName)); 00195 }
void bbtk::wxGUIEditorGraphicBBS::OnAddComplexBoxInput | ( | wxCommandEvent & | event | ) |
Definition at line 901 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _tabsMgr, and bbtk::wxTabPanelsManager::addActualDiagramComplexInputPort().
Referenced by initToolbar().
00901 { 00902 wxTextEntryDialog *nameDialog = new wxTextEntryDialog(this, 00903 wxT("Name of input port")); 00904 if (nameDialog->ShowModal() == wxID_OK) { 00905 wxString fileName = nameDialog->GetValue(); 00906 if (!fileName.IsEmpty()) { 00907 std::string portName = (const char*) (fileName.mb_str()); 00908 _tabsMgr->addActualDiagramComplexInputPort(portName); 00909 } 00910 } 00911 }
void bbtk::wxGUIEditorGraphicBBS::OnAddComplexBoxOutput | ( | wxCommandEvent & | event | ) |
Definition at line 915 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _tabsMgr, and bbtk::wxTabPanelsManager::addActualDiagramComplexOutputPort().
Referenced by initToolbar().
00915 { 00916 wxTextEntryDialog *nameDialog = new wxTextEntryDialog(this, 00917 wxT("Name of output port")); 00918 if (nameDialog->ShowModal() == wxID_OK) { 00919 wxString fileName = nameDialog->GetValue(); 00920 if (!fileName.IsEmpty()) { 00921 std::string portName = (const char*) (fileName.mb_str()); 00922 _tabsMgr->addActualDiagramComplexOutputPort(portName); 00923 } 00924 } 00925 }
void bbtk::wxGUIEditorGraphicBBS::OnCenterViewActualDiagram | ( | wxCommandEvent & | event | ) |
Definition at line 819 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _tabsMgr, and bbtk::wxTabPanelsManager::centerViewActualDiagram().
Referenced by initToolbar().
00819 { 00820 _tabsMgr->centerViewActualDiagram(); 00821 }
void bbtk::wxGUIEditorGraphicBBS::OnChangeName | ( | wxCommandEvent & | event | ) |
Definition at line 535 of file bbtkwxGUIEditorGraphicBBS.cxx.
Referenced by initToolbar().
void bbtk::wxGUIEditorGraphicBBS::OnClickBtnBox | ( | wxCommandEvent & | event | ) |
Definition at line 849 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _pkgBrowser, _tabsMgr, bbtk::wxVtkSceneManager::createGBlackBox(), bbtk::wxTabPanelsManager::getActualTabPanel(), bbtk::wxGEditorTabPanel::getSceneManager(), bbtk::wxVtkSceneManager::refresh(), and SaveTempActualDiagram().
Referenced by initToolbar().
00849 { 00850 BlackBoxDescriptor *bbDes = _pkgBrowser->GetActualSelected(); 00851 if (bbDes != NULL) { 00852 std::string typeName = bbDes->GetTypeName(); 00853 std::string packageName = bbDes->GetPackage()->GetName(); 00854 00855 wxGEditorTabPanel *pnl = this->_tabsMgr->getActualTabPanel(); 00856 00857 00858 if (pnl != NULL) { 00859 wxVtkSceneManager *scn = pnl->getSceneManager(); 00860 scn->createGBlackBox(50, 50, packageName, typeName); 00861 scn->refresh(); 00862 } 00863 00864 SaveTempActualDiagram("New Box"); 00865 // if pnl 00866 }// if bbDes 00867 }
void bbtk::wxGUIEditorGraphicBBS::OnClickBtnComplexBox | ( | wxCommandEvent & | event | ) |
Definition at line 888 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _tabsMgr, bbtk::ID_BTNCOMPLEXBOX, refreshGUIControls(), and bbtk::wxTabPanelsManager::setActualDiagramComplexBox().
Referenced by initToolbar().
00888 { 00889 wxToolBar* toolbar = GetToolBar(); 00890 bool temp = toolbar->GetToolState(ID_BTNCOMPLEXBOX); 00891 if (temp) { 00892 _tabsMgr->setActualDiagramComplexBox(true); 00893 } else { 00894 _tabsMgr->setActualDiagramComplexBox(false); 00895 } 00896 refreshGUIControls(); 00897 }
void bbtk::wxGUIEditorGraphicBBS::OnClickBtnExecutableBox | ( | wxCommandEvent & | event | ) |
Definition at line 871 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _tabsMgr, bbtk::wxTabPanelsManager::getActualTabPanel(), bbtk::wxGEditorTabPanel::getSceneManager(), and bbtk::wxVtkSceneManager::MakeBoxExecutable().
Referenced by initToolbar().
00871 { 00872 //DFCH 00873 wxGEditorTabPanel *pnl = this->_tabsMgr->getActualTabPanel(); 00874 00875 if (pnl != NULL) { 00876 wxVtkSceneManager *scn = pnl->getSceneManager(); 00877 if( scn->MakeBoxExecutable() ) 00878 std::cout<<"DFCH: wxGUIEditorGraphicBBS::OnClickBtnExecutableBox...successful"<<std::endl; 00879 else 00880 std::cout<<"DFCH: wxGUIEditorGraphicBBS::OnClickBtnExecutableBox...Error!!"<<std::endl; 00881 } 00882 //DFCH 00883 00884 }
void bbtk::wxGUIEditorGraphicBBS::OnCopySelectedToComplexDiagram | ( | wxCommandEvent & | event | ) |
Definition at line 929 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _tabsMgr, and bbtk::wxTabPanelsManager::copySelectedBBoxesToComplexDiagram().
Referenced by initMenu().
00930 { 00931 _tabsMgr->copySelectedBBoxesToComplexDiagram(); 00932 }
void bbtk::wxGUIEditorGraphicBBS::OnCreateBlackBox | ( | wxCommandEvent & | event | ) |
Definition at line 945 of file bbtkwxGUIEditorGraphicBBS.cxx.
Referenced by initMenu().
void bbtk::wxGUIEditorGraphicBBS::OnCreateIndex | ( | wxCommandEvent & | event | ) |
Definition at line 972 of file bbtkwxGUIEditorGraphicBBS.cxx.
Referenced by initMenu().
void bbtk::wxGUIEditorGraphicBBS::OnCreateNewTab | ( | wxCommandEvent & | event | ) |
Definition at line 489 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _tabsMgr, bbtk::wxTabPanelsManager::addNewTab(), and refreshGUIControls().
Referenced by initMenu(), and initToolbar().
00489 { 00490 _tabsMgr->addNewTab(); 00491 refreshGUIControls(); 00492 }
void bbtk::wxGUIEditorGraphicBBS::OnCreatePackage | ( | wxCommandEvent & | event | ) |
Definition at line 939 of file bbtkwxGUIEditorGraphicBBS.cxx.
Referenced by initMenu().
void bbtk::wxGUIEditorGraphicBBS::OnDeleteAllBoxesActualDiagram | ( | wxCommandEvent & | event | ) |
Definition at line 807 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _tabsMgr, and bbtk::wxTabPanelsManager::deleteAllBoxesActualDiagram().
Referenced by initToolbar().
00807 { 00808 wxMessageDialog *dial = new wxMessageDialog(NULL, 00809 wxT("Are you sure to delete all boxes of the diagram?"), 00810 wxT("Delete all boxes"), wxYES_NO | wxNO_DEFAULT 00811 | wxICON_QUESTION); 00812 if (dial->ShowModal() == wxID_YES) { 00813 _tabsMgr->deleteAllBoxesActualDiagram(); 00814 } 00815 }
void bbtk::wxGUIEditorGraphicBBS::OnEditConfig | ( | wxCommandEvent & | event | ) |
Definition at line 953 of file bbtkwxGUIEditorGraphicBBS.cxx.
Referenced by initMenu().
void bbtk::wxGUIEditorGraphicBBS::OnExecuteActualDiagram | ( | wxCommandEvent & | event | ) |
Definition at line 539 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _tabsMgr, executeScript(), and bbtk::wxTabPanelsManager::getActualDiagramBBS().
Referenced by initToolbar().
00539 { 00540 std::string script1 = _tabsMgr->getActualDiagramBBS(true); 00541 cout << endl << "RaC wxGUIEditorGraphicBBS::executeActualDiagram SCRIPT" 00542 << endl << endl; 00543 cout << script1 << endl; 00544 00545 std::string script2 = _tabsMgr->getActualDiagramBBS(false); 00546 executeScript(script2); 00547 }
void bbtk::wxGUIEditorGraphicBBS::OnExit | ( | wxCommandEvent & | event | ) |
Definition at line 978 of file bbtkwxGUIEditorGraphicBBS.cxx.
Referenced by initMenu().
void bbtk::wxGUIEditorGraphicBBS::OnHelpBBeditor | ( | wxCommandEvent & | event | ) |
Definition at line 934 of file bbtkwxGUIEditorGraphicBBS.cxx.
Referenced by initMenu().
void bbtk::wxGUIEditorGraphicBBS::OnOpenBBS | ( | wxCommandEvent & | event | ) |
Definition at line 552 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _pkgBrowser, _tabsMgr, bbtk::wxTabPanelsManager::addNewTab(), bbtk::wxTabPanelsManager::getActualTabPanel(), bbtk::wxGEditorTabPanel::getSceneManager(), bbtk::InterpreterBBS::New(), and refreshGUIControls().
Referenced by initMenu().
00552 { 00553 wxFileDialog * openFileDialog = new wxFileDialog(this, wxT("Open BBS"), 00554 wxEmptyString, wxT("NewBBS"), wxT("*.bbs"), wxOPEN); 00555 if (openFileDialog->ShowModal() == wxID_OK) { 00556 wxString fileName = openFileDialog->GetPath(); 00557 00558 _tabsMgr->addNewTab(openFileDialog->GetFilename()); 00559 00560 bbtk::InterpreterBBS::Pointer I = bbtk::InterpreterBBS::New( 00561 this->_tabsMgr->getActualTabPanel()->getSceneManager(), 00562 _pkgBrowser->GetFactory()); 00563 00564 // We tell the interpreter to throw exceptions on error 00565 I->SetThrow(true); 00566 // Interpret the file supposed to define a box called 'Processing' 00567 I->InterpretFile((const char*) (fileName.mb_str())); 00568 } 00569 refreshGUIControls(); 00570 }
void bbtk::wxGUIEditorGraphicBBS::OnOpenDiagram | ( | wxCommandEvent & | event | ) |
Definition at line 825 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _tabsMgr, bbtk::wxTabPanelsManager::addNewTab(), bbtk::ID_UNDO, bbtk::wxTabPanelsManager::loadDiagram(), refreshGUIControls(), and bbtk::wxTabPanelsManager::saveTempActualDiagram().
Referenced by initToolbar().
00825 { 00826 wxFileDialog * openFileDialog = new wxFileDialog(this, wxT("Open diagram"), 00827 wxEmptyString, wxT(""), wxT("*.bbg"), wxOPEN | wxFILE_MUST_EXIST); 00828 printf("SCP: wxGUIEditorGraphicBBS::OnOpenDiagram \n"); 00829 if (openFileDialog->ShowModal() == wxID_OK) { 00830 wxString fileName = openFileDialog->GetPath(); 00831 ifstream inputStream; 00832 std::string fName = (const char*) (fileName.mb_str()); 00833 00834 inputStream.open(fName.c_str()); 00835 assert(inputStream.good()); // fails 00836 _tabsMgr->addNewTab(openFileDialog->GetFilename()); 00837 _tabsMgr->loadDiagram(inputStream, fName); 00838 _tabsMgr->saveTempActualDiagram("load diagram"); 00839 GetToolBar()->EnableTool(ID_UNDO, false); 00840 GetToolBar()->EnableTool(ID_UNDO, false); 00841 inputStream.close(); 00842 } 00843 refreshGUIControls(); 00844 }
void bbtk::wxGUIEditorGraphicBBS::OnPlugPackage | ( | wxCommandEvent & | event | ) |
Definition at line 949 of file bbtkwxGUIEditorGraphicBBS.cxx.
Referenced by initMenu().
void bbtk::wxGUIEditorGraphicBBS::OnRedo | ( | wxCommandEvent & | event | ) |
Definition at line 518 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _tabsMgr, bbtk::wxTabPanelsManager::GetNameTabPanel(), bbtk::wxTabPanelsManager::getRedoState(), bbtk::wxTabPanelsManager::getUndoState(), bbtk::ID_REDO, bbtk::ID_UNDO, bbtk::wxTabPanelsManager::loadTempDiagram(), refreshGUIControls(), and bbtk::wxTabPanelsManager::SetNameTabPanel().
Referenced by initToolbar().
00518 { 00519 unsigned short disable; 00520 std::string stundo; 00521 std::string stredo; 00522 00523 _tabsMgr->loadTempDiagram(1); 00524 std::string name = _tabsMgr->GetNameTabPanel(); 00525 if(name[name.length() - 1] != '*') 00526 name +="*"; 00527 _tabsMgr->SetNameTabPanel(wxString (name.c_str(), wxConvUTF8)); 00528 GetToolBar()->EnableTool(ID_UNDO,_tabsMgr->getUndoState(stundo)); 00529 GetToolBar()->SetToolShortHelp(ID_UNDO,crea::std2wx(stundo)); 00530 GetToolBar()->EnableTool(ID_REDO,_tabsMgr->getRedoState(stredo)); 00531 GetToolBar()->SetToolShortHelp(ID_REDO,crea::std2wx(stredo)); 00532 refreshGUIControls(); 00533 }
void bbtk::wxGUIEditorGraphicBBS::OnSaveActualBBS | ( | wxCommandEvent & | event | ) |
Definition at line 591 of file bbtkwxGUIEditorGraphicBBS.cxx.
References CheckExtension(), and SaveActualBBS().
Referenced by initMenu().
00591 { 00592 wxFileDialog * saveFileDialog = new wxFileDialog(this, 00593 wxT("Save actual BBS"), wxEmptyString, wxT("NewBBS"), 00594 wxT("*.bbs"), wxSAVE | wxOVERWRITE_PROMPT); 00595 if (saveFileDialog->ShowModal() == wxID_OK) { 00596 wxString fileName = saveFileDialog->GetPath(); 00597 std::string filename = (const char*) (fileName.mb_str()); 00598 filename=CheckExtension (filename, ".bbs"); 00599 SaveActualBBS(filename); 00600 } 00601 00602 }
void bbtk::wxGUIEditorGraphicBBS::OnSaveActualComplexBox | ( | wxCommandEvent & | event | ) |
Definition at line 653 of file bbtkwxGUIEditorGraphicBBS.cxx.
References CheckExtension(), and SaveActualComplexBox().
Referenced by initMenu().
00653 { 00654 wxFileDialog * saveFileDialog = new wxFileDialog(this, 00655 wxT("Save Complex Box BBS"), wxEmptyString, 00656 _T("ComplexBoxName"), wxT("*.bbs"), wxSAVE 00657 | wxOVERWRITE_PROMPT); 00658 if (saveFileDialog->ShowModal() == wxID_OK) { 00659 wxString fileName = saveFileDialog->GetPath(); 00660 std::string filename = (const char*) (fileName.mb_str()); 00661 filename=CheckExtension (filename, ".bbs"); 00662 SaveActualComplexBox(filename); 00663 } 00664 }
void bbtk::wxGUIEditorGraphicBBS::OnSaveActualDiagram | ( | wxCommandEvent & | event | ) |
Definition at line 740 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _tabsMgr, AskComplexBoxConfiguration(), bbtk::wxTabPanelsManager::GetCurrentTabPanelPath(), bbtk::wxTabPanelsManager::GetNameTabPanel(), bbtk::wxTabPanelsManager::isActualDiagramComplexBox(), SaveActualBBS(), SaveActualComplexBox(), SaveActualDiagram(), SaveCurrentDiagramAs(), and bbtk::wxTabPanelsManager::SetNameTabPanel().
Referenced by initMenu(), and initToolbar().
00740 { 00741 std::string pathfilename = _tabsMgr->GetCurrentTabPanelPath(); 00742 if (pathfilename.empty()) { 00743 SaveCurrentDiagramAs(); 00744 } else { 00745 std::string pathfilenamebbs = pathfilename; 00746 pathfilenamebbs[pathfilenamebbs.length() - 1] = 's'; 00747 00748 if (_tabsMgr->isActualDiagramComplexBox() == false) { 00749 std::string name = _tabsMgr->GetNameTabPanel(); 00750 if(name[name.length() - 1] == '*') 00751 { 00752 name =name.substr(0,name.length()-1); 00753 } 00754 _tabsMgr->SetNameTabPanel(wxString (name.c_str(), wxConvUTF8)); 00755 SaveActualDiagram(pathfilename); 00756 SaveActualBBS(pathfilenamebbs); 00757 } else { 00758 AskComplexBoxConfiguration(); 00759 SaveActualDiagram(pathfilename); 00760 SaveActualComplexBox(pathfilenamebbs); 00761 } //if isActualDiagramComplexBox 00762 } 00763 }
void bbtk::wxGUIEditorGraphicBBS::OnSaveAsActualDiagram | ( | wxCommandEvent & | event | ) |
Definition at line 766 of file bbtkwxGUIEditorGraphicBBS.cxx.
References SaveCurrentDiagramAs().
Referenced by initMenu(), and initToolbar().
00766 { 00767 SaveCurrentDiagramAs(); 00768 }
void bbtk::wxGUIEditorGraphicBBS::OnShowHTMLDoc | ( | wxCommandEvent & | event | ) |
Definition at line 958 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _frameAUIMgr, _helpHtmlBrowser, initHelpHTMLBrowser(), and refreshGUIControls().
Referenced by initMenu().
00958 { 00959 // JGRR & CM WH 00960 if (_helpHtmlBrowser != NULL){ 00961 _frameAUIMgr->DetachPane(_helpHtmlBrowser); 00962 _helpHtmlBrowser->Destroy(); 00963 } 00964 initHelpHTMLBrowser(); 00965 _frameAUIMgr->AddPane(_helpHtmlBrowser, wxAuiPaneInfo().Right().MinSize(200, 200)); 00966 _frameAUIMgr->Update(); 00967 refreshGUIControls(); 00968 00969 // EO JGRR & CM WH 00970 }
void bbtk::wxGUIEditorGraphicBBS::OnUndo | ( | wxCommandEvent & | event | ) |
Definition at line 494 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _tabsMgr, bbtk::wxTabPanelsManager::GetNameTabPanel(), bbtk::wxTabPanelsManager::getRedoState(), bbtk::wxTabPanelsManager::getUndoState(), bbtk::ID_REDO, bbtk::ID_UNDO, bbtk::wxTabPanelsManager::loadTempDiagram(), refreshGUIControls(), and bbtk::wxTabPanelsManager::SetNameTabPanel().
Referenced by initToolbar().
00494 { 00495 unsigned short disable; 00496 std::string stundo; 00497 std::string stredo; 00498 00499 _tabsMgr->loadTempDiagram(0); 00500 disable = _tabsMgr->getUndoState(stundo); 00501 if(disable == 0) 00502 { 00503 std::string name = _tabsMgr->GetNameTabPanel(); 00504 if(name[name.length() - 1] == '*') 00505 { 00506 name =name.substr(0,name.length()-1); 00507 } 00508 _tabsMgr->SetNameTabPanel(wxString (name.c_str(), wxConvUTF8)); 00509 } 00510 00511 GetToolBar()->EnableTool(ID_UNDO,disable); 00512 GetToolBar()->SetToolShortHelp(ID_UNDO,crea::std2wx(stundo)); 00513 GetToolBar()->EnableTool(ID_REDO,_tabsMgr->getRedoState(stredo)); 00514 GetToolBar()->SetToolShortHelp(ID_REDO,crea::std2wx(stredo)); 00515 refreshGUIControls(); 00516 }
void bbtk::wxGUIEditorGraphicBBS::refreshGUIControls | ( | ) |
TODO Fix the possibility to say from the SceneManager to the GUI to refresh the options
Definition at line 771 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _tabsMgr, bbtk::wxTabPanelsManager::getNumActualSelectedObjects(), bbtk::wxTabPanelsManager::getRedoState(), bbtk::wxTabPanelsManager::getUndoState(), bbtk::ID_ADDCOMPLEXBOXINPUT, bbtk::ID_ADDCOMPLEXBOXOUTPUT, bbtk::ID_BTNCOMPLEXBOX, bbtk::ID_COPY_TO_COMPLEXDIAGRAM, bbtk::ID_REDO, bbtk::ID_SAVE_AS_BBS, bbtk::ID_SAVE_AS_COMPLEXBOX, bbtk::ID_UNDO, and bbtk::wxTabPanelsManager::isActualDiagramComplexBox().
Referenced by bbtk::wxTabPanelsManager::copySelectedBBoxesToComplexDiagram(), OnClickBtnComplexBox(), OnCreateNewTab(), OnOpenBBS(), OnOpenDiagram(), OnRedo(), OnShowHTMLDoc(), bbtk::wxTabPanelsManager::OnTabChanged(), OnUndo(), and wxGUIEditorGraphicBBS().
00771 { 00772 std::string stundo; 00773 std::string stredo; 00774 wxToolBar* toolbar = GetToolBar(); 00775 if (_tabsMgr->isActualDiagramComplexBox()) { 00776 toolbar->ToggleTool(ID_BTNCOMPLEXBOX, true); 00777 toolbar->EnableTool(ID_ADDCOMPLEXBOXINPUT, true); 00778 toolbar->EnableTool(ID_ADDCOMPLEXBOXOUTPUT, true); 00779 00780 GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_COMPLEXBOX, true); 00781 GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_BBS, false); 00782 } else { 00783 toolbar->ToggleTool(ID_BTNCOMPLEXBOX, false); 00784 toolbar->EnableTool(ID_ADDCOMPLEXBOXINPUT, false); 00785 toolbar->EnableTool(ID_ADDCOMPLEXBOXOUTPUT, false); 00786 00787 GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_COMPLEXBOX, false); 00788 GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_BBS, true); 00789 } 00790 00791 GetToolBar()->EnableTool(ID_UNDO,_tabsMgr->getUndoState(stundo)); 00792 GetToolBar()->SetToolShortHelp(ID_UNDO,crea::std2wx(stundo)); 00793 GetToolBar()->EnableTool(ID_REDO,_tabsMgr->getRedoState(stredo)); 00794 GetToolBar()->SetToolShortHelp(ID_REDO,crea::std2wx(stredo)); 00795 00796 if (_tabsMgr->getNumActualSelectedObjects() > 0) { 00797 GetMenuBar()->GetMenu(1)->Enable(ID_COPY_TO_COMPLEXDIAGRAM, true); 00798 } else { 00800 GetMenuBar()->GetMenu(1)->Enable(ID_COPY_TO_COMPLEXDIAGRAM, true); 00801 } 00802 00803 }
void bbtk::wxGUIEditorGraphicBBS::RegenerateAll | ( | ) |
Definition at line 391 of file bbtkwxGUIEditorGraphicBBS.cxx.
References DoRegenerateBoxesLists(), and DoRegeneratePackageDoc().
00391 { 00392 DoRegeneratePackageDoc("-a"); 00393 DoRegenerateBoxesLists(); 00394 }
void bbtk::wxGUIEditorGraphicBBS::SaveActualBBS | ( | std::string | filename | ) |
Definition at line 572 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _tabsMgr, and bbtk::wxTabPanelsManager::getActualDiagramBBS().
Referenced by OnSaveActualBBS(), OnSaveActualDiagram(), and SaveCurrentDiagramAs().
00572 { 00573 ofstream file; 00574 00575 //EED file.open(fileName.c_str()); 00576 file.open(filename.c_str()); 00577 std::string content = ""; 00578 // writing file header 00579 content += "# ----------------------------------\n"; 00580 content += "# - BBTKGEditor v 1.2 BBS BlackBox Script\n"; 00581 content += "# - "; 00582 content += filename; 00583 content += "\n"; 00584 content += "# ----------------------------------\n"; 00585 content += "\n"; 00586 content += _tabsMgr->getActualDiagramBBS(); 00587 file << content; 00588 file.close(); 00589 }
void bbtk::wxGUIEditorGraphicBBS::SaveActualComplexBox | ( | std::string | filename | ) |
Definition at line 632 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _tabsMgr, and bbtk::wxTabPanelsManager::getActualComplexBoxBBS().
Referenced by OnSaveActualComplexBox(), OnSaveActualDiagram(), and SaveCurrentDiagramAs().
00632 { 00633 ofstream file; 00634 file.open(filename.c_str()); 00635 00636 std::string content = ""; 00637 00638 // writing file header 00639 content += "# ----------------------------------\n"; 00640 content += "# - BBTKGEditor v 1.2 BBS BlackBox Script (Complex Box)\n"; 00641 content += "# - "; 00642 content += filename; 00643 content += "\n"; 00644 content += "# ----------------------------------\n"; 00645 content += "\n"; 00646 content += _tabsMgr->getActualComplexBoxBBS(); 00647 file << content; 00648 file.close(); 00649 }
void bbtk::wxGUIEditorGraphicBBS::SaveActualDiagram | ( | std::string | filename | ) |
Definition at line 667 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _tabsMgr, and bbtk::wxTabPanelsManager::saveActualDiagram().
Referenced by OnSaveActualDiagram(), and SaveCurrentDiagramAs().
00667 { 00668 ofstream file; 00669 file.open(filename.c_str()); 00670 00671 std::string content = ""; 00672 00673 // writing file header 00674 content += "# ----------------------------------\n"; 00675 content += "# - BBTKGEditor v 1.2 BBG BlackBox Diagram file\n"; 00676 content += "# - "; 00677 00678 content += filename; 00679 00680 content += "\n"; 00681 content += "# ----------------------------------\n"; 00682 content += "\n"; 00683 content += "APP_START\n"; 00684 _tabsMgr->saveActualDiagram(content, filename); //DFCH 00685 content += "APP_END\n"; 00686 file << content; 00687 file.close(); 00688 }
void bbtk::wxGUIEditorGraphicBBS::SaveCurrentDiagramAs | ( | ) |
Definition at line 710 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _tabsMgr, AskComplexBoxConfiguration(), CheckExtension(), bbtk::wxTabPanelsManager::isActualDiagramComplexBox(), SaveActualBBS(), SaveActualComplexBox(), SaveActualDiagram(), and bbtk::wxTabPanelsManager::SetNameTabPanel().
Referenced by OnSaveActualDiagram(), and OnSaveAsActualDiagram().
00710 { 00711 wxFileDialog * saveFileDialog = new wxFileDialog(this, 00712 wxT("Save current diagram"), wxEmptyString, wxT("NewDiagram"), 00713 wxT("*.bbg"), wxSAVE | wxOVERWRITE_PROMPT); 00714 if (saveFileDialog->ShowModal() == wxID_OK) { 00715 //_tabsMgr->SetNameTabPanel(saveFileDialog->GetFilename()); 00716 wxString pathfileName = saveFileDialog->GetPath(); 00717 std::string pathfilename = (const char*) (pathfileName.mb_str()); 00718 pathfilename=CheckExtension (pathfilename, ".bbg"); 00719 00720 //modify the tab name accordingly 00721 wxString fileName = saveFileDialog->GetFilename(); 00722 std::string filename = (const char*) (fileName.mb_str()); 00723 filename=CheckExtension (filename, ".bbg"); 00724 _tabsMgr->SetNameTabPanel( wxString (filename.c_str(), wxConvUTF8) ); 00725 00726 std::string pathfilenamebbs = pathfilename; 00727 pathfilenamebbs[pathfilenamebbs.length() - 1] = 's'; 00728 if (_tabsMgr->isActualDiagramComplexBox() == false) { 00729 SaveActualDiagram(pathfilename); 00730 SaveActualBBS(pathfilenamebbs); 00731 } else { 00732 AskComplexBoxConfiguration(); 00733 SaveActualDiagram(pathfilename); 00734 SaveActualComplexBox(pathfilenamebbs); 00735 } //if isActualDiagramComplexBox 00736 } // if saveFileDialog 00737 }
void bbtk::wxGUIEditorGraphicBBS::SaveTempActualDiagram | ( | const std::string & | action | ) |
Definition at line 691 of file bbtkwxGUIEditorGraphicBBS.cxx.
References _tabsMgr, bbtk::wxTabPanelsManager::GetNameTabPanel(), bbtk::wxTabPanelsManager::getRedoState(), bbtk::wxTabPanelsManager::getUndoState(), bbtk::ID_REDO, bbtk::ID_UNDO, bbtk::wxTabPanelsManager::saveTempActualDiagram(), and bbtk::wxTabPanelsManager::SetNameTabPanel().
Referenced by OnClickBtnBox(), bbtk::wxBlackBoxEditionDialog::onClickOk(), and bbtk::wxTabPanelsManager::saveTempandUpdate().
00692 { 00693 std::string stundo; 00694 std::string stredo; 00695 std::string name = _tabsMgr->GetNameTabPanel(); 00696 if(name[name.length() - 1] != '*') 00697 name +="*"; 00698 _tabsMgr->SetNameTabPanel(wxString (name.c_str(), wxConvUTF8)); 00699 _tabsMgr->saveTempActualDiagram(action); 00700 GetToolBar()->EnableTool(ID_UNDO,_tabsMgr->getUndoState(stundo)); 00701 GetToolBar()->SetToolShortHelp(ID_UNDO,crea::std2wx(stundo)); 00702 GetToolBar()->EnableTool(ID_REDO,_tabsMgr->getRedoState(stredo)); 00703 GetToolBar()->SetToolShortHelp(ID_REDO,crea::std2wx(stredo)); 00704 }
void bbtk::wxGUIEditorGraphicBBS::updateStatusBar | ( | std::string | textStatus | ) |
Definition at line 435 of file bbtkwxGUIEditorGraphicBBS.cxx.
Referenced by bbtk::wxTabPanelsManager::updateStatusBar().
std::string bbtk::wxGUIEditorGraphicBBS::_actualPkgBrowserBoxName [private] |
Definition at line 202 of file bbtkwxGUIEditorGraphicBBS.h.
Referenced by displayBlackBoxInfo(), and wxGUIEditorGraphicBBS().
std::string bbtk::wxGUIEditorGraphicBBS::_actualPkgBrowserPkgName [private] |
Definition at line 203 of file bbtkwxGUIEditorGraphicBBS.h.
Referenced by displayBlackBoxInfo(), and wxGUIEditorGraphicBBS().
wxAuiManager* bbtk::wxGUIEditorGraphicBBS::_frameAUIMgr [private] |
Definition at line 187 of file bbtkwxGUIEditorGraphicBBS.h.
Referenced by initPackageBrowser(), initTabPanelsManager(), OnShowHTMLDoc(), wxGUIEditorGraphicBBS(), and ~wxGUIEditorGraphicBBS().
WxGUIHtmlBrowser* bbtk::wxGUIEditorGraphicBBS::_helpHtmlBrowser [private] |
Definition at line 199 of file bbtkwxGUIEditorGraphicBBS.h.
Referenced by initHelpHTMLBrowser(), OnShowHTMLDoc(), and wxGUIEditorGraphicBBS().
wxAuiNotebook* bbtk::wxGUIEditorGraphicBBS::_notebook [private] |
Definition at line 193 of file bbtkwxGUIEditorGraphicBBS.h.
Referenced by getAuiNotebook(), initTabPanelsManager(), and ~wxGUIEditorGraphicBBS().
WxGUIPackageBrowser2* bbtk::wxGUIEditorGraphicBBS::_pkgBrowser [private] |
Definition at line 196 of file bbtkwxGUIEditorGraphicBBS.h.
Referenced by displayBlackBoxInfo(), initPackageBrowser(), OnClickBtnBox(), and OnOpenBBS().
Definition at line 190 of file bbtkwxGUIEditorGraphicBBS.h.
Referenced by AskComplexBoxConfiguration(), boxNameExists(), initTabPanelsManager(), OnAddComplexBoxInput(), OnAddComplexBoxOutput(), OnCenterViewActualDiagram(), OnClickBtnBox(), OnClickBtnComplexBox(), OnClickBtnExecutableBox(), OnCopySelectedToComplexDiagram(), OnCreateNewTab(), OnDeleteAllBoxesActualDiagram(), OnExecuteActualDiagram(), OnOpenBBS(), OnOpenDiagram(), OnRedo(), OnSaveActualDiagram(), OnUndo(), refreshGUIControls(), SaveActualBBS(), SaveActualComplexBox(), SaveActualDiagram(), SaveCurrentDiagramAs(), SaveTempActualDiagram(), and ~wxGUIEditorGraphicBBS().