当前位置: 首页>>代码示例>>C++>>正文


C++ MenuBar::append方法代码示例

本文整理汇总了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);
}
开发者ID:ViktorNova,项目名称:dino,代码行数:60,代码来源:dinogui.cpp


注:本文中的MenuBar::append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。