• Login
Community
  • Login

How to remove to separation lines in the menu?

Scheduled Pinned Locked Moved Notepad++ & Plugin Development
25 Posts 4 Posters 1.9k 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.
  • L
    lifehack nerd
    last edited by Feb 24, 2022, 2:28 PM

    Hello,

    I am a new developer for several days. I make my own plug based on the ‘Npp Converter’.
    But I am confused about the separation lines in the menu.
    Could anyone tell me how can I remove them? It seems a simple question but I still can’t figure out how to customiz it.

    Thanks!

    The separation lines in the red box:
    img.png

    A 1 Reply Last reply Feb 24, 2022, 2:47 PM Reply Quote 0
    • A
      Alan Kilborn @lifehack nerd
      last edited by Feb 24, 2022, 2:47 PM

      @lifehack-nerd

      The first question, probably for you, is, where did these separators come from?

      Next, I would see HERE .

      L 1 Reply Last reply Feb 24, 2022, 2:58 PM Reply Quote 0
      • L
        lifehack nerd @Alan Kilborn
        last edited by Feb 24, 2022, 2:58 PM

        @alan-kilborn thanks for your reply Alan. I am still confused. Do you know how to add a separator in the menu?
        I just modified the code as below. But don’t have any clew where the lines come from.

        void commandMenuInit()
        {
            //setCommand(1, TEXT("HEX -> ASCII"), hex2Ascii, NULL, false);
        	//setCommand(2, TEXT("---"), NULL, NULL, false);
        	//setCommand(CONVERSIONPANEL_INDEX, TEXT("Conversion Panel"), conversionPanel, NULL, false);
        	//setCommand(4, TEXT("---"), NULL, NULL, false);
        	//setCommand(5, TEXT("Edit Configuration File"), editConf, NULL, false);
        	//setCommand(6, TEXT("About"), about, NULL, false);
        
        	setCommand(0, TEXT("Filter1"), filterRun1, NULL, false);
        	setCommand(1, TEXT("Filter2"), filterRun2, NULL, false);
        	setCommand(2, TEXT("Filter3"), filterRun3, NULL, false);
        	setCommand(3, TEXT("Edit Configuration"), conversionPanel, NULL, false);
        	setCommand(4, TEXT("About"), about, NULL, false);
        }
        
        E 1 Reply Last reply Feb 24, 2022, 3:10 PM Reply Quote 0
        • E
          Ekopalypse @lifehack nerd
          last edited by Feb 24, 2022, 3:10 PM

          @lifehack-nerd said in How to remove to separation lines in the menu?:

          setCommand(2, TEXT(“—”), NULL, NULL, false);

          this, normally, triggers the separator.
          I assume there is some code that assumes there are more menu items and sends voidptr(0) instead.

          L 1 Reply Last reply Feb 24, 2022, 3:23 PM Reply Quote 0
          • L
            lifehack nerd @Ekopalypse
            last edited by Feb 24, 2022, 3:23 PM

            @ekopalypse Thank you! Is there official document about how to customize the menu?
            Find where they come from, then know how to remove them like Alan said.

            E M 2 Replies Last reply Feb 24, 2022, 3:28 PM Reply Quote 0
            • E
              Ekopalypse @lifehack nerd
              last edited by Feb 24, 2022, 3:28 PM

              @lifehack-nerd

              Depends, the first level of the menu is created by Npp via the getFuncsArray callback, but other levels, obviously if you want to have menus with multiple levels, need to be handled by your plugin and need to be created/handled using the msdn documentation that @Alan-Kilborn pointed to.

              1 Reply Last reply Reply Quote 0
              • M
                Michael Vincent @lifehack nerd
                last edited by Feb 24, 2022, 3:30 PM

                @lifehack-nerd said in How to remove to separation lines in the menu?:

                Thank you! Is there official document about how to customize the menu?

                “yes”, in the plugin template. You can modify the menu items as you’ve shown, and I typically use:

                setCommand( 3,  TEXT( "-SEPARATOR-" ),   NULL, NULL, false );
                

                for separators so it’s pretty obvious it’s a separator (note the text “-SEPARATOR-” does not actually appear in the menu, just the line). You will ALSO NEED TO CHANGE in PluginDefinition.h

                //-----------------------------------------------//
                //-- STEP 2. DEFINE YOUR PLUGIN COMMAND NUMBER --//
                //-----------------------------------------------//
                //
                // Here define the number of your plugin commands
                //
                const int nbFunc = 21;
                

                the nbFunc which is the number of menu items you have. If this doesn’t agree, you’ll get a shorter menu, or a bunch of extra separator lines. Note this number must be the TOTAL of menu items INCLUDING seprators, so in your example code above, you should set:

                const int nbFunc = 5
                

                since you show:

                        setCommand(0, TEXT("Filter1"), filterRun1, NULL, false);
                	setCommand(1, TEXT("Filter2"), filterRun2, NULL, false);
                	setCommand(2, TEXT("Filter3"), filterRun3, NULL, false);
                	setCommand(3, TEXT("Edit Configuration"), conversionPanel, NULL, false);
                	setCommand(4, TEXT("About"), about, NULL, false);
                

                Cheers.

                L 2 Replies Last reply Feb 24, 2022, 3:54 PM Reply Quote 4
                • L
                  lifehack nerd @Michael Vincent
                  last edited by Feb 24, 2022, 3:54 PM

                  @michael-vincent WOW IT’S THE ANSWER! It works! Thank you very much Michael!

                  1 Reply Last reply Reply Quote 1
                  • L
                    lifehack nerd @Michael Vincent
                    last edited by lifehack nerd Feb 24, 2022, 4:09 PM Feb 24, 2022, 4:06 PM

                    @michael-vincent Hi Michael, do you know how to make our own plugins can be searched in the Plugins Admin? like offical document indicates how to make it?
                    I hope that my plugin can be searched in it. I will be very proud of it though it’s still under developing.

                    A 2 Replies Last reply Feb 24, 2022, 4:10 PM Reply Quote 0
                    • A
                      Alan Kilborn @lifehack nerd
                      last edited by Feb 24, 2022, 4:10 PM

                      @lifehack-nerd said in How to remove to separation lines in the menu?:

                      how to make our own plugins can be searched in the Plugins Admin?

                      I think you want THIS .

                      L 1 Reply Last reply Feb 24, 2022, 4:13 PM Reply Quote 3
                      • L
                        lifehack nerd @Alan Kilborn
                        last edited by Feb 24, 2022, 4:13 PM

                        @alan-kilborn Yes! Thank you!

                        1 Reply Last reply Reply Quote 1
                        • A
                          Alan Kilborn @lifehack nerd
                          last edited by Feb 24, 2022, 4:14 PM

                          @lifehack-nerd

                          Just a tip: You might want to discuss your plugin and what it does in a new thread on this site. You may find that, while very useful to you, your plugin may not have a wider appeal, or there may already be a plugin existing (that you don’t know about) that covers its functionality.

                          L 1 Reply Last reply Feb 24, 2022, 4:23 PM Reply Quote 0
                          • L
                            lifehack nerd @Alan Kilborn
                            last edited by Feb 24, 2022, 4:23 PM

                            @alan-kilborn Well, I need some time to read the document because my English is not good. But I want to ask first:
                            1.If my plugin do not have a wider appeal, will I be rejected? How to make that judgement?
                            2.there may already be a plugin existing (that you don’t know about) that covers its functionality, will I be rejected?
                            Thanks!

                            M 1 Reply Last reply Feb 24, 2022, 4:28 PM Reply Quote 0
                            • M
                              Michael Vincent @lifehack nerd
                              last edited by Feb 24, 2022, 4:28 PM

                              @lifehack-nerd said in How to remove to separation lines in the menu?:

                              1.If my plugin do not have a wider appeal, will I be rejected? How to make that judgement?
                              2.there may already be a plugin existing (that you don’t know about) that covers its functionality, will I be rejected?

                              I don’t think it will be rejected - there are some plugins up there that have overlapping functionality. I think @Alan-Kilborn 's point is more about “work smarter, not harder” - you’re asking good questions and getting help here, but a more fundamental question might be:

                              “Hey, is there a way or plugin to do ‘X’?”

                              and you may find, yes, there are 2 plugins and a way to script it in either PythonScript and / or NppExec.

                              The other reason to describe your plugin here is there may be some who are willing to test functionality for you or even help develop it if it “scratches an itch”.

                              If you’re developing a plugin just for the experience, that works fine too! Good luck :-)!

                              Cheers.

                              L 1 Reply Last reply Feb 24, 2022, 4:58 PM Reply Quote 0
                              • L
                                lifehack nerd @Michael Vincent
                                last edited by lifehack nerd Feb 24, 2022, 4:59 PM Feb 24, 2022, 4:58 PM

                                @michael-vincent Thanks Michael! Very helpful!

                                Is there a plugin to search multi text tag and display the result?
                                I am an embedded software engineer and often need to analyse logs. I want to make a multiline search plugin, because the power events have unique log pattern, the device communication events and the brightness events of the screen or other events all have their own patterns. I want fill the log patterns in the plugin and search them totally. Then I can analyse them in the sequence base on timestamp.

                                I almost finish it but blocked by the separator. So ask questions here. The function is indeed “scratches an itch” but … maybe I am just too eager to have relationship with a widely used editor and just do it before ask. Haha.

                                M 1 Reply Last reply Feb 24, 2022, 5:03 PM Reply Quote 0
                                • M
                                  Michael Vincent @lifehack nerd
                                  last edited by Feb 24, 2022, 5:03 PM

                                  @lifehack-nerd said in How to remove to separation lines in the menu?:

                                  Is there a plugin to search multi text tag and display the result?
                                  I am an embedded software engineer and often need to analyse logs. I want to make a multiline search plugin, because the power events have unique log pattern

                                  Have a look at AnalysePlugin which is for analyzing log files and allows multiple search patters (including regex) and can color the file or output to a search window. That may cover 80% of your use case - feel free to continue your development either way.

                                  Cheers.

                                  L 1 Reply Last reply Feb 24, 2022, 5:33 PM Reply Quote 1
                                  • L
                                    lifehack nerd @Michael Vincent
                                    last edited by Feb 24, 2022, 5:33 PM

                                    @michael-vincent This plugin is good especially it can color the found logs and the full log reacts when click on the found log. It was started 10 years ago! I am going to terminate my work.

                                    A M 2 Replies Last reply Feb 24, 2022, 6:05 PM Reply Quote 0
                                    • A
                                      Alan Kilborn @lifehack nerd
                                      last edited by Feb 24, 2022, 6:05 PM

                                      @lifehack-nerd said in How to remove to separation lines in the menu?:

                                      This (Analyse) plugin is good especially it can color the found logs and the full log reacts when click on the found log. It was started 10 years ago! I am going to terminate my work.

                                      Yea…I certainly didn’t want to discourage your work, but putting effort into something just to discover you’ve reinvented the wheel is a bummer.

                                      L 1 Reply Last reply Feb 25, 2022, 1:40 PM Reply Quote 2
                                      • M
                                        Michael Vincent @lifehack nerd
                                        last edited by Feb 24, 2022, 6:07 PM

                                        @lifehack-nerd said in How to remove to separation lines in the menu?:

                                        It was started 10 years ago! I am going to terminate my work.

                                        I think just recently updated to address the N++ 8.3 breaking changes. So the author is active thus if you want to contribute, you may ask him/her on the plugin’s site and perhaps help improve that plugin for the good of all.

                                        Cheers.

                                        L 1 Reply Last reply Feb 25, 2022, 1:42 PM Reply Quote 2
                                        • L
                                          lifehack nerd @Alan Kilborn
                                          last edited by Feb 25, 2022, 1:40 PM

                                          @alan-kilborn Yeah, I didn’t know there already had a good wheel here.
                                          How do you avoid this kind of thing happened?
                                          If you have a idea, will you annouce to everybody or trend to just start it?
                                          Thanks!

                                          M 1 Reply Last reply Feb 25, 2022, 2:25 PM Reply Quote 0
                                          5 out of 25
                                          • First post
                                            5/25
                                            Last post
                                          The Community of users of the Notepad++ text editor.
                                          Powered by NodeBB | Contributors