本文整理汇总了C++中Fl_Menu_Button::callback方法的典型用法代码示例。如果您正苦于以下问题:C++ Fl_Menu_Button::callback方法的具体用法?C++ Fl_Menu_Button::callback怎么用?C++ Fl_Menu_Button::callback使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fl_Menu_Button
的用法示例。
在下文中一共展示了Fl_Menu_Button::callback方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: size
/** build the context menu */
Fl_Menu_Button &
Track::menu ( void ) const
{
int c = output.size();
int s = size();
_menu.clear();
_menu.add( "Takes/Show all takes", 0, 0, 0, FL_MENU_TOGGLE | ( show_all_takes() ? FL_MENU_VALUE : 0 ) );
_menu.add( "Takes/New", 0, 0, 0 );
if ( takes->children() )
{
_menu.add( "Takes/Remove", 0, 0, 0 );
_menu.add( "Takes/Remove others", 0, 0, 0, FL_MENU_DIVIDER );
for ( int i = 0; i < takes->children(); ++i )
{
Sequence *s = (Sequence *)takes->child( i );
char n[256];
snprintf( n, sizeof(n), "Takes/%s", s->name() );
_menu.add( n, 0, 0, s);
}
}
_menu.add( "Type/Mono", 0, 0, 0, FL_MENU_RADIO | ( c == 1 ? FL_MENU_VALUE : 0 ) );
_menu.add( "Type/Stereo", 0, 0, 0, FL_MENU_RADIO | ( c == 2 ? FL_MENU_VALUE : 0 ));
_menu.add( "Type/Quad", 0, 0, 0, FL_MENU_RADIO | ( c == 4 ? FL_MENU_VALUE : 0 ) );
_menu.add( "Type/...", 0, 0, 0, FL_MENU_RADIO | ( c == 3 || c > 4 ? FL_MENU_VALUE : 0 ) );
_menu.add( "Overlay controls", 0, 0, 0, FL_MENU_TOGGLE | ( overlay_controls() ? FL_MENU_VALUE : 0 ) );
_menu.add( "Add Control", 0, 0, 0 );
_menu.add( "Add Annotation", 0, 0, 0 );
_menu.add( "Color", 0, 0, 0 );
_menu.add( "Rename", FL_CTRL + 'n', 0, 0 );
_menu.add( "Size/Small", FL_ALT + '1', 0, 0, FL_MENU_RADIO | ( s == 0 ? FL_MENU_VALUE : 0 ) );
_menu.add( "Size/Medium", FL_ALT + '2', 0, 0, FL_MENU_RADIO | ( s == 1 ? FL_MENU_VALUE : 0 ) );
_menu.add( "Size/Large", FL_ALT + '3', 0, 0, FL_MENU_RADIO | ( s == 2 ? FL_MENU_VALUE : 0 ) );
_menu.add( "Size/Huge", FL_ALT + '4', 0, 0, FL_MENU_RADIO | ( s == 3 ? FL_MENU_VALUE : 0 ) );
_menu.add( "Flags/Record", FL_CTRL + 'r', 0, 0, FL_MENU_TOGGLE | ( armed() ? FL_MENU_VALUE : 0 ) );
_menu.add( "Flags/Mute", FL_CTRL + 'm', 0, 0, FL_MENU_TOGGLE | ( mute() ? FL_MENU_VALUE : 0 ) );
_menu.add( "Flags/Solo", FL_CTRL + 's', 0, 0, FL_MENU_TOGGLE | ( solo() ? FL_MENU_VALUE : 0 ) );
_menu.add( "Move Up", FL_SHIFT + '1', 0, 0 );
_menu.add( "Move Down", FL_SHIFT + '2', 0, 0 );
_menu.add( "Remove", 0, 0, 0 ); // transport->rolling ? FL_MENU_INACTIVE : 0 );
_menu.callback( &Track::menu_cb, (void*)this );
return _menu;
}
示例2: m
/** build the context menu */
Fl_Menu_Button &
Module::menu ( void ) const
{
static Fl_Menu_Button m( 0, 0, 0, 0, "Module" );
static Fl_Menu_Button *insert_menu = NULL;
if ( ! insert_menu )
{
insert_menu = new Fl_Menu_Button( 0, 0, 0, 0 );
insert_menu->add( "Gain", 0, 0 );
insert_menu->add( "Meter", 0, 0 );
insert_menu->add( "Mono Pan", 0, 0 );
insert_menu->add( "Aux", 0, 0 );
insert_menu->add( "Spatializer", 0, 0 );
insert_menu->add( "Plugin", 0, 0 );
insert_menu->callback( &Module::insert_menu_cb, (void*)this );
}
m.clear();
m.add( "Insert", 0, &Module::menu_cb, (void*)this, 0);
m.add( "Insert", 0, &Module::menu_cb, const_cast< Fl_Menu_Item *>( insert_menu->menu() ), FL_SUBMENU_POINTER );
m.add( "Edit Parameters", ' ', &Module::menu_cb, (void*)this, 0 );
m.add( "Show Analysis", 's', &Module::menu_cb, (void*)this, 0);
m.add( "Bypass", 'b', &Module::menu_cb, (void*)this, FL_MENU_TOGGLE | ( bypass() ? FL_MENU_VALUE : 0 ) );
m.add( "Cut", FL_CTRL + 'x', &Module::menu_cb, (void*)this, is_default() ? FL_MENU_INACTIVE : 0 );
m.add( "Copy", FL_CTRL + 'c', &Module::menu_cb, (void*)this, is_default() ? FL_MENU_INACTIVE : 0 );
m.add( "Paste", FL_CTRL + 'v', &Module::menu_cb, (void*)this, _copied_module_empty ? 0 : FL_MENU_INACTIVE );
m.add( "Remove", FL_Delete, &Module::menu_cb, (void*)this );
// menu_set_callback( menu, &Module::menu_cb, (void*)this );
m.callback( &Module::insert_menu_cb, (void*)this );
return m;
}
示例3: m
/** build the context menu for this control */
Fl_Menu_Button &
Controller_Module::menu ( void )
{
static Fl_Menu_Button m( 0, 0, 0, 0, "Controller" );
m.clear();
if ( mode() == GUI )
{
add_osc_peers_to_menu( &m, "Connect To" );
add_osc_connections_to_menu( &m, "Disconnect From" );
}
m.add( "Mode/GUI + OSC", 0, 0, 0, FL_MENU_RADIO | ( mode() == GUI ? FL_MENU_VALUE : 0 ));
m.add( "Mode/Control Voltage (JACK)", 0, 0, 0, FL_MENU_RADIO | ( mode() == CV ? FL_MENU_VALUE : 0 ));
m.add( "Remove", 0, 0, 0, is_default() ? FL_MENU_INACTIVE : 0 );
// menu_set_callback( m.items(), &Controller_Module::menu_cb, (void*)this );
m.callback( &Controller_Module::menu_cb, (void*)this );
// m.copy( items, (void*)this );
return m;
}
示例4: sprintf
Fl_Scopes_Manager::Fl_Scopes_Manager(int x, int y, int width, int height, Fl_MDI_Viewport *s, const char *name)
{
Fl::lock();
s->begin();
Fl_MDI_Window *w = SWin = new Fl_MDI_Window(0, 0, width, height, name);
w->user_data((void *)this);
w->resizable(w->view());
w->titlebar()->close_button()->hide();
w->view()->begin();
Scopes_Tabs = new Fl_Tabs*[Num_Scopes];
Scope_Show = new Fl_Check_Button*[Num_Scopes];
Scope_Pause = new Fl_Button*[Num_Scopes];
Scope_OneShot = new Fl_Check_Button*[Num_Scopes];
Scope_Options = new Fl_Menu_Button*[Num_Scopes];
Grid_Color = new Fl_Button*[Num_Scopes];
Bg_Color = new Fl_Button*[Num_Scopes];
Sec_Div = new Fl_Input_Browser*[Num_Scopes];
Save_Type = new Fl_Check_Button*[Num_Scopes];
Save_Points = new Fl_Int_Input*[Num_Scopes];
Save_Time = new Fl_Float_Input*[Num_Scopes];
Save_File = new Fl_Input*[Num_Scopes];
Save = new Fl_Light_Button*[Num_Scopes];
Save_Flag = new int[Num_Scopes];
Save_File_Pointer = new FILE*[Num_Scopes];
Trace_Page = new Fl_Group**[Num_Scopes];
Trace_Show = new Fl_Check_Button**[Num_Scopes];
Units_Div = new Fl_Input_Browser**[Num_Scopes];
Trace_Color = new Fl_Button**[Num_Scopes];
Trace_Pos = new Fl_Dial**[Num_Scopes];
Trace_Width = new Fl_Dial**[Num_Scopes];
Trigger_Mode = new Fl_Choice*[Num_Scopes];
Trace_Options = new Fl_Menu_Button**[Num_Scopes];
Scope_Windows = new Fl_Scope_Window*[Num_Scopes];
for (int i = 0; i < Num_Scopes; i++) {
Save_Flag[i] = false;
{ Fl_Tabs *o = Scopes_Tabs[i] = new Fl_Tabs(160, 5, width-165, height-40);
o->new_page("General");
{ Fl_Check_Button *o = Scope_Show[i] = new Fl_Check_Button(10, 25, 100, 20, "Show/Hide");
o->callback((Fl_Callback *)show_scope, (void *)i);
}
{ Fl_Button *o = Scope_Pause[i] = new Fl_Button(10, 75, 90, 25, "Trigger");
o->value(0);
o->deactivate();
o->when(FL_WHEN_CHANGED);
o->callback((Fl_Callback *)pause_scope, (void *)i);
}
{ Fl_Check_Button *o = Scope_OneShot[i] = new Fl_Check_Button(10, 50, 100, 20, "OneShot/Run");
o->deactivate();
o->callback((Fl_Callback *)oneshot_scope, (void *)i);
}
{ Fl_Menu_Button *o = Scope_Options[i] = new Fl_Menu_Button(10, 105, 90, 25, "Options");
o->menu(Scope_Opts);
o->when(FL_WHEN_ENTER_KEY);
o->child(0)->set_value();
o->callback((Fl_Callback *)enter_options, (void *)i);
}
{ Fl_Button *o = Grid_Color[i] = new Fl_Button(10, 135, 90, 25, "Grid Color");
o->callback((Fl_Callback *)select_grid_color, (void *)i);
}
{ Fl_Button *o = Bg_Color[i] = new Fl_Button(10, 165, 90, 25, "Bg Color");
o->callback((Fl_Callback *)select_bg_color, (void *)i);
}
{ Fl_Input_Browser *o = Sec_Div[i] = new Fl_Input_Browser(200, 25, 60, 20, "Sec/Div: ");
o->add("0.001|0.005|0.01|0.05|0.1|0.5|1");
o->align(FL_ALIGN_LEFT);
o->value("0.1");
o->when(FL_WHEN_ENTER_KEY);
o->callback((Fl_Callback *)enter_secdiv, (void *)i);
}
{ Fl_Check_Button *o = Save_Type[i] = new Fl_Check_Button(140, 50, 100, 20, "Points/Time");
o->value(1);
o->callback((Fl_Callback *)select_save, (void *)i);
}
{ Fl_Int_Input *o = Save_Points[i] = new Fl_Int_Input(200, 75, 60, 20, "N Points: ");
o->align(FL_ALIGN_LEFT);
o->value("1000");
}
{ Fl_Float_Input *o = Save_Time[i] = new Fl_Float_Input(200, 105, 60, 20, "Time [s]: ");
o->align(FL_ALIGN_LEFT);
o->value("1.0");
o->deactivate();
}
{ Fl_Input *o = Save_File[i] = new Fl_Input(200, 135, 100, 20, "Filename:");
char buf[100];
o->align(FL_ALIGN_LEFT);
sprintf(buf, "%s", Scopes[i].name);
o->value(buf);
}
{ Fl_Light_Button *o = Save[i] = new Fl_Light_Button(140, 165, 90, 25, "Save");
o->selection_color(FL_BLACK);
o->callback((Fl_Callback *)enable_saving, (void *)i);
}
//.........这里部分代码省略.........