Allow the removal of annotation sequences via a context menu.

This commit is contained in:
Jonathan Moore Liles 2010-01-24 16:42:32 -06:00
parent 2cc88013df
commit 80f24ba2d1
1 changed files with 24 additions and 0 deletions

View File

@ -104,6 +104,8 @@ public:
{ {
case FL_PUSH: case FL_PUSH:
{ {
Logger log( this );
if ( Fl::event_button1() ) if ( Fl::event_button1() )
{ {
add( new Annotation_Point( this, x_to_offset( Fl::event_x() ), "mark" ) ); add( new Annotation_Point( this, x_to_offset( Fl::event_x() ), "mark" ) );
@ -124,6 +126,28 @@ public:
return 1; return 1;
} }
else if ( Fl::event_button3() && ! ( Fl::event_state() & ( FL_ALT | FL_SHIFT | FL_CTRL ) ) )
{
Fl_Menu_Item menu[] =
{
{ "Remove" },
{ 0 }
};
const Fl_Menu_Item *r = menu->popup( Fl::event_x(), Fl::event_y(), "Annotation Sequence" );
if ( r )
{
if ( r == &menu[ 0 ] )
{
Fl::delete_widget( this );
}
}
return 1;
}
break; break;
} }
default: default: