void ZLGtkApplicationWindow::MenuBuilder::processSubmenuBeforeItems(ZLMenubar::Submenu &submenu) { GtkMenuItem *gtkItem = GTK_MENU_ITEM(gtk_menu_item_new_with_label(submenu.menuName().c_str())); GtkMenu *gtkSubmenu = GTK_MENU(gtk_menu_new()); gtk_menu_item_set_submenu(gtkItem, GTK_WIDGET(gtkSubmenu)); gtk_menu_shell_append(GTK_MENU_SHELL(myMenuStack.top()), GTK_WIDGET(gtkItem)); gtk_widget_show_all(GTK_WIDGET(gtkItem)); myMenuStack.push(gtkSubmenu); myWindow.mySubmenuItems.push_back(gtkItem); }
void ZLQtApplicationWindow::MenuBuilder::processSubmenuBeforeItems(ZLMenubar::Submenu &submenu) { ZLQtMenu *menu = new ZLQtMenu(submenu.id(), submenu.menuName()); if (myMenuStack.empty()) { if (!myWindow.menuBar()->isVisible()) { myWindow.menuBar()->show(); } myWindow.menuBar()->addMenu(menu); } else { myMenuStack.back()->addMenu(menu); myWindow.mySubmenuList.push_back(menu); } myMenuStack.push_back(menu); }
void ZLQtApplicationWindow::MenuUpdater::processSubmenuBeforeItems(ZLMenubar::Submenu &submenu) { QPopupMenu *qmenu = new QPopupMenu(myMenuStack.top()); myMenuStack.top()->insertItem(::qtString(submenu.menuName()), qmenu); myMenuStack.push(qmenu); }