X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FEditorGraphicBBS%2FbbsWxGUIEditorGraphic%2FbbtkwxGUIEditorGraphicBBS.cxx;h=bea7df0f96c42e0b36e4405c92f0b3e81192ab22;hb=062ee1e352a911991a120c5bf95ba836a6b0871b;hp=34a854210315b1fc3411494e1859cc826d92b5b2;hpb=5df5effdcd9f09c81c68fd63b1f0359593a823bd;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx index 34a8542..bea7df0 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx @@ -71,6 +71,8 @@ namespace bbtk CreateStatusBar(); _frameAUIMgr->Update(); + _actualPkgBrowserBoxName=""; + _actualPkgBrowserPkgName=""; } @@ -89,14 +91,16 @@ 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")); + _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(1000,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnToolLeftClick)); + Connect(1001,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnToolLeftClick)); } //========================================================================= @@ -133,9 +137,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()); } @@ -152,7 +156,7 @@ namespace bbtk void wxGUIEditorGraphicBBS::initPropertiesPanel() { _propertiesPanel = new wxPropertiesPanel(this); - _frameAUIMgr->AddPane(_propertiesPanel,wxAuiPaneInfo().Right().MinSize(200,200).CloseButton(false).Floatable(false)); + //_frameAUIMgr->AddPane(_propertiesPanel,wxAuiPaneInfo().Right().MinSize(200,200).CloseButton(false).Floatable(false)); } //================================================================ @@ -251,7 +255,79 @@ namespace bbtk DoRegenerateBoxesLists(); } - //================================================================ + //================================================================ + + wxAuiNotebook* wxGUIEditorGraphicBBS::getAuiNotebook() + { + return _notebook; + } + + //================================================================ + + void wxGUIEditorGraphicBBS::displayBlackBoxInfo(std::string packageName, std::string boxName) + { + if(_actualPkgBrowserPkgName != packageName || _actualPkgBrowserBoxName != boxName ) + { + _actualPkgBrowserPkgName = packageName; + _actualPkgBrowserBoxName = boxName; + + BlackBoxDescriptor::Pointer descriptor = GObjectsMVCFactory::getInstance()->getBlackBoxDescriptor(packageName, boxName); + _pkgBrowser->WxGUIBlackBoxListUserOnSelected(descriptor.get()); + } + } + + //========================================================================= + + void wxGUIEditorGraphicBBS::updateStatusBar(std::string textStatus) + { + SetStatusText(_T(textStatus)); + } + + //========================================================================= + + void wxGUIEditorGraphicBBS::executeActualDiagram() + { + std::string script = _tabsMgr->getActualDiagramScript(); + cout<<"RaC wxGUIEditorGraphicBBS::executeActualDiagram SCRIPT"<addNewTab(); - break; + case 1000 : + _tabsMgr->addNewTab(); + break; + + case 1001 : + executeActualDiagram(); + break; } }