Allow Annotation_Points and Annotation_Regions to co-exist on the same sequence.

This commit is contained in:
Jonathan Moore Liles 2008-05-04 21:05:20 -05:00
parent 875ff62c8a
commit d510b21f7f
3 changed files with 21 additions and 8 deletions

View File

@ -21,6 +21,7 @@
#include "Sequence.H" #include "Sequence.H"
#include "Annotation_Point.H" #include "Annotation_Point.H"
#include "Annotation_Region.H"
#include "Timeline.H" #include "Timeline.H"
class Annotation_Sequence : public Sequence, public Loggable class Annotation_Sequence : public Sequence, public Loggable
@ -109,11 +110,25 @@ public:
add( new Annotation_Point( this, x_to_offset( Fl::event_x() ), "mark" ) ); add( new Annotation_Point( this, x_to_offset( Fl::event_x() ), "mark" ) );
redraw(); redraw();
} }
if ( Fl::event_button3() && Fl::event_shift() )
{
Annotation_Region *r = new Annotation_Region( this, x_to_offset( Fl::event_x() ), "mark" );
add( r );
Sequence_Widget::pushed( r );
r->handle( m );
redraw();
return 1;
}
break; break;
} }
default: default:
break; break;
} }
return 0; return 0;

View File

@ -24,14 +24,12 @@
void void
Sequence_Region::draw_box ( void ) Sequence_Region::draw_box ( void )
{ {
fl_draw_box( box(), x(), y(), w(), h(), color() ); fl_draw_box( box(), x(), y(), w(), h(), box_color() );
} }
void void
Sequence_Region::draw ( void ) Sequence_Region::draw ( void )
{ {
} }
void void

View File

@ -39,7 +39,7 @@ protected:
void void
set ( Log_Entry &e ) virtual set ( Log_Entry &e )
{ {
for ( int i = 0; i < e.size(); ++i ) for ( int i = 0; i < e.size(); ++i )
{ {
@ -71,8 +71,8 @@ public:
enum trim_e { NO, LEFT, RIGHT }; enum trim_e { NO, LEFT, RIGHT };
void trim ( enum trim_e t, int X ); void trim ( enum trim_e t, int X );
int handle ( int m ); virtual int handle ( int m );
void draw_box( void ); virtual void draw_box( void );
void draw ( void ); virtual void draw ( void );
}; };