• Login
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.
  • D
    Daniel Jameson
    last edited by Apr 2, 2021, 9:48 PM

    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).

    P 1 Reply Last reply Apr 2, 2021, 10:30 PM Reply Quote 0
    • D
      Daniel Jameson
      last edited by Apr 2, 2021, 10:05 PM

      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
      • D
        Daniel Jameson
        last edited by Apr 2, 2021, 10:10 PM

        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
        • P
          PeterJones @Daniel Jameson
          last edited by Apr 2, 2021, 10:30 PM

          @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

          P 1 Reply Last reply Apr 3, 2021, 12:00 AM Reply Quote 1
          • P
            PeterJones @PeterJones
            last edited by Apr 3, 2021, 12:00 AM

            @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
            5 out of 5
            • First post
              5/5
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors