Creates a menu to display for the editing of template information.
761754
def showMenu( self ):
        
        item = self.uiMenuTREE.currentItem()
        
        menu = QMenu(self)
        act = menu.addAction('Add Menu...')
        act.setIcon(QIcon(projexui.resources.find('img/folder.png')))
        act.triggered.connect(self.createMenu)
        
        if ( item and item.data(0, Qt.UserRole) == 'menu' ):
            act = menu.addAction('Rename Menu...')
            ico = QIcon(projexui.resources.find('img/edit.png'))
            act.setIcon(ico)
            act.triggered.connect(self.renameMenu)
        
        act = menu.addAction('Add Separator')
        act.setIcon(QIcon(projexui.resources.find('img/ui/splitter.png')))
        act.triggered.connect(self.createSeparator)
        
        menu.addSeparator()
        
        act = menu.addAction('Remove Item')
        act.setIcon(QIcon(projexui.resources.find('img/remove.png')))
        act.triggered.connect(self.removeItem)
        act.setEnabled(item is not None)
        
        menu.exec_(QCursor.pos())
13985
def edit
      @menu = Menu.find(params[:id])

      # add breadcrumb and set title
      add_breadcrumb I18n.t("controllers.admin.menus.edit.breadcrumb", menu_name: @menu.name)
      set_title(I18n.t("controllers.admin.menus.edit.title", menu_name: @menu.name))
    end
1297602
def createEditor(self, delegate, parent, option):
        
        return FontCtiEditor(self, delegate, parent=parent)
417073
def generate_menu(self, ass, text, path=None, level=0):
        
        menu = self.create_menu()
        for index, sub in enumerate(sorted(ass[1], key=lambda y: y[0].fullname.lower())):
            if index != 0:
                text += "|"
            text += "- " + sub[0].fullname
            new_path = list(path)
            if level == 0:
                new_path.append(ass[0].name)
            new_path.append(sub[0].name)
            menu_item = self.menu_item(sub, new_path)
            if sub[1]:
                # If assistant has subassistants
                (sub_menu, txt) = self.generate_menu(sub, text, new_path, level=level + 1)
                menu_item.set_submenu(sub_menu)
            menu.append(menu_item)
        return menu, text
758829
def _create_ui(self):
        """"""

        self.preview = None
        self.about_dialog = None
        self.preferences = None
        self.builder = pygubu.Builder(translator)
        self.currentfile = None
        self.is_changed = False

        uifile = os.path.join(FILE_PATH, "ui/pygubu-ui.ui")
        self.builder.add_from_file(uifile)
        self.builder.add_resource_path(os.path.join(FILE_PATH, "images"))

        #build main ui
        self.builder.get_object('mainwindow', self.master)
        toplevel = self.master.winfo_toplevel()
        menu = self.builder.get_object('mainmenu', toplevel)
        toplevel['menu'] = menu

        #project name
        self.project_name = self.builder.get_object('projectname_lbl')

        #Class selector values
        self.widgetlist_sf = self.builder.get_object("widgetlist_sf")
        self.widgetlist = self.builder.get_object("widgetlist")
        self.configure_widget_list()

        #widget tree
        self.treeview = self.builder.get_object('treeview1')
        self.bindings_frame = self.builder.get_object('bindingsframe')
        self.bindings_tree = self.builder.get_object('bindingstree')

        #Preview
        previewc = self.builder.get_object('preview_canvas')
        self.previewer = PreviewHelper(previewc)
        #tree editor
        self.tree_editor = WidgetsTreeEditor(self)

        self.builder.connect_callbacks(self)

        #Status bar
        self.statusbar = self.builder.get_object('statusbar')
        handler = StatusBarHandler(self.statusbar)
        handler.setLevel(logging.INFO)
        logger.addHandler(handler)
        pygubu.builder.logger.addHandler(handler)

        #app grid
        self.set_resizable()

        #
        #Application bindings
        #
        master = self.master
        master.bind_all(
            '<Control-KeyPress-n>',
            lambda e: self.on_file_menuitem_clicked('file_new'))
        master.bind_all(
            '<Control-KeyPress-o>',
            lambda e: self.on_file_menuitem_clicked('file_open'))
        master.bind_all(
            '<Control-KeyPress-s>',
            lambda e: self.on_file_menuitem_clicked('file_save'))
        master.bind_all(
            '<Control-KeyPress-q>',
            lambda e: self.on_file_menuitem_clicked('file_quit'))
        master.bind_all(
            '<Control-KeyPress-i>',
            lambda e: self.on_edit_menuitem_clicked('edit_item_up'))
        master.bind_all(
            '<Control-KeyPress-k>',
            lambda e: self.on_edit_menuitem_clicked('edit_item_down'))
        master.bind_all(
            '<F5>',
            lambda e: self.tree_editor.preview_in_toplevel())
        master.bind_all(
            '<F6>',
            lambda e: self.previewer.close_toplevel_previews())

        #
        # Widget bindings
        #
        self.tree_editor.treeview.bind(
            '<Control-KeyPress-c>',
            lambda e: self.tree_editor.copy_to_clipboard())
        self.tree_editor.treeview.bind(
            '<Control-KeyPress-v>',
            lambda e: self.tree_editor.paste_from_clipboard())
        self.tree_editor.treeview.bind(
            '<Control-KeyPress-x>',
            lambda e: self.tree_editor.cut_to_clipboard())
        self.tree_editor.treeview.bind(
            '<KeyPress-Delete>',
            lambda e: self.on_edit_menuitem_clicked('edit_item_delete'))

        def clear_key_pressed(event, newevent):
            # when KeyPress, not Ctrl-KeyPress, generate event.
            if event.keysym_num == ord(event.char):
                self.tree_editor.treeview.event_generate(newevent)
        self.tree_editor.treeview.bind('<i>',
                lambda e: clear_key_pressed(e, '<Up>'))
        self.tree_editor.treeview.bind('<k>',
                lambda e: clear_key_pressed(e, '<Down>'))

        #grid move bindings
        self.tree_editor.treeview.bind(
            '<Alt-KeyPress-i>',
            lambda e: self.on_edit_menuitem_clicked('grid_up'))
        self.tree_editor.treeview.bind(
            '<Alt-KeyPress-k>',
            lambda e: self.on_edit_menuitem_clicked('grid_down'))
        self.tree_editor.treeview.bind(
            '<Alt-KeyPress-j>',
            lambda e: self.on_edit_menuitem_clicked('grid_left'))
        self.tree_editor.treeview.bind(
            '<Alt-KeyPress-l>',
            lambda e: self.on_edit_menuitem_clicked('grid_right'))
            
        # On preferences save binding
        self.master.bind('<<PygubuDesignerPreferencesSaved>>', self.on_preferences_saved)

        #
        # Setup tkk styles
        #
        self._setup_styles()

        #
        # Setup dynamic theme submenu
        #
        self._setup_theme_menu()

        #app config
        top = self.master.winfo_toplevel()
        try:
            top.wm_iconname('pygubu')
            top.tk.call('wm', 'iconphoto', '.', StockImage.get('pygubu'))
        except StockImageException as e:
            pass

        self.set_title(_('Pygubu a GUI builder for tkinter'))
        self.set_size('640x480')
484400
def menu_text(self, request=None):
        """"""
        source_field_name = settings.PAGE_FIELD_FOR_MENU_ITEM_TEXT
        if(
            source_field_name != 'menu_text' and
            hasattr(self, source_field_name)
        ):
            return getattr(self, source_field_name)
        return self.title
1345792
def set_menu(self, menu):
        
        self.menu = menu
        self.submenu.parent = menu
66855
def init_menu():
    """"""
    # Register settings menu
    item = current_menu.submenu('settings.admin')
    item.register(
        "admin.index",
        # NOTE: Menu item text (icon replaced by a cogs icon).
        _('%(icon)s Administration', icon='<i class="fa fa-cogs fa-fw"></i>'),
        visible_when=_has_admin_access,
        order=100)
1005069
def _append(self, menu):
        ''''''
        menu.Append(self.id(), self.name, self.description)
299616
protected function createAdminMenu(): void
    {
        $menu = $this->menu();
        $events = $this->app->make('events');

        $handlers = [
            UserMenuHandler::class,
            ExtensionMenuHandler::class,
            SettingMenuHandler::class,
        ];

        $menu->add('home')
            ->title(\trans('orchestra/foundation::title.home'))
            ->link($this->handles('orchestra::/'))
            ->icon('home');

        foreach ($handlers as $handler) {
            $events->listen('orchestra.started: admin', $handler);
        }
    }
281121
def set_default_template_menu
        puts "\n\n******************************************************************************************************************************************\n\n"
        puts "  SELECT A DEFAULT JUMPSTART TEMPLATE\n".purple
        display_existing_templates
        puts "\n  b".yellow + " Back to main menu.\n\n"
        puts "  x".yellow + " Exit jumpstart.\n\n"
        puts "******************************************************************************************************************************************\n\n"
        set_default_template_options
      end
303570
function admin_menu()
	{
		// add page
		$page = add_submenu_page('edit.php?post_type=acf', __('Add-ons','acf'), __('Add-ons','acf'), 'manage_options', 'acf-addons', array($this,'html'));
		
		
		// actions
		add_action('load-' . $page, array($this,'load'));
		add_action('admin_print_scripts-' . $page, array($this, 'admin_print_scripts'));
		add_action('admin_print_styles-' . $page, array($this, 'admin_print_styles'));
		add_action('admin_head-' . $page, array($this,'admin_head'));
	}
1352628
public function afficheMenu()
    {
        $html                                    = "";
        $t                                       = new Template('modules/archi/templates/');
        $t->set_filenames((array('administration'=>'administration.tpl')));
        $menu                                    = array();
        $u                                       = new archiUtilisateur();
        $a                                       = new archiAuthentification();
        $idUtilisateur                           = $a->getIdUtilisateur();
        if ($u->isAuthorized('admin_droits', $idUtilisateur)) {
            $menu = array_merge($menu, array(_("Droits")=>$this->creerUrl('', 'adminDroits')));
        }
        if ($u->isAuthorized('admin_actualites', $idUtilisateur)) {
            $menu = array_merge($menu, array(_("Actualités")=>$this->creerUrl('', 'adminActualites')));
        }
        $menu[_("Pages")] = $this->creerUrl('', 'adminPages', array());
        if ($u->isAuthorized('admin_actualites', $idUtilisateur)) {
            $menu = array_merge($menu, array(_("Compteur de dons")=>$this->creerUrl('', 'adminCompteur')));
        }
        if ($u->isAuthorized('admin_sources', $idUtilisateur)) {
            $menu = array_merge($menu, array(_("Sources")=>$this->creerUrl('', 'administration', array('tableName'=>'source'))));
        }
        if ($u->isAuthorized('admin_types_sources', $idUtilisateur)) {
            $menu = array_merge($menu, array(_("Types de sources")=>$this->creerUrl('', 'administration', array('tableName'=>'typeSource'))));
        }
        if ($u->isAuthorized('admin_types_structures', $idUtilisateur)) {
            $menu = array_merge($menu, array(_("Types de structures")=>$this->creerUrl('', 'administration', array('tableName'=>'typeStructure'))));
        }
        if ($u->isAuthorized('admin_courants_architecturaux', $idUtilisateur)) {
            $menu = array_merge($menu, array(_("Courant architecturaux")=>$this->creerUrl('', 'administration', array('tableName'=>'courantArchitectural'))));
        }
        $menu[_("Gestion des personnes")] = array();
        if ($u->isAuthorized('admin_metiers', $idUtilisateur)) {
            $menu[_("Gestion des personnes")] = array_merge($menu[_("Gestion des personnes")], array(_("Métiers")=>$this->creerUrl('', 'administration', array('tableName'=>'metier'))));
        }
        if ($u->isAuthorized('admin_personnes', $idUtilisateur)) {
            $menu[_("Gestion des personnes")] = array_merge($menu[_("Gestion des personnes")], array(_("Modifier une personne")=>$this->creerUrl('', 'adminPersonne', array())));
        }
        $menu[_("Gestion des adresses")] = array();
        if ($u->isAuthorized('admin_adresses', $idUtilisateur)) {
            $menu[_("Gestion des adresses")] = array_merge($menu[_("Gestion des adresses")], array(_("Ajout d'éléments d'adresse (rue, sous-quartier, quartier, ville, pays)")=>$this->creerUrl('', 'ajoutNouvelleAdresse', array())));
        }
        if ($u->isAuthorized('admin_rues', $idUtilisateur)) {
            $menu[_("Gestion des adresses")] = array_merge($menu[_("Gestion des adresses")], array(_("Gérer les rues")=>$this->creerUrl('', 'adminElementAdresse', array('tableName'=>'rue'))));
        }
        if ($u->isAuthorized('admin_sousQuartiers', $idUtilisateur)) {
            $menu[_("Gestion des adresses")] = array_merge($menu[_("Gestion des adresses")], array(_("Gérer les sous-quartiers")=>$this->creerUrl('', 'adminElementAdresse', array('tableName'=>'sousQuartier'))));
        }
        if ($u->isAuthorized('admin_quartiers', $idUtilisateur)) {
            $menu[_("Gestion des adresses")] = array_merge($menu[_("Gestion des adresses")], array(_("Gérer les quartiers")=>$this->creerUrl('', 'adminElementAdresse', array('tableName'=>'quartier'))));
        }
        if ($u->isAuthorized('admin_villes', $idUtilisateur)) {
            $menu[_("Gestion des adresses")] = array_merge($menu[_("Gestion des adresses")], array(_("Gérer les villes")=>$this->creerUrl('', 'adminElementAdresse', array('tableName'=>'ville'))));
        }
        if ($u->isAuthorized('admin_pays', $idUtilisateur)) {
            $menu[_("Gestion des adresses")] = array_merge($menu[_("Gestion des adresses")], array(_("Gérer les pays")=>$this->creerUrl('', 'adminElementAdresse', array('tableName'=>'pays'))));
        }
        if ($u->isAuthorized('admin_affiche_resultats_sondages', $idUtilisateur)) {
            $menu = array_merge($menu, array(_("Voir les statistiques des sondages")=>$this->creerUrl('', 'adminSondages', array())));
        }
        if ($u->isAuthorized('admin_parcours', $idUtilisateur)) {
            $menu = array_merge($menu, array(_("Gérer les parcours")=>$this->creerUrl('', 'adminListeParcours', array())));
        }
        if ($u->isAuthorized('admin_traduction', $idUtilisateur)) {
            $menu[_("Traduction")] = array(_("Traduction")=>$this->tradLink, _("Détecter les nouvelles chaines à traduire")=>"script/updateTranslation.php", _("Appliquer les nouvelles traductions")=>"script/applyTranslation.php");;
            //$menu[_("Détecter les nouvelles chaines à traduire")] = "script/updateTranslation.php";
            //$menu[_("Appliquer les nouvelles traductions")] = "script/applyTranslation.php";
        }
        foreach ($menu as $nom=>$url) {
            if (is_array($url)) {
                $menuHTML=$nom._(" :");
                $menuHTML.="<ul>";
                foreach ($url as $subName=>$subURL) {
                    $menuHTML.="<li><a href='".$subURL."'>".$subName."</a></li>";
                }
                $menuHTML.="</ul>";
            } else {
                $menuHTML="<a href='".$url."'>".$nom."</a>";
                //<a href="{listeMenu.url}">{listeMenu.nom}</a>
            }
            $t->assign_block_vars('listeMenu', array("menu"=>$menuHTML));
        }
        ob_start();
        $t->pparse('administration');
        $html = ob_get_contents();
        ob_end_clean();
        return $html;
    }
620432
private void createMenuEntry(
        MenuItem parent,
        final CmsTreeNode<I_CmsContextMenuItem> node,
        CmsContextMenuTreeBuilder treeBuilder) {

        Command entryCommand = null;
        if (node.getChildren().size() == 0) {
            entryCommand = new Command() {

                private static final long serialVersionUID = 1L;

                public void menuSelected(MenuItem selectedItem) {

                    node.getData().executeAction(getDialogContext());
                }
            };
        }
        MenuItem entry = parent.addItem((node.getData().getTitle(A_CmsUI.get().getLocale())), entryCommand);
        for (CmsTreeNode<I_CmsContextMenuItem> child : node.getChildren()) {
            createMenuEntry(entry, child, treeBuilder);
        }
        if (treeBuilder.getVisibility(node.getData()).isInActive()) {
            entry.setEnabled(false);
        }
    }
245598
protected function createMenuFile()
    {
        $file = $this->directory.'/menu.php';

        $contents = $this->getStub('menu');
        $this->laravel['files']->put($file, $contents);
        $this->line('<info>Menu file was created:</info> '.str_replace(base_path(), '', $file));
    }
853091
def createMenuItem( self, title ):
        
        item = QTreeWidgetItem([title])
        ico = projexui.resources.find('img/folder.png')
        
        item.setIcon(0, QIcon(ico))
        item.setSizeHint(0, QSize(120, 20))
        item.setData(0, Qt.UserRole, wrapVariant('menu'))
        
        return item
747456
def createMenu(self, parent):
        
        menu = QtGui.QMenu(parent)
        menu.setTitle('&View')

        act = menu.addAction('&Lock/Unlock Layout')
        act.setIcon(QtGui.QIcon(projexui.resources.find('img/view/lock.png')))
        act.triggered.connect(self.toggleLocked)
        
        menu.addSeparator()
        act = menu.addAction('&Export Layout as...')
        act.setIcon(QtGui.QIcon(projexui.resources.find('img/view/export.png')))
        act.triggered.connect(self.exportProfile)
        
        act = menu.addAction('&Import Layout from...')
        act.setIcon(QtGui.QIcon(projexui.resources.find('img/view/import.png')))
        act.triggered.connect(self.importProfile)

        menu.addSeparator()

        act = menu.addAction('&Clear Layout')
        act.setIcon(QtGui.QIcon(projexui.resources.find('img/view/remove.png')))
        act.triggered.connect(self.resetForced)

        return menu