diff --git a/Timeline/Ruler_Point.H b/Timeline/Ruler_Point.H index f542593..1aa4616 100644 --- a/Timeline/Ruler_Point.H +++ b/Timeline/Ruler_Point.H @@ -22,6 +22,8 @@ #include "Loggable.H" #include "Sequence_Point.H" +#include + class Ruler_Point : public Sequence_Point { @@ -33,6 +35,7 @@ public: if ( _label ) free( _label ); _label = strdup( s ); + redraw(); } protected: @@ -61,7 +64,7 @@ protected: name( v ); } - timeline->redraw(); +// timeline->redraw(); } Ruler_Point ( ) @@ -105,6 +108,18 @@ public: int handle ( int m ) { + Logger _log( this ); + + if ( m == FL_PUSH && Fl::event_button3() && ! Fl::event_ctrl() ) + { + const char *s = fl_input( "New name for mark:", name() ); + + if ( s ) + name( s ); + + return 1; + } + int r = Sequence_Widget::handle( m ); if ( m == FL_RELEASE ) diff --git a/Timeline/Sequence_Widget.C b/Timeline/Sequence_Widget.C index 2588235..867f74c 100644 --- a/Timeline/Sequence_Widget.C +++ b/Timeline/Sequence_Widget.C @@ -95,11 +95,10 @@ Sequence_Widget::draw_label ( const char *label, Fl_Align align, Fl_Color color if ( align & FL_ALIGN_BOTTOM ) fl_draw_box( b, X - dx - bx, Y + H - lh, lw + bw, lh, FL_GRAY ); - else - if ( align & FL_ALIGN_LEFT ) - fl_draw_box( b, X - dx, Y, lw + bw, lh, FL_GRAY ); - else - fl_draw_box( b, X - dx - bx + ((W / 2) - (lw / 2)), Y + ((H / 2) - (lh / 2)), lw + bw, lh, FL_GRAY ); + else if ( align == FL_ALIGN_LEFT ) + fl_draw_box( b, X - dx, Y + ((H / 2) - (lh / 2)), lw + bw, lh, FL_GRAY ); + else if ( align & FL_ALIGN_TOP ) + fl_draw_box( b, X - dx - bx + ((W / 2) - (lw / 2)), Y + ((H / 2) - (lh / 2)), lw + bw, lh, FL_GRAY ); } lab.draw( X - dx, Y, W, H, align ); diff --git a/Timeline/Timeline.C b/Timeline/Timeline.C index 84d092b..6908858 100644 --- a/Timeline/Timeline.C +++ b/Timeline/Timeline.C @@ -168,6 +168,8 @@ Timeline::Timeline ( int X, int Y, int W, int H, const char* L ) : Fl_Overlay_Wi } } + /* rulers go above tracks... */ + add( rulers ); /* make sure scrollbars are on top */ add( vscroll );