Allow renaming of control sequences.

This commit is contained in:
Jonathan Moore Liles 2008-04-28 13:17:46 -05:00
parent 95f8a8905a
commit 11f420a1a4
2 changed files with 42 additions and 1 deletions

View File

@ -17,6 +17,8 @@
/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*******************************************************************************/
#include <FL/fl_ask.H>
#include "Control_Sequence.H"
#include "Track.H"
@ -259,12 +261,46 @@ Control_Sequence::handle ( int m )
{
case FL_PUSH:
{
Logger log( this );
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() );
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;
}

View File

@ -424,6 +424,7 @@ Track::handle ( int m )
{ "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 },
{ "Add Control" },
{ "Color" },
{ "Remove", 0, 0, 0, transport->rolling ? FL_MENU_INACTIVE : 0 },
{ 0 },
@ -458,6 +459,10 @@ Track::handle ( int m )
}
}
else if ( r == &menu[ 6 ] )
{
new Control_Sequence( this );
}
else if ( r == &menu[ 7 ] )
{
unsigned char r, g, b;
@ -471,7 +476,7 @@ Track::handle ( int m )
// color( fl_show_colormap( color() ) );
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() );