Don't try to be so fancy about drawing measure lines.
This commit is contained in:
parent
a6e65c8159
commit
c81d48c613
2
Region.C
2
Region.C
|
@ -464,7 +464,7 @@ Region::draw ( int X, int Y, int W, int H )
|
||||||
_scale, selected() ? fl_invert_color( _color ) : _color );
|
_scale, selected() ? fl_invert_color( _color ) : _color );
|
||||||
|
|
||||||
|
|
||||||
timeline->draw_measure_lines( rx, Y, rw, H, _box_color );
|
// timeline->draw_measure_lines( rx, Y, rw, H, _box_color );
|
||||||
|
|
||||||
fl_color( FL_BLACK );
|
fl_color( FL_BLACK );
|
||||||
fl_line( rx, Y, rx, Y + H );
|
fl_line( rx, Y, rx, Y + H );
|
||||||
|
|
58
Timeline.C
58
Timeline.C
|
@ -25,6 +25,9 @@
|
||||||
#include "Control_Track.H"
|
#include "Control_Track.H"
|
||||||
#include <FL/Fl_Scrollbar.H>
|
#include <FL/Fl_Scrollbar.H>
|
||||||
|
|
||||||
|
#include <FL/Fl_Image.H>
|
||||||
|
#include <FL/Fl_RGB_Image.H> // needed for alpha blending
|
||||||
|
|
||||||
#include "Track_Header.H"
|
#include "Track_Header.H"
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -353,6 +356,34 @@ Timeline::draw ( void )
|
||||||
draw_child( *vscroll );
|
draw_child( *vscroll );
|
||||||
|
|
||||||
redraw_overlay();
|
redraw_overlay();
|
||||||
|
|
||||||
|
|
||||||
|
Rectangle &r = _selection;
|
||||||
|
|
||||||
|
/* unsigned char *data = fl_read_image( NULL, r.x, r.y, r.w, r.h, 0 ); */
|
||||||
|
|
||||||
|
/* Fl_RGB_Image bi( data, r.w, r.h, 3 ); */
|
||||||
|
|
||||||
|
/* bi.color_average( FL_BLACK, 0.50f ); */
|
||||||
|
|
||||||
|
/* bi.draw( r.x, r.y ); */
|
||||||
|
|
||||||
|
/* delete[] data; */
|
||||||
|
|
||||||
|
|
||||||
|
if ( r.w && r.h )
|
||||||
|
{
|
||||||
|
const unsigned char data[] = { 0, 127, 0, 96,
|
||||||
|
0, 96, 0, 127 };
|
||||||
|
Fl_RGB_Image bi( data, 2, 2, 2 );
|
||||||
|
|
||||||
|
Fl_Image *bi2 = bi.copy( r.w, r.h );
|
||||||
|
|
||||||
|
bi2->draw( r.x, r.y );
|
||||||
|
|
||||||
|
delete bi2;
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -393,11 +424,14 @@ Timeline::draw ( void )
|
||||||
_old_yposition = _yposition;
|
_old_yposition = _yposition;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Timeline::draw_overlay ( void )
|
Timeline::draw_overlay ( void )
|
||||||
{
|
{
|
||||||
|
if ( ! ( _selection.w && _selection.h ) )
|
||||||
|
return;
|
||||||
|
|
||||||
fl_push_clip( tracks->x() + Track_Header::width(), rulers->y() + rulers->h(), tracks->w() - Track_Header::width(), h() - rulers->h() - hscroll->h() );
|
fl_push_clip( tracks->x() + Track_Header::width(), rulers->y() + rulers->h(), tracks->w() - Track_Header::width(), h() - rulers->h() - hscroll->h() );
|
||||||
|
|
||||||
|
@ -421,8 +455,28 @@ Timeline::draw_overlay ( void )
|
||||||
fl_line_style( FL_SOLID, 0 );
|
fl_line_style( FL_SOLID, 0 );
|
||||||
|
|
||||||
|
|
||||||
fl_pop_clip();
|
/* const unsigned char data[] = { 127, 127, 127, 96, */
|
||||||
|
/* 127, 96, 127, 40 }; */
|
||||||
|
/* Fl_RGB_Image bi( data, 2, 2, 2 ); */
|
||||||
|
|
||||||
|
/* Fl_Image *bi2 = bi.copy( r.w, r.h ); */
|
||||||
|
|
||||||
|
/* bi2->draw( r.x, r.y ); */
|
||||||
|
|
||||||
|
/* delete bi2; */
|
||||||
|
|
||||||
|
|
||||||
|
/* unsigned char *data = fl_read_image( NULL, r.x, r.y, r.w, r.h, 0 ); */
|
||||||
|
|
||||||
|
/* Fl_RGB_Image bi( data, r.w, r.h, 3 ); */
|
||||||
|
|
||||||
|
/* bi.color_average( FL_BLACK, 0.50f ); */
|
||||||
|
|
||||||
|
/* bi.draw( r.x, r.y ); */
|
||||||
|
|
||||||
|
/* delete[] data; */
|
||||||
|
|
||||||
|
fl_pop_clip();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -500,6 +554,8 @@ Timeline::handle ( int m )
|
||||||
|
|
||||||
_selection.w = abs( ox );
|
_selection.w = abs( ox );
|
||||||
_selection.h = abs( oy );
|
_selection.h = abs( oy );
|
||||||
|
|
||||||
|
redraw();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case FL_RELEASE:
|
case FL_RELEASE:
|
||||||
|
|
3
Track.C
3
Track.C
|
@ -60,8 +60,6 @@ Track::draw ( void )
|
||||||
|
|
||||||
Fl_Group::draw();
|
Fl_Group::draw();
|
||||||
|
|
||||||
timeline->draw_measure_lines( x(), y(), w(), h(), color() );
|
|
||||||
|
|
||||||
int X, Y, W, H;
|
int X, Y, W, H;
|
||||||
|
|
||||||
fl_clip_box( x(), y(), w(), h(), X, Y, W, H );
|
fl_clip_box( x(), y(), w(), h(), X, Y, W, H );
|
||||||
|
@ -110,6 +108,7 @@ Track::draw ( void )
|
||||||
for ( list <Track_Widget *>::const_iterator r = _widgets.begin(); r != _widgets.end(); r++ )
|
for ( list <Track_Widget *>::const_iterator r = _widgets.begin(); r != _widgets.end(); r++ )
|
||||||
(*r)->draw( X, Y, W, H );
|
(*r)->draw( X, Y, W, H );
|
||||||
|
|
||||||
|
timeline->draw_measure_lines( x(), y(), w(), h(), color() );
|
||||||
|
|
||||||
fl_pop_clip();
|
fl_pop_clip();
|
||||||
}
|
}
|
||||||
|
|
2
main.C
2
main.C
|
@ -63,6 +63,8 @@ main ( int argc, char **argv )
|
||||||
{
|
{
|
||||||
Fl_Window *main_window = new Fl_Window( 0, 0, 1024, 768 );
|
Fl_Window *main_window = new Fl_Window( 0, 0, 1024, 768 );
|
||||||
|
|
||||||
|
Fl::visual( FL_RGB8 );
|
||||||
|
|
||||||
Fl::get_system_colors();
|
Fl::get_system_colors();
|
||||||
Fl::scheme( "plastic" );
|
Fl::scheme( "plastic" );
|
||||||
// Fl::scheme( "gtk+" );
|
// Fl::scheme( "gtk+" );
|
||||||
|
|
Loading…
Reference in New Issue