Don't trash memory with timeline menu stuff.
This commit is contained in:
parent
9b38190211
commit
d2afffbb7c
|
@ -111,13 +111,6 @@ Fl::run();} {}
|
|||
|
||||
make_window();
|
||||
|
||||
{
|
||||
Fl_Menu_Item *tl = (Fl_Menu_Item*)menubar->find_item( "&Timeline" );
|
||||
|
||||
tl->user_data( timeline->menu );
|
||||
tl->flags = FL_SUBMENU_POINTER;
|
||||
}
|
||||
|
||||
Fl::visible_focus( 0 );
|
||||
|
||||
Fl::get_system_colors();
|
||||
|
@ -156,7 +149,11 @@ menubar->picked( menubar->find_item( "&Options/&Project/&Timeline/Capture Format
|
|||
char *path;
|
||||
asprintf( &path, "%s/options", user_config_dir );
|
||||
((Fl_Menu_Settings*)menubar)->load( menubar->find_item( "&Options/&Global" ), path );
|
||||
free( path );} {}
|
||||
free( path );
|
||||
|
||||
|
||||
menubar->add( "&Timeline", 0, 0, const_cast< Fl_Menu_Item *>( timeline->menu->menu() ), FL_SUBMENU_POINTER );} {selected
|
||||
}
|
||||
}
|
||||
Function {make_window()} {open
|
||||
} {
|
||||
|
@ -283,7 +280,7 @@ Loggable::compact();}
|
|||
}
|
||||
MenuItem {} {
|
||||
label {&Timeline}
|
||||
xywh {5 5 40 25}
|
||||
xywh {0 0 40 25}
|
||||
}
|
||||
Submenu {} {
|
||||
label {&View} open
|
||||
|
@ -665,8 +662,7 @@ else
|
|||
}
|
||||
|
||||
m->redraw();
|
||||
project_name->redraw();} {selected
|
||||
}
|
||||
project_name->redraw();} {}
|
||||
}
|
||||
Function {update_progress( Fl_Progress *p, char *s, float v )} {open private return_type {static void}
|
||||
} {
|
||||
|
|
|
@ -25,6 +25,9 @@
|
|||
#include <FL/fl_draw.H>
|
||||
#include <FL/Fl_Scrollbar.H>
|
||||
|
||||
|
||||
#include <FL/Fl_Menu_Button.H>
|
||||
|
||||
#include "Timeline.H"
|
||||
#include "Tempo_Sequence.H"
|
||||
#include "Time_Sequence.H"
|
||||
|
@ -155,7 +158,6 @@ Timeline::menu_cb ( Fl_Widget *w )
|
|||
|
||||
const char *picked = m->mvalue()->label();
|
||||
|
||||
|
||||
/* m->item_pathname( picked, sizeof( picked ) ); */
|
||||
|
||||
DMESSAGE( "%s", picked );
|
||||
|
@ -232,6 +234,7 @@ Timeline::menu_cb ( Fl_Widget *w )
|
|||
WARNING( "programming error: Unknown menu item" );
|
||||
}
|
||||
|
||||
|
||||
Timeline::Timeline ( int X, int Y, int W, int H, const char* L ) : Fl_Overlay_Window( X, Y, W, H, L )
|
||||
{
|
||||
_sample_rate = 0;
|
||||
|
@ -246,7 +249,7 @@ Timeline::Timeline ( int X, int Y, int W, int H, const char* L ) : Fl_Overlay_Wi
|
|||
|
||||
p1 = p2 = 0;
|
||||
|
||||
menu = new Fl_Menu;
|
||||
menu = new Fl_Menu_Button( 0, 0, 0, 0, "Timeline" );
|
||||
|
||||
/* menu->add( "Add Track", 0, 0, 0 ); */
|
||||
|
||||
|
@ -1026,20 +1029,11 @@ Timeline::handle ( int m )
|
|||
}
|
||||
else if ( Fl::test_shortcut( FL_BUTTON3 ) && ! Fl::event_shift() )
|
||||
{
|
||||
|
||||
/* Fl_Menu_Item menu[] = */
|
||||
/* { */
|
||||
/* { "Add Track", 0, 0, 0, FL_SUBMENU }, */
|
||||
/* { "Audio", 0, 0, 0 }, */
|
||||
/* { 0 }, */
|
||||
/* { 0 }, */
|
||||
/* }; */
|
||||
|
||||
const Fl_Menu_Item *r = menu->popup( X, Y, "Timeline" );
|
||||
const Fl_Menu_Item *r = menu->menu()->popup( X, Y, "Timeline" );
|
||||
if ( r )
|
||||
{
|
||||
((Fl_Menu_*)(menu))->value( r );
|
||||
r->do_callback( (Fl_Widget*)menu );
|
||||
menu->value( r );
|
||||
r->do_callback( static_cast<Fl_Widget*>(menu) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ class Fl_Pack;
|
|||
class Fl_Scrollbar;
|
||||
class Fl_Widget;
|
||||
|
||||
#include <FL/Fl_Menu.H>
|
||||
class Fl_Menu_Button;
|
||||
|
||||
class Timeline;
|
||||
extern Timeline *timeline;
|
||||
|
@ -130,7 +130,7 @@ public:
|
|||
Time_Sequence *time_track;
|
||||
Annotation_Sequence *ruler_track;
|
||||
|
||||
Fl_Menu *menu;
|
||||
Fl_Menu_Button *menu;
|
||||
|
||||
nframes_t xoffset;
|
||||
|
||||
|
|
Loading…
Reference in New Issue