Reinstitute drag scrolling.
This commit is contained in:
parent
2902ea92dc
commit
825d16c5b7
30
Region.C
30
Region.C
|
@ -240,23 +240,6 @@ Region::handle ( int m )
|
||||||
ret = Track_Widget::handle( m );
|
ret = Track_Widget::handle( m );
|
||||||
return ret | 1;
|
return ret | 1;
|
||||||
|
|
||||||
/* if ( X >= timeline.scroll->x() + timeline.scroll->w() || */
|
|
||||||
/* X <= timeline.scroll->x() ) */
|
|
||||||
/* { */
|
|
||||||
/* /\* this drag needs to scroll *\/ */
|
|
||||||
|
|
||||||
/* long pos = timeline.scroll->xposition(); */
|
|
||||||
|
|
||||||
/* if ( X <= timeline.scroll->x() ) */
|
|
||||||
/* pos -= 100; */
|
|
||||||
/* else */
|
|
||||||
/* pos += 100; */
|
|
||||||
|
|
||||||
/* if ( pos < 0 ) */
|
|
||||||
/* pos = 0; */
|
|
||||||
|
|
||||||
/* timeline.scroll->position( pos, timeline.scroll->yposition() ); */
|
|
||||||
/* } */
|
|
||||||
|
|
||||||
// _offset = timeline.x_to_ts( x() );
|
// _offset = timeline.x_to_ts( x() );
|
||||||
|
|
||||||
|
@ -309,8 +292,6 @@ Region::draw ( int X, int Y, int W, int H )
|
||||||
|
|
||||||
int rx = x();
|
int rx = x();
|
||||||
|
|
||||||
// printf( "rx %d, rw %d\n", rx, rw );
|
|
||||||
|
|
||||||
fl_push_clip( rx, Y, rw, H );
|
fl_push_clip( rx, Y, rw, H );
|
||||||
|
|
||||||
/* dirty hack to keep the box from flipping to vertical at small sizes */
|
/* dirty hack to keep the box from flipping to vertical at small sizes */
|
||||||
|
@ -327,17 +308,10 @@ Region::draw ( int X, int Y, int W, int H )
|
||||||
fl_line( rx, Y, rx, Y + H );
|
fl_line( rx, Y, rx, Y + H );
|
||||||
fl_line( rx + rw - 1, Y, rx + rw - 1, Y + H );
|
fl_line( rx + rw - 1, Y, rx + rw - 1, Y + H );
|
||||||
|
|
||||||
|
draw_label( _clip->name(), (Fl_Align)(FL_ALIGN_LEFT | FL_ALIGN_BOTTOM /*| FL_ALIGN_CLIP*/ | FL_ALIGN_INSIDE) );
|
||||||
|
|
||||||
fl_pop_clip();
|
fl_pop_clip();
|
||||||
|
|
||||||
fl_font( FL_HELVETICA, 14 );
|
|
||||||
fl_color( FL_BLACK );
|
|
||||||
|
|
||||||
draw_label( _clip->name(), (Fl_Align)(FL_ALIGN_LEFT | FL_ALIGN_BOTTOM | FL_ALIGN_CLIP | FL_ALIGN_INSIDE) );
|
|
||||||
|
|
||||||
/* fl_color( FL_RED ); */
|
|
||||||
/* fl_line( x(), y(), x(), y() + h() ); */
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
77
Region.H
77
Region.H
|
@ -168,10 +168,10 @@ public:
|
||||||
|
|
||||||
if ( align & FL_ALIGN_INSIDE )
|
if ( align & FL_ALIGN_INSIDE )
|
||||||
{
|
{
|
||||||
X += Fl::box_dx( box() );
|
X += Fl::box_dx( box() );
|
||||||
Y += Fl::box_dy( box() );
|
Y += Fl::box_dy( box() );
|
||||||
W -= Fl::box_dw( box() );
|
W -= Fl::box_dw( box() );
|
||||||
H -= Fl::box_dh( box() );
|
H -= Fl::box_dh( box() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( align & FL_ALIGN_CLIP ) fl_push_clip( X, Y, W, H );
|
if ( align & FL_ALIGN_CLIP ) fl_push_clip( X, Y, W, H );
|
||||||
|
@ -223,6 +223,33 @@ public:
|
||||||
_track->redraw();
|
_track->redraw();
|
||||||
fl_cursor( FL_CURSOR_MOVE );
|
fl_cursor( FL_CURSOR_MOVE );
|
||||||
|
|
||||||
|
|
||||||
|
if ( X >= _track->x() + _track->w() ||
|
||||||
|
X <= _track->x() )
|
||||||
|
{
|
||||||
|
/* this drag needs to scroll */
|
||||||
|
|
||||||
|
nframes_t pos = timeline.xoffset;
|
||||||
|
|
||||||
|
nframes_t d = timeline.x_to_ts( 100 );
|
||||||
|
|
||||||
|
if ( X <= _track->x() )
|
||||||
|
{
|
||||||
|
|
||||||
|
if ( pos > d )
|
||||||
|
pos -= d;
|
||||||
|
else
|
||||||
|
pos = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
pos += d;
|
||||||
|
|
||||||
|
timeline.xoffset = pos;
|
||||||
|
|
||||||
|
timeline.tracks->redraw();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -291,33 +318,33 @@ public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class Region : public Track_Widget
|
class Region : public Track_Widget
|
||||||
{
|
{
|
||||||
|
|
||||||
Clip *_clip; /* clip this region represents */
|
Clip *_clip; /* clip this region represents */
|
||||||
|
|
||||||
float _scale; /* amplitude adjustment */
|
float _scale; /* amplitude adjustment */
|
||||||
|
|
||||||
static Fl_Boxtype _box;
|
static Fl_Boxtype _box;
|
||||||
static Fl_Color _selection_color;
|
static Fl_Color _selection_color;
|
||||||
static Fl_Color selection_color ( void ) { return _selection_color; }
|
static Fl_Color selection_color ( void ) { return _selection_color; }
|
||||||
static void selection_color ( Fl_Color v ) { _selection_color = v; }
|
static void selection_color ( Fl_Color v ) { _selection_color = v; }
|
||||||
|
|
||||||
enum trim_e { NO, LEFT, RIGHT };
|
enum trim_e { NO, LEFT, RIGHT };
|
||||||
void trim ( enum trim_e t, int X );
|
void trim ( enum trim_e t, int X );
|
||||||
void init ( void );
|
void init ( void );
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Fl_Boxtype box ( void ) const { return Region::_box; }
|
Fl_Boxtype box ( void ) const { return Region::_box; }
|
||||||
|
|
||||||
Region ( const Region & rhs );
|
Region ( const Region & rhs );
|
||||||
Region ( Clip *c );
|
Region ( Clip *c );
|
||||||
|
|
||||||
int handle ( int m );
|
int handle ( int m );
|
||||||
void draw_box( int X, int Y, int W, int H );
|
void draw_box( int X, int Y, int W, int H );
|
||||||
void draw ( int X, int Y, int W, int H );
|
void draw ( int X, int Y, int W, int H );
|
||||||
void resize ( void );
|
void resize ( void );
|
||||||
|
|
||||||
void normalize ( void );
|
void normalize ( void );
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue