}
}
- _model->notifyObservers(_id);
+ _model->notifyObservers(getId());
}
return true;
{
_isLeftClickDown=true;
_view->setState(SELECTED);
- _model->notifyObservers(_id,ADD_TO_SELECTED);
+ _model->notifyObservers(getId(),ADD_TO_SELECTED);
}
return true;
{
// It is supposed that I'm always inside even if the box is in drag
_view->setState(SELECTED);
- _model->notifyObservers(_id);
+ _model->notifyObservers(getId());
}
}
return true;
//=========================================================================
- 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(getId());
+ }
+
return true;
}