Commit c80a4db2 authored by Joachim Pouderoux's avatar Joachim Pouderoux

Make vtkContextScene ButtonPress/ReleaseEvent invoke a button event.

This event might be catched (for instance in PV) to provide interaction
with items.

Change-Id: I3ff3f9a4a121914faebcf6e5d87afc6bc886fe5f
parent aec1c0b7
......@@ -484,6 +484,21 @@ bool vtkContextScene::MouseMoveEvent(const vtkContextMouseEvent &e)
//-----------------------------------------------------------------------------
bool vtkContextScene::ButtonPressEvent(const vtkContextMouseEvent &e)
{
switch (e.GetButton())
{
case vtkContextMouseEvent::LEFT_BUTTON:
this->InvokeEvent(vtkCommand::LeftButtonPressEvent);
break;
case vtkContextMouseEvent::MIDDLE_BUTTON:
this->InvokeEvent(vtkCommand::MiddleButtonPressEvent);
break;
case vtkContextMouseEvent::RIGHT_BUTTON:
this->InvokeEvent(vtkCommand::RightButtonPressEvent);
break;
default:
break;
}
bool res = false;
vtkContextMouseEvent &event = this->Storage->Event;
this->EventCopy(e);
......@@ -506,6 +521,21 @@ bool vtkContextScene::ButtonPressEvent(const vtkContextMouseEvent &e)
//-----------------------------------------------------------------------------
bool vtkContextScene::ButtonReleaseEvent(const vtkContextMouseEvent &e)
{
switch (e.GetButton())
{
case vtkContextMouseEvent::LEFT_BUTTON:
this->InvokeEvent(vtkCommand::LeftButtonReleaseEvent);
break;
case vtkContextMouseEvent::MIDDLE_BUTTON:
this->InvokeEvent(vtkCommand::MiddleButtonReleaseEvent);
break;
case vtkContextMouseEvent::RIGHT_BUTTON:
this->InvokeEvent(vtkCommand::RightButtonReleaseEvent);
break;
default:
break;
}
bool res = false;
if (this->Storage->itemMousePressCurrent.GetPointer())
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment