From 80f24ba2d14f256e000ce55925f07e2229bae9ee Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sun, 24 Jan 2010 16:42:32 -0600 Subject: [PATCH] Allow the removal of annotation sequences via a context menu. --- Timeline/Annotation_Sequence.H | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Timeline/Annotation_Sequence.H b/Timeline/Annotation_Sequence.H index cb2dcc8..ae3fed6 100644 --- a/Timeline/Annotation_Sequence.H +++ b/Timeline/Annotation_Sequence.H @@ -104,6 +104,8 @@ public: { case FL_PUSH: { + Logger log( this ); + if ( Fl::event_button1() ) { add( new Annotation_Point( this, x_to_offset( Fl::event_x() ), "mark" ) ); @@ -124,6 +126,28 @@ public: 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; } default: