X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FEditorGraphicBBS%2FbbsWxGUIEditorGraphic%2FbbtkwxGUIEditorGraphicBBS.cxx;h=c53529c0af34e17f98e8303549d020368382666f;hb=5b4d222a83d861c34b2c08cb624c7569f3a9cc26;hp=c764296793200dfb68f9b2edfe258c903cf9121a;hpb=f99b8e7dd7cede66856ede057976906de775dccc;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx index c764296..c53529c 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx @@ -141,6 +141,7 @@ void wxGUIEditorGraphicBBS::initToolbar() { wxBitmap bmp_undo(undo_xpm); wxBitmap bmp_redo(redo_xpm); wxBitmap bmp_editProperties(editProperties_xpm); + wxBitmap bmp_showTree(showTree_xpm); wxToolBar *toolbar = new wxToolBar(this, wxID_ANY); //Adds a tool btn to the toolbar @@ -192,6 +193,8 @@ void wxGUIEditorGraphicBBS::initToolbar() { toolbar->AddSeparator(); toolbar->AddTool(ID_EDITPROPERTIES, _T("Edit diagram properties"),bmp_editProperties, wxNullBitmap, wxITEM_NORMAL, _T("Edit diagram properties"), _T("Edit diagram properties")); toolbar->EnableTool(ID_EDITPROPERTIES, false); + + toolbar->AddTool(ID_SHOWTREE, _T("Show tree"),bmp_showTree, wxNullBitmap, wxITEM_NORMAL, _T("Show tree"), _T("Show tree")); toolbar->EnableTool(ID_UNDO, false); toolbar->EnableTool(ID_REDO, false); @@ -238,6 +241,7 @@ void wxGUIEditorGraphicBBS::initToolbar() { Connect(ID_REDO,wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnRedo)); Connect(ID_CHANGENAME, wxEVT_COMMAND_RIGHT_CLICK, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnChangeName)); Connect(ID_EDITPROPERTIES,wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnEditDiagramProperties)); + Connect(ID_SHOWTREE,wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnShowTree)); } //========================================================================= @@ -453,6 +457,7 @@ void wxGUIEditorGraphicBBS::displayBlackBoxInfo(std::string packageName, std::st { if (_actualPkgBrowserPkgName != packageName || _actualPkgBrowserBoxName != boxName) { + _actualPkgBrowserPkgName = packageName; _actualPkgBrowserBoxName = boxName; @@ -463,30 +468,24 @@ void wxGUIEditorGraphicBBS::displayBlackBoxInfo(std::string packageName, std::st BlackBoxDescriptor::Pointer descriptor; std::map< std::string, BlackBoxDescriptor::Pointer> mapDesc; - k = _pkgBrowser->GetFactory()->GetPackage(packageName); + k = _pkgBrowser->GetFactory()->GetPackage(_actualPkgBrowserPkgName); mapDesc = k->GetDescriptorMap(); - descriptor = mapDesc[boxName]; - std::vector temp; - descriptor->GetBoxesInside(tree,temp,1); - - + descriptor = mapDesc[_actualPkgBrowserBoxName]; +/* + tree.treeTour(0); -/*CFT - for(int i = 0 ; i < temp.size() ; i++){ - std::cout<< " "<< temp[i] << std::endl; - } + tree.deleteTree(); + descriptor->GetBoxesInside(tree, 0); - if(temp.size()>=1){ - std::cout<< "CAJAS # " << (temp.size()- 3) << std::endl; - for(int i = 0 ; i < temp.size()-1 ; i++){ - if(i<3){std::cout<< " "<< temp[i] << std::endl;} - else{std::cout<< i+1 << " "<< temp[i] << " " < boxesDiagram = _sceneM->boxesDiagram; + //for(int i=0;i mapDesc; + k = _pkgBrowser->GetFactory()->GetPackage(_actualPkgBrowserPkgName); + mapDesc = k->GetDescriptorMap(); + descriptor = mapDesc[_actualPkgBrowserBoxName]; + + tree.treeTour(0); + + tree.deleteTree(); + + descriptor->GetBoxesInside(tree, 0); + + _actualPkgBrowserPkgName = ""; + _actualPkgBrowserBoxName = ""; + } +else + { + std::cout<<"Select a Box"<GetActualSelected(); if (bbDes != NULL) { std::string typeName = bbDes->GetTypeName(); @@ -1121,6 +1150,7 @@ void wxGUIEditorGraphicBBS::OnClickBtnExecutableBox(wxCommandEvent& event) //========================================================================= void wxGUIEditorGraphicBBS::OnClickBtnComplexBox(wxCommandEvent& event) { + std::cout<<"wxGUIEditorGraphicBBS::OnClickBtnComplexBox"<GetToolState(ID_BTNCOMPLEXBOX); if (temp) { @@ -1372,6 +1402,16 @@ void wxGUIEditorGraphicBBS::setCurrentDiagramCategory(std::string category) _tabsMgr->SetCategory(category); } +//========================================================================= +void wxGUIEditorGraphicBBS::setCurrentDiagramMessageKind(std::string kind){ + _tabsMgr->SetMessageKind(kind); +} + +//========================================================================= +void wxGUIEditorGraphicBBS::setCurrentDiagramMessageLevel(std::string level){ + _tabsMgr->SetMessageLevel(level); +} + //========================================================================= std::string wxGUIEditorGraphicBBS::getCurrentDiagramDescription() { @@ -1390,7 +1430,16 @@ std::string wxGUIEditorGraphicBBS::getCurrentDiagramCategory() return _tabsMgr->GetCategory(); } - +//========================================================================= +std::string wxGUIEditorGraphicBBS::getCurrentDiagramMessageKind(){ + return _tabsMgr->GetMessageKind(); +} + +//========================================================================= +std::string wxGUIEditorGraphicBBS::getCurrentDiagramMessageLevel(){ + return _tabsMgr->GetMessageLevel(); +} + //========================================================================= bool wxGUIEditorGraphicBBS::isCurrentDiagramComplexBox() {