From 622a4096d40d4e6309f58099070935b647646abf Mon Sep 17 00:00:00 2001 From: caceres <> Date: Mon, 26 Mar 2012 12:19:03 +0000 Subject: [PATCH] DFCH: MakeExecutableBox --- Make All selected executable. Changed: Iteration to take all selected boxes --- .../wxVtkSceneManager.cxx | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx index c482711..b080d31 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx @@ -1141,26 +1141,27 @@ std::string wxVtkSceneManager::LineNumber(bool withLineNumber, int &value) { //DFCH bool wxVtkSceneManager::MakeBoxExecutable() { std::map selected = getSelectedObjects(); - - std::map::iterator it = selected.end(); - it--; - GObjectController* lastSelected = it->second; - //GObjectController* lastSelected = selected[selected.size()-1]; - if( lastSelected ) - { - vtkGObjectView* view = (vtkGObjectView*) lastSelected->getView(); - GBlackBoxModel *bbmodel = (GBlackBoxModel*) lastSelected->getModel(); - view->setState(HIGHLIGHTED); - if (bbmodel->isExecutable()) { - bbmodel->setExecutable(false); - } else { - bbmodel->setExecutable(true); + if( selected.empty() ) + return false; + bool ret = false; + std::map::iterator it; + for (it = selected.begin(); it != selected.end(); ++it) { + GObjectController* lastSelected = it->second; + if (lastSelected) { + vtkGObjectView* view = (vtkGObjectView*) lastSelected->getView(); + GBlackBoxModel *bbmodel = + (GBlackBoxModel*) lastSelected->getModel(); + view->setState(HIGHLIGHTED); + if (bbmodel->isExecutable()) { + bbmodel->setExecutable(false); + } else { + bbmodel->setExecutable(true); + } + bbmodel->notifyObservers(lastSelected->getId()); + ret = true; } - bbmodel->notifyObservers(lastSelected->getId()); - return true; } - else - return( false ); + return ret; } //DFCH -- 2.47.1