• Login
Community
  • Login

Multi menu in my plugins

Scheduled Pinned Locked Moved Notepad++ & Plugin Development
7 Posts 3 Posters 731 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.
  • J
    John Huang
    last edited by Jan 29, 2022, 3:03 AM

    Is this possible for creating multi menu in my plugin?

    For example:
    This is demo plugin menu
    it only has one layer
    alt text

    How to modify like this(two layer)
    alt text

    Thanks,
    John

    E 1 Reply Last reply Jan 29, 2022, 9:33 AM Reply Quote 0
    • E
      Ekopalypse @John Huang
      last edited by Jan 29, 2022, 9:33 AM

      @john-huang

      Yes, see https://github.com/bruderstein/PythonScript for example.

      J 1 Reply Last reply Jan 29, 2022, 12:59 PM Reply Quote 2
      • J
        John Huang @Ekopalypse
        last edited by Jan 29, 2022, 12:59 PM

        @ekopalypse
        Thanks for your information

        I can not find the key point.
        Do you an another example?

        I will contiune to try it.
        Thank you

        E 1 Reply Last reply Jan 29, 2022, 3:46 PM Reply Quote 0
        • E
          Ekopalypse @John Huang
          last edited by Jan 29, 2022, 3:46 PM

          @john-huang

          here it is.
          And here where to start.

          J 1 Reply Last reply Jan 30, 2022, 1:25 PM Reply Quote 5
          • J
            John Huang @Ekopalypse
            last edited by Jan 30, 2022, 1:25 PM

            @ekopalypse
            Hi Ekopalypse,
            Thank you for your help.

            It’s beyond me. How to create two menu layer for the Notepad++ plugins.

            I know I need to return a FuncItem * in getFuncsArray.
            I see the getFuncsArray() function in PythonScript.
            I think the key point is

            m_funcItems[position]._init2Check = false;
            m_funcItems[position]._pShKey = NULL;
            m_funcItems[position]._pFunc = NULL;
            

            Now I can use the FuncItem * array to create one menu layer, but
            I still don’t know how to create two menu layer.

            Please give me more information.
            Thank you a lof.

            John

            A E 2 Replies Last reply Jan 30, 2022, 1:47 PM Reply Quote 0
            • A
              Alan Kilborn @John Huang
              last edited by Jan 30, 2022, 1:47 PM

              @john-huang said in Multi menu in my plugins:

              How to create two menu layer for the Notepad++ plugins.

              It is the same for any Windows program coding.
              Suggest you take it to a more appropriate forum where you will get better help.
              It really is off-topic here.

              1 Reply Last reply Reply Quote 0
              • E
                Ekopalypse @John Huang
                last edited by Ekopalypse Jan 31, 2022, 9:48 AM Jan 31, 2022, 9:47 AM

                @john-huang

                From Npp’s point of view you only provide the main menu via the function item array, everything else has to be handled by your plugin.
                To do that, ask Npp for the plugin menu handle and once you have it, find the menu item you want to add sub-items to like here .
                Now, to know when an npp user has clicked on such a menu item, you need to listen to the messageProc and act accordingly .
                If it is necessary to manipulate the main menu of the plugin at runtime, then you need to ask Npp for a list of pre-assigned menu items .
                I agree that this part could be described in more detail in the manual, which I will do soon.
                If there is anything else that you think is not well described or maybe irritating, let us know.

                @Alan-Kilborn

                It is the same for any Windows program coding.

                Creating the menu, yes, but with some Npp-related *quirks that I hope I described clearly above.

                *can’t find another/better word for it.

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