]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GBlackBoxController.cxx
Change in colors and middle button to select executable box(es)
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsVtkGUIEditorGraphic / GBlackBoxController.cxx
index bafa37f019402b0de5a36bc0c19179e6334afe1a..efe5ba8e6ae4df12697f7cfa3c5ac65b1bf37210 100644 (file)
@@ -140,8 +140,37 @@ namespace bbtk
        
        //=========================================================================
        
-       bool GBlackBoxController::OnRightButtonDown()
+       bool GBlackBoxController::OnRightButtonUp()
        {
+               GBlackBoxModel *bbmodel = (GBlackBoxModel*)_model;
+               if(bbmodel->isExecutable())
+               {
+                       bbmodel->setExecutable(false);
+               }
+               
+               return true;
+       }
+
+       //=========================================================================
+
+       bool GBlackBoxController::OnMiddleButtonDown()
+       {
+               int X,Y;
+               wxVTKRenderWindowInteractor *wxVTKiren;
+               wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
+               wxVTKiren->GetEventPosition(X,Y);
+
+               int state  = _view->getState();
+
+               //Evaluate new state
+               if(_view->isPointInside(X,Y))
+               {
+                       GBlackBoxModel *bbmodel = (GBlackBoxModel*)_model;
+                       _view->setState(HIGHLIGHTED);
+                       bbmodel->setExecutable(true);
+                       bbmodel->notifyObservers(_id);
+               }
+                       
                return true;
        }