本文整理汇总了C++中MenuBar::append方法的典型用法代码示例。如果您正苦于以下问题:C++ MenuBar::append方法的具体用法?C++ MenuBar::append怎么用?C++ MenuBar::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MenuBar
的用法示例。
在下文中一共展示了MenuBar::append方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init_menus
void DinoGUI::init_menus(MenuBar& mbar) {
MenuItem* file_item = manage(new MenuItem("_File", true));
Menu* file_menu = manage(new Menu);
file_item->set_submenu(*file_menu);
mbar.append(*file_item);
create_menu_item(*file_menu, "Clear all", "file_clear_all",
Stock::CLEAR, &DinoGUI::slot_file_clear_all);
file_menu->append(*manage(new SeparatorMenuItem));
create_menu_item(*file_menu, Stock::QUIT, "file_quit",
&DinoGUI::slot_file_quit);
MenuItem* edit_item = manage(new MenuItem("_Edit", true));
Menu* edit_menu = manage(new Menu);
edit_item->set_submenu(*edit_menu);
mbar.append(*edit_item);
create_menu_item(*edit_menu, Stock::UNDO, "edit_undo",
&DinoGUI::slot_edit_undo);
m_proxy.signal_stack_changed().
connect(compose(mem_fun(*this, &DinoGUI::update_undo),
mem_fun(m_proxy, &CommandProxy::get_next_undo_name)));
update_undo(m_proxy.get_next_undo_name());
edit_menu->append(*manage(new SeparatorMenuItem));
create_menu_item(*edit_menu, Stock::CUT, "edit_cut",
&DinoGUI::slot_edit_cut);
create_menu_item(*edit_menu, Stock::COPY, "edit_copy",
&DinoGUI::slot_edit_copy);
create_menu_item(*edit_menu, Stock::PASTE, "edit_paste",
&DinoGUI::slot_edit_paste);
create_menu_item(*edit_menu, Stock::DELETE, "edit_delete",
&DinoGUI::slot_edit_delete);
edit_menu->append(*manage(new SeparatorMenuItem));
create_menu_item(*edit_menu, "Select all", "edit_select_all",
&DinoGUI::slot_edit_select_all);
MenuItem* transport_item = manage(new MenuItem("_Transport", true));
Menu* transport_menu = manage(new Menu);
transport_item->set_submenu(*transport_menu);
mbar.append(*transport_item);
create_menu_item(*transport_menu, Stock::MEDIA_PLAY, "transport_play",
&DinoGUI::slot_transport_play);
create_menu_item(*transport_menu, "_Stop", "transport_stop",
Stock::MEDIA_PAUSE, &DinoGUI::slot_transport_stop);
create_menu_item(*transport_menu, "_Go to start", "transport_go_to_start",
Stock::MEDIA_PREVIOUS, &DinoGUI::slot_transport_go_to_start);
MenuItem* plugins_item = manage(new MenuItem("_Plugins", true));
Menu* plugins_menu = manage(new Menu);
plugins_item->set_submenu(*plugins_menu);
mbar.append(*plugins_item);
create_menu_item(*plugins_menu, "_Manage plugins", "plugins_manage_plugins",
Stock::DISCONNECT, &DinoGUI::slot_plugins_manage);
MenuItem* help_item = manage(new MenuItem("_Help", true));
Menu* help_menu = manage(new Menu);
help_item->set_submenu(*help_menu);
mbar.append(*help_item);
create_menu_item(*help_menu, "_About Dino", "help_about",
Stock::ABOUT, &DinoGUI::slot_help_about_dino);
}