Allow timeline widget to take keyboard focus and pass keyboard events on to children.

pull/3/head
Jonathan Moore Liles 2008-04-15 02:13:22 -05:00
parent 7e28987f99
commit a10d86ecfd
2 changed files with 12 additions and 0 deletions

View File

@ -589,6 +589,8 @@ Timeline::handle ( int m )
return 1;
}
default:
return Fl_Overlay_Window::handle( m );
}
return 0;
@ -607,6 +609,8 @@ Timeline::handle ( int m )
{
case FL_PUSH:
{
take_focus();
if ( ! Fl::event_button1() )
return 0;

View File

@ -340,6 +340,10 @@ Track::handle ( int m )
switch ( m )
{
case FL_FOCUS:
return 1;
case FL_UNFOCUS:
return 1;
case FL_DND_ENTER:
printf( "enter\n" );
if ( Track_Widget::pushed() && Track_Widget::pushed()->track()->class_name() == class_name() )
@ -374,7 +378,11 @@ Track::handle ( int m )
int retval = r->dispatch( m );
if ( retval && m == FL_PUSH )
{
take_focus();
Track_Widget::pushed( r );
}
if ( retval && m == FL_RELEASE )
Track_Widget::pushed( NULL );