X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=lib%2FEditorGraphicBBS%2FbbsWxGUIEditorGraphic%2FbbtkwxGUIEditorGraphicBBS.cxx;h=7d6beada6e4cf14ab70541b74820a42d2666d89b;hb=8a680b0e68359ef1d8dc810d776a4f354ffb65e5;hp=f2e6e086a58a0aa4986deefee9258e30e904ba5e;hpb=ac7e88cf5991d996435b15c7d731b67078f8b2c9;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx index f2e6e08..7d6bead 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx @@ -34,6 +34,7 @@ Version: $Revision$ */ #include "bbtkwxGUIEditorGraphicBBS.h" +#include "creaWx.h" namespace bbtk { @@ -66,10 +67,13 @@ namespace bbtk initToolbar(); initTabPanelsManager(); initPackageBrowser(); - + initHelpHTMLBrowser(); + initPropertiesPanel(); CreateStatusBar(); _frameAUIMgr->Update(); + _actualPkgBrowserBoxName=""; + _actualPkgBrowserPkgName=""; } @@ -88,27 +92,26 @@ namespace bbtk wxToolBar *_toolbar = new wxToolBar(this, wxID_ANY); //Adds a tool btn to the toolbar - _toolbar->AddTool(wxID_NEW,_T("New"),bmp_new, wxNullBitmap, wxITEM_NORMAL,_T("New tab"), _T("Create a new panel tab")); - - - //////////////////// - // TEMP to avoid drag and drop - - _toolbar->AddTool(15,_T("New Box"),bmp_new, wxNullBitmap, wxITEM_NORMAL,_T("New Box"), _T("Create a new Box")); - - - // - //////////////////// + _toolbar->AddTool(1000,_T("New"),bmp_new, wxNullBitmap, wxITEM_NORMAL,_T("New tab"), _T("Create a new panel tab")); + _toolbar->AddTool(1001,_T("Execute"),bmp_new, wxNullBitmap, wxITEM_NORMAL,_T("Execute actual diagram"), _T("Execute actual diagram")); _toolbar->SetMargins( 2, 2 ); _toolbar->Realize(); SetToolBar(_toolbar); // connect command event handlers - Connect(wxID_NEW,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnToolLeftClick)); - Connect(15,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnToolLeftClick)); + Connect(1000,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnToolLeftClick)); + Connect(1001,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnToolLeftClick)); } + //========================================================================= + void wxGUIEditorGraphicBBS::initHelpHTMLBrowser() + { + //TO FIX THE PATH OF BBTK BIN IN ORDER TO USE REGENERATE EXECUTABLES + //RegenerateAll(); + _helpHtmlBrowser = new WxGUIHtmlBrowser(this,wxSize(200,0)); + _frameAUIMgr->AddPane(_helpHtmlBrowser,wxAuiPaneInfo().Right().MinSize(200,200)); + } //========================================================================= void wxGUIEditorGraphicBBS::initMenu() @@ -121,6 +124,8 @@ namespace bbtk helpMenu->Append(wxID_ABOUT, _T("&About..."), _T("About")); fileMenu->Append(wxID_EXIT, _T("E&xit"), _T("Exit")); + Connect(wxID_EXIT,wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnExit)); + // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); menuBar->Append(fileMenu, _T("&File")); @@ -133,9 +138,9 @@ namespace bbtk //========================================================================= void wxGUIEditorGraphicBBS::initTabPanelsManager() { - wxAuiNotebook *notebook = new wxAuiNotebook(this,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxAUI_NB_TOP|wxAUI_NB_TAB_MOVE|wxAUI_NB_CLOSE_ON_ACTIVE_TAB|wxAUI_NB_TAB_FIXED_WIDTH|wxAUI_NB_WINDOWLIST_BUTTON); - _tabsMgr = new wxTabPanelsManager(notebook); - _frameAUIMgr->AddPane(notebook,wxAuiPaneInfo().CenterPane()); + _notebook = new wxAuiNotebook(this,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxAUI_NB_TOP|wxAUI_NB_TAB_MOVE|wxAUI_NB_CLOSE_ON_ACTIVE_TAB|wxAUI_NB_TAB_FIXED_WIDTH|wxAUI_NB_WINDOWLIST_BUTTON); + _tabsMgr = new wxTabPanelsManager(this); + _frameAUIMgr->AddPane(_notebook,wxAuiPaneInfo().CenterPane()); } @@ -144,10 +149,203 @@ namespace bbtk { _pkgBrowser = new WxGUIPackageBrowser2(this); _pkgBrowser->IncludeAll(); - _frameAUIMgr->AddPane(_pkgBrowser,wxAuiPaneInfo().Left().MinSize(200,200).CloseButton(false)); + _frameAUIMgr->AddPane(_pkgBrowser,wxAuiPaneInfo().Left().MinSize(200,200).CloseButton(false)); + } + + //================================================================ + + void wxGUIEditorGraphicBBS::initPropertiesPanel() + { + _propertiesPanel = new wxPropertiesPanel(this); + //_frameAUIMgr->AddPane(_propertiesPanel,wxAuiPaneInfo().Right().MinSize(200,200).CloseButton(false).Floatable(false)); + } + + //================================================================ + + void wxGUIEditorGraphicBBS::DoRegeneratePackageDoc( const std::string& pack ) + { + std::string mess("Regenerating doc for package '"); + if (pack!="-a"){ + mess += pack + "'"; + } + else + { + mess = "Regenerating doc for all packages"; + } + + mess += " ... please wait"; + + SetStatusText( std2wx(mess) ); + + //BBTK_BUSY_CURSOR; + + std::string command; + #if defined(WIN32) + command = "\""; + #endif + command += ConfigurationFile::GetInstance().Get_bin_path(); + command += ConfigurationFile::GetInstance().Get_file_separator(); + command += "bbRegeneratePackageDoc"; + #if defined(WIN32) + command += "\""; + #endif + + command += " " + pack + " -q"; + bbtkMessage("debug",1,"Executing system command '"<getBlackBoxDescriptor(packageName, boxName); + _pkgBrowser->WxGUIBlackBoxListUserOnSelected(descriptor.get()); + } + } + + //========================================================================= + + void wxGUIEditorGraphicBBS::editBlackBox(GBlackBoxModel *bbmodel) + { + wxBlackBoxEditionDialog* dialog = new wxBlackBoxEditionDialog(this,bbmodel); + dialog->Show(); + } + + //========================================================================= + + void wxGUIEditorGraphicBBS::editDiagramParameters(wxVtkSceneManager* scene) + { + wxBlackBoxEditionDialog* dialog = new wxBlackBoxEditionDialog(this,scene); + dialog->Show(); + } + + //========================================================================= + + void wxGUIEditorGraphicBBS::updateStatusBar(std::string textStatus) + { + SetStatusText(crea::std2wx(textStatus)); + } + + //========================================================================= + + void wxGUIEditorGraphicBBS::executeActualDiagram() + { + std::string script = _tabsMgr->getActualDiagramScript(); + cout<<"RaC wxGUIEditorGraphicBBS::executeActualDiagram SCRIPT"<addNewTab(); - break; - case 15 : - BlackBoxDescriptor* desc = _pkgBrowser->GetActualSelected(); - cout<<"RaC GetActualSelected desc:"<GetAuthor()<addNewTab(); + break; + case 1001 : + executeActualDiagram(); + break; } } + void wxGUIEditorGraphicBBS::OnExit(wxCommandEvent& event) + { + Close(true); + } + } // EO namespace bbtk