Make mark labels editable.
This commit is contained in:
parent
c4812d0ade
commit
07b193c9c5
|
@ -22,6 +22,8 @@
|
||||||
#include "Loggable.H"
|
#include "Loggable.H"
|
||||||
#include "Sequence_Point.H"
|
#include "Sequence_Point.H"
|
||||||
|
|
||||||
|
#include <FL/fl_ask.H>
|
||||||
|
|
||||||
class Ruler_Point : public Sequence_Point
|
class Ruler_Point : public Sequence_Point
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -33,6 +35,7 @@ public:
|
||||||
if ( _label )
|
if ( _label )
|
||||||
free( _label );
|
free( _label );
|
||||||
_label = strdup( s );
|
_label = strdup( s );
|
||||||
|
redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -61,7 +64,7 @@ protected:
|
||||||
name( v );
|
name( v );
|
||||||
}
|
}
|
||||||
|
|
||||||
timeline->redraw();
|
// timeline->redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
Ruler_Point ( )
|
Ruler_Point ( )
|
||||||
|
@ -105,6 +108,18 @@ public:
|
||||||
int
|
int
|
||||||
handle ( int m )
|
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 );
|
int r = Sequence_Widget::handle( m );
|
||||||
|
|
||||||
if ( m == FL_RELEASE )
|
if ( m == FL_RELEASE )
|
||||||
|
|
|
@ -95,10 +95,9 @@ Sequence_Widget::draw_label ( const char *label, Fl_Align align, Fl_Color color
|
||||||
|
|
||||||
if ( align & FL_ALIGN_BOTTOM )
|
if ( align & FL_ALIGN_BOTTOM )
|
||||||
fl_draw_box( b, X - dx - bx, Y + H - lh, lw + bw, lh, FL_GRAY );
|
fl_draw_box( b, X - dx - bx, Y + H - lh, lw + bw, lh, FL_GRAY );
|
||||||
else
|
else if ( align == FL_ALIGN_LEFT )
|
||||||
if ( align & FL_ALIGN_LEFT )
|
fl_draw_box( b, X - dx, Y + ((H / 2) - (lh / 2)), lw + bw, lh, FL_GRAY );
|
||||||
fl_draw_box( b, X - dx, Y, lw + bw, lh, FL_GRAY );
|
else if ( align & FL_ALIGN_TOP )
|
||||||
else
|
|
||||||
fl_draw_box( b, X - dx - bx + ((W / 2) - (lw / 2)), Y + ((H / 2) - (lh / 2)), lw + bw, lh, FL_GRAY );
|
fl_draw_box( b, X - dx - bx + ((W / 2) - (lw / 2)), Y + ((H / 2) - (lh / 2)), lw + bw, lh, FL_GRAY );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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 */
|
/* make sure scrollbars are on top */
|
||||||
add( vscroll );
|
add( vscroll );
|
||||||
|
|
Loading…
Reference in New Issue