| @@ -17,6 +17,8 @@ | |||||
| /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | ||||
| /*******************************************************************************/ | /*******************************************************************************/ | ||||
| #include <FL/fl_ask.H> | |||||
| #include "Control_Sequence.H" | #include "Control_Sequence.H" | ||||
| #include "Track.H" | #include "Track.H" | ||||
| @@ -259,12 +261,46 @@ Control_Sequence::handle ( int m ) | |||||
| { | { | ||||
| case FL_PUSH: | case FL_PUSH: | ||||
| { | { | ||||
| Logger log( this ); | |||||
| if ( Fl::event_button1() ) | if ( Fl::event_button1() ) | ||||
| { | { | ||||
| Control_Point *r = new Control_Point( this, timeline->xoffset + timeline->x_to_ts( Fl::event_x() - x() ), (float)(Fl::event_y() - y()) / h() ); | Control_Point *r = new Control_Point( this, timeline->xoffset + timeline->x_to_ts( Fl::event_x() - x() ), (float)(Fl::event_y() - y()) / h() ); | ||||
| add( r ); | add( r ); | ||||
| } | } | ||||
| else if ( Fl::event_button3() && ! ( Fl::event_state() & ( FL_ALT | FL_SHIFT | FL_CTRL ) ) ) | |||||
| { | |||||
| Fl_Menu_Item menu[] = | |||||
| { | |||||
| { "Rename" }, | |||||
| { "Remove" }, | |||||
| { 0 } | |||||
| }; | |||||
| const Fl_Menu_Item *r = menu->popup( Fl::event_x(), Fl::event_y(), "Control Sequence" ); | |||||
| if ( r ) | |||||
| { | |||||
| if ( r == &menu[ 0 ] ) | |||||
| { | |||||
| const char *s = fl_input( "Input new name for control sequence:", name() ); | |||||
| if ( s ) | |||||
| name( s ); | |||||
| redraw(); | |||||
| } | |||||
| else if ( r == &menu[ 1 ] ) | |||||
| { | |||||
| /* TODO: remove */ | |||||
| } | |||||
| } | |||||
| return 1; | |||||
| } | |||||
| return 1; | return 1; | ||||
| } | } | ||||
| @@ -424,6 +424,7 @@ Track::handle ( int m ) | |||||
| { "Quad", 0, 0, 0, FL_MENU_RADIO | ( c == 4 ? FL_MENU_VALUE : 0 ) }, | { "Quad", 0, 0, 0, FL_MENU_RADIO | ( c == 4 ? FL_MENU_VALUE : 0 ) }, | ||||
| { "...", 0, 0, 0, FL_MENU_RADIO | ( c == 3 || c > 4 ? FL_MENU_VALUE : 0 ) }, | { "...", 0, 0, 0, FL_MENU_RADIO | ( c == 3 || c > 4 ? FL_MENU_VALUE : 0 ) }, | ||||
| { 0 }, | { 0 }, | ||||
| { "Add Control" }, | |||||
| { "Color" }, | { "Color" }, | ||||
| { "Remove", 0, 0, 0, transport->rolling ? FL_MENU_INACTIVE : 0 }, | { "Remove", 0, 0, 0, transport->rolling ? FL_MENU_INACTIVE : 0 }, | ||||
| { 0 }, | { 0 }, | ||||
| @@ -458,6 +459,10 @@ Track::handle ( int m ) | |||||
| } | } | ||||
| } | } | ||||
| else if ( r == &menu[ 6 ] ) | else if ( r == &menu[ 6 ] ) | ||||
| { | |||||
| new Control_Sequence( this ); | |||||
| } | |||||
| else if ( r == &menu[ 7 ] ) | |||||
| { | { | ||||
| unsigned char r, g, b; | unsigned char r, g, b; | ||||
| @@ -471,7 +476,7 @@ Track::handle ( int m ) | |||||
| // color( fl_show_colormap( color() ) ); | // color( fl_show_colormap( color() ) ); | ||||
| redraw(); | redraw(); | ||||
| } | } | ||||
| else if ( r == &menu[ 7 ] ) | |||||
| else if ( r == &menu[ 8 ] ) | |||||
| { | { | ||||
| int r = fl_choice( "Are you certain you want to remove track \"%s\"?", "Cancel", NULL, "Remove", name() ); | int r = fl_choice( "Are you certain you want to remove track \"%s\"?", "Cancel", NULL, "Remove", name() ); | ||||