Commit 40836e15 authored by Joachim Pouderoux's avatar Joachim Pouderoux Committed by Code Review

Merge topic 'add_context_scene_button_release_event' into master

c80a4db2 Make vtkContextScene ButtonPress/ReleaseEvent invoke a button event.
parents aec1c0b7 c80a4db2
......@@ -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