Make control points appear when mouse passes over control sequence.

This commit is contained in:
Jonathan Moore Liles 2008-04-24 22:29:28 -05:00
parent 79d60d7ea6
commit c4288aebe6
3 changed files with 24 additions and 2 deletions

View File

@ -46,6 +46,7 @@ void
Control_Sequence::init ( void ) Control_Sequence::init ( void )
{ {
_track = NULL; _track = NULL;
_highlighted = false;
color( fl_darker( FL_YELLOW ) ); color( fl_darker( FL_YELLOW ) );
} }
@ -136,6 +137,7 @@ Control_Sequence::draw_curve ( bool flip, bool filled )
} }
} }
void void
Control_Sequence::draw ( void ) Control_Sequence::draw ( void )
{ {
@ -211,8 +213,9 @@ Control_Sequence::draw ( void )
timeline->draw_measure_lines( x(), y(), w(), h(), color() ); timeline->draw_measure_lines( x(), y(), w(), h(), color() );
for ( list <Sequence_Widget *>::const_iterator r = _widgets.begin(); r != _widgets.end(); r++ ) if ( _highlighted )
(*r)->draw_box(); for ( list <Sequence_Widget *>::const_iterator r = _widgets.begin(); r != _widgets.end(); r++ )
(*r)->draw_box();
fl_pop_clip(); fl_pop_clip();
} }
@ -220,6 +223,20 @@ Control_Sequence::draw ( void )
int int
Control_Sequence::handle ( int m ) Control_Sequence::handle ( int m )
{ {
switch ( m )
{
case FL_ENTER:
_highlighted = true;
redraw();
return 1;
case FL_LEAVE:
_highlighted = false;
redraw();
return 1;
default:
break;
}
int r = Sequence::handle( m ); int r = Sequence::handle( m );
if ( r ) if ( r )

View File

@ -25,6 +25,8 @@
class Control_Sequence : public Sequence class Control_Sequence : public Sequence
{ {
bool _highlighted;
void init ( void ); void init ( void );
protected: protected:

View File

@ -351,6 +351,9 @@ Sequence::handle ( int m )
return 1; return 1;
case FL_UNFOCUS: case FL_UNFOCUS:
return 1; return 1;
case FL_ENTER:
case FL_LEAVE:
return 1;
case FL_DND_ENTER: case FL_DND_ENTER:
printf( "enter\n" ); printf( "enter\n" );
if ( Sequence_Widget::pushed() && Sequence_Widget::pushed()->track()->class_name() == class_name() ) if ( Sequence_Widget::pushed() && Sequence_Widget::pushed()->track()->class_name() == class_name() )