Commit 892ffad6 authored by Florent D'Halluin's avatar Florent D'Halluin
Browse files

[yavgui] Delete states/transitions on double right click.

One right click -> create stuff.
Double right click -> delete stuff.

* yavgui/src/g_state.cc,
* yavgui/src/g_transition.cc,
* yavgui/src/g_transition.hh: Do that.
parent 35c241de
2009-08-06 d-halluin <d-halluin@lrde.epita.fr>
[yavgui] Delete states/transitions on double right click.
One right click -> create stuff.
Double right click -> delete stuff.
* yavgui/src/g_state.cc,
* yavgui/src/g_transition.cc,
* yavgui/src/g_transition.hh: Do that.
2009-08-06 d-halluin <d-halluin@lrde.epita.fr>
 
[yavgui] Improve compilation.
......
......@@ -178,12 +178,6 @@ namespace gui
event->ignore();
return;
}
if (event->button () == Qt::RightButton)
{
event->accept();
emit delState();
return;
}
QGraphicsItem::mousePressEvent(event);
}
......@@ -203,6 +197,12 @@ namespace gui
return;
}
if (event->button () == Qt::RightButton)
{
event->accept();
emit delState();
return;
}
QGraphicsItem::mousePressEvent(event);
}
......
......@@ -346,13 +346,6 @@ namespace gui
event->ignore();
return;
}
if (event->button () == Qt::RightButton)
{
event->accept();
emit delTransition();
return;
}
if (label_rect_.contains (event->pos ().toPoint ()))
{
label_grab_ = true;
......@@ -361,6 +354,22 @@ namespace gui
label_grab_ = false;
}
void
GTransition::mouseDoubleClickEvent (QGraphicsSceneMouseEvent* event)
{
if (!selected_)
{
event->ignore();
return;
}
if (event->button () == Qt::RightButton)
{
event->accept();
emit delTransition();
return;
}
}
void
GTransition::mouseMoveEvent (QGraphicsSceneMouseEvent* event)
{
......
......@@ -57,6 +57,7 @@ namespace gui
void mouseMoveEvent (QGraphicsSceneMouseEvent* event);
void mousePressEvent (QGraphicsSceneMouseEvent* event);
void mouseDoubleClickEvent (QGraphicsSceneMouseEvent* event);
// Return vcsn_index.
int index() const;
......
Supports Markdown
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