From 25561b328d67546f7942174a38a14148220e4b7c Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Fri, 29 Feb 2008 22:57:53 -0600 Subject: [PATCH] Make timeline use an overlay window. --- Timeline.C | 25 ++++++++++++++++++++++--- Timeline.H | 4 +++- main.C | 1 + 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/Timeline.C b/Timeline.C index 09bdaae..2b79676 100644 --- a/Timeline.C +++ b/Timeline.C @@ -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 ); } } diff --git a/Timeline.H b/Timeline.H index e8297cf..071bcfd 100644 --- a/Timeline.H +++ b/Timeline.H @@ -23,6 +23,7 @@ #include #include #include +#include #include "Scalebar.H" @@ -48,7 +49,7 @@ class Time_Track; #include 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 ); }; diff --git a/main.C b/main.C index 318ac8e..02892d5 100644 --- a/main.C +++ b/main.C @@ -21,6 +21,7 @@ #include #include #include +#include #include // #include #include