Make timeline use an overlay window.

This commit is contained in:
Jonathan Moore Liles 2008-02-29 22:57:53 -06:00
parent d7902f7661
commit 25561b328d
3 changed files with 26 additions and 4 deletions

View File

@ -65,12 +65,13 @@ cb_vscroll ( Fl_Widget *w, void *v )
}
Timeline::Timeline ( int X, int Y, int W, int H, const char* L ) : Fl_Group( X, Y, W, H, L )
Timeline::Timeline ( int X, int Y, int W, int H, const char* L ) : Fl_Overlay_Window( X, Y, W, H, L )
{
box( FL_FLAT_BOX );
xoffset = 0;
X = Y = 0;
{
Scalebar *o = new Scalebar( X, Y + H - 18, W - 18, 18 );
@ -327,7 +328,9 @@ Timeline::draw ( void )
// ( damage() & ( FL_DAMAGE_CHILD | FL_DAMAGE_SCROLL ) ) )
{
draw_box( box(), x(), y(), w(), h(), color() );
// draw_box( box(), x(), y(), w(), h(), color() );
draw_box( box(), 0, 0, w(), h(), color() );
fl_push_clip( x(), rulers->y(), w(), rulers->h() );
draw_child( *rulers );
@ -340,6 +343,7 @@ Timeline::draw ( void )
draw_child( *hscroll );
draw_child( *vscroll );
redraw_overlay();
return;
}
@ -394,6 +398,21 @@ Timeline::draw ( void )
}
}
void
Timeline::draw_overlay ( void )
{
// TODO: draw selection rectangle here!
/* fl_color( FL_BLUE ); */
/* fl_line_style( FL_DOT, 4 ); */
/* fl_rect( 300, 400, 200, 300 ); */
/* fl_line_style( FL_SOLID, 0 ); */
}
int
Timeline::handle ( int m )
@ -408,6 +427,6 @@ Timeline::handle ( int m )
return vscroll->handle( m );
}
default:
return Fl_Group::handle( m );
return Fl_Overlay_Window::handle( m );
}
}

View File

@ -23,6 +23,7 @@
#include <FL/Fl_Pack.H>
#include <FL/Fl_Scrollbar.H>
#include <FL/Fl_Widget.H>
#include <Fl/Fl_Overlay_Window.H>
#include "Scalebar.H"
@ -48,7 +49,7 @@ class Time_Track;
#include <list>
using std::list;
struct Timeline : public Fl_Group
struct Timeline : public Fl_Overlay_Window
{
static void draw_clip ( void * v, int X, int Y, int W, int H );
@ -111,6 +112,7 @@ struct Timeline : public Fl_Group
void draw_measure_lines ( int X, int Y, int W, int H, Fl_Color color );
void position ( int X );
void draw ( void );
void draw_overlay ( void );
int handle ( int m );
};

1
main.C
View File

@ -21,6 +21,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Overlay_Window.H>
#include <FL/Fl_Scroll.H>
// #include <FL/Fl_Scrollbar.H>
#include <FL/Fl_Pack.H>