Give each sequence type its own default cursor.

Use a cross-hair cursor for control sequences.
This commit is contained in:
Jonathan Moore Liles 2008-05-02 06:42:50 -05:00
parent 013dbe26f9
commit 595100be8e
9 changed files with 22 additions and 1 deletions

View File

@ -71,6 +71,8 @@ public:
LOG_CREATE_FUNC( Audio_Sequence ); LOG_CREATE_FUNC( Audio_Sequence );
Fl_Cursor cursor ( void ) const { return FL_CURSOR_DEFAULT; }
Audio_Sequence ( Track *track ) : Sequence( 0, 0, 0, 0, track ) Audio_Sequence ( Track *track ) : Sequence( 0, 0, 0, 0, track )
{ {

View File

@ -247,6 +247,7 @@ Control_Sequence::handle ( int m )
{ {
case FL_ENTER: case FL_ENTER:
_highlighted = true; _highlighted = true;
fl_cursor( cursor() );
redraw(); redraw();
return 1; return 1;
case FL_LEAVE: case FL_LEAVE:

View File

@ -66,6 +66,8 @@ public:
Control_Sequence ( Track * ); Control_Sequence ( Track * );
~Control_Sequence ( ); ~Control_Sequence ( );
Fl_Cursor cursor ( void ) const { return FL_CURSOR_CROSS; }
// const char *class_name ( void ) { return "Control_Sequence"; } // const char *class_name ( void ) { return "Control_Sequence"; }
void draw ( void ); void draw ( void );

View File

@ -28,6 +28,8 @@ class Ruler_Sequence : public Sequence
public: public:
Fl_Cursor cursor ( void ) const { return FL_CURSOR_INSERT; }
Ruler_Sequence ( int X, int Y, int W, int H ) : Sequence ( X, Y, W, H ) Ruler_Sequence ( int X, int Y, int W, int H ) : Sequence ( X, Y, W, H )
{ {
// box( FL_UP_BOX ); // box( FL_UP_BOX );

View File

@ -257,6 +257,8 @@ Sequence::handle ( int m )
case FL_FOCUS: case FL_FOCUS:
case FL_UNFOCUS: case FL_UNFOCUS:
case FL_LEAVE: case FL_LEAVE:
fl_cursor( FL_CURSOR_DEFAULT );
return 1;
case FL_DND_DRAG: case FL_DND_DRAG:
return 1; return 1;
case FL_ENTER: case FL_ENTER:
@ -274,6 +276,10 @@ Sequence::handle ( int m )
else else
fl_cursor( (Fl_Cursor)1 ); fl_cursor( (Fl_Cursor)1 );
} }
else
fl_cursor( cursor() );
return 1;
case FL_DND_ENTER: case FL_DND_ENTER:
case FL_DND_LEAVE: case FL_DND_LEAVE:
case FL_DND_RELEASE: case FL_DND_RELEASE:

View File

@ -96,6 +96,9 @@ public:
virtual ~Sequence ( ); virtual ~Sequence ( );
/* override this to provide cursor */
virtual Fl_Cursor cursor ( void ) const = 0;
nframes_t x_to_offset ( int X ); nframes_t x_to_offset ( int X );
const char * name ( void ) const { return _name; } const char * name ( void ) const { return _name; }

View File

@ -151,7 +151,7 @@ Sequence_Widget::handle ( int m )
fl_cursor( FL_CURSOR_HAND ); fl_cursor( FL_CURSOR_HAND );
return 1; return 1;
case FL_LEAVE: case FL_LEAVE:
fl_cursor( FL_CURSOR_DEFAULT ); fl_cursor( _track->cursor() );
return 1; return 1;
case FL_PUSH: case FL_PUSH:
{ {
@ -203,6 +203,7 @@ Sequence_Widget::handle ( int m )
} }
else else
_r->offset = 0; _r->offset = 0;
} }
if ( X >= _track->x() + _track->w() || if ( X >= _track->x() + _track->w() ||

View File

@ -29,6 +29,8 @@ class Tempo_Sequence : public Sequence
public: public:
Fl_Cursor cursor ( void ) const { return FL_CURSOR_DEFAULT; }
Tempo_Sequence ( int X, int Y, int W, int H ) : Sequence ( X, Y, W, H ) Tempo_Sequence ( int X, int Y, int W, int H ) : Sequence ( X, Y, W, H )
{ {
// box( FL_DOWN_BOX ); // box( FL_DOWN_BOX );

View File

@ -30,6 +30,8 @@ class Time_Sequence : public Sequence
public: public:
Fl_Cursor cursor ( void ) const { return FL_CURSOR_DEFAULT; }
Time_Sequence ( int X, int Y, int W, int H ) : Sequence ( X, Y, W, H ) Time_Sequence ( int X, int Y, int W, int H ) : Sequence ( X, Y, W, H )
{ {
// box( FL_UP_BOX ); // box( FL_UP_BOX );