Community
    • Login

    Submenu Item on Edit Context Menu

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 2 Posters 879 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Daniel JamesonD
      Daniel Jameson
      last edited by

      I’m trying to edit contextmenu.xml to modify the Edit Popup ContextMenu. I want to add the “Sort Lines Lexicographically Ascending” item from the “Line Operations” submenu of the “Edit” menu. Can this be done? I cannot find any instructions that say how to navigate submenus in contextmenu.xml.
      I was able to successfully add an item in a first level menu (Edit | Character Panel).

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • Daniel JamesonD
        Daniel Jameson
        last edited by

        Through guessing and trial & error I got it to work:

        <Item MenuEntryName="Edit" SubMenuEntryName="Line Operations" MenuItemName="Sort Lines Lexicographically Ascending" />
        
        1 Reply Last reply Reply Quote 0
        • Daniel JamesonD
          Daniel Jameson
          last edited by

          And I got this working too…

          <Item FolderName="Sort Lines" MenuEntryName="Edit" SubMenuEntryName="Line Operations" MenuItemName="Sort Lines Lexicographically Ascending" />
          <Item FolderName="Sort Lines" MenuEntryName="Edit" SubMenuEntryName="Line Operations" MenuItemName="Sort Lines Lex. Ascending Ignoring Case" />
          <Item FolderName="Sort Lines" MenuEntryName="Edit" SubMenuEntryName="Line Operations" MenuItemName="Sort Lines Lexicographically Descending" />
          <Item FolderName="Sort Lines" MenuEntryName="Edit" SubMenuEntryName="Line Operations" MenuItemName="Sort Lines Lex. Descending Ignoring Case" />
          
          1 Reply Last reply Reply Quote 2
          • PeterJonesP
            PeterJones @Daniel Jameson
            last edited by

            @Daniel-Jameson said in Submenu Item on Edit Context Menu:

            I cannot find any instructions that say how to navigate submenus

            The official docs say,

            To add a built-in command, you need to provide the main menu name (as it appears in the main menu bar) as the value of the MenuEntryName attribute and the command’s item name (as it appears in the menu) as the value of the MenuItemName attribute. The MenuEntryName attribute must reference an entry on the main menu bar and must be an ancestor of the MenuItemName attribute, regardless of its depth.

            Thus, MenuEntryName must always be a top-level (“from the main menu”), and MenyItemName is the name of the action any number of levels deep (“regardless of its depth”).under that top-level menu name.

            Further, as will be explained better in the next release of the usermanual, you can also refer to any builtin menu entry through its command ID rather than the menu name

            PeterJonesP 1 Reply Last reply Reply Quote 1
            • PeterJonesP
              PeterJones @PeterJones
              last edited by

              @PeterJones said in Submenu Item on Edit Context Menu:

              in the next release

              Which @donho just released a few mintues ago (thanks!). So now my official docs link points to the explanation with more detail.

              1 Reply Last reply Reply Quote 1
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors