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.
    • lifehack nerdL
      lifehack nerd
      last edited by

      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

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @lifehack nerd
        last edited by

        @lifehack-nerd

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

        Next, I would see HERE.

        lifehack nerdL 1 Reply Last reply Reply Quote 0
        • lifehack nerdL
          lifehack nerd @Alan Kilborn
          last edited by

          @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);
          }
          
          EkopalypseE 1 Reply Last reply Reply Quote 0
          • EkopalypseE
            Ekopalypse @lifehack nerd
            last edited by

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

            lifehack nerdL 1 Reply Last reply Reply Quote 0
            • lifehack nerdL
              lifehack nerd @Ekopalypse
              last edited by

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

              EkopalypseE Michael VincentM 2 Replies Last reply Reply Quote 0
              • EkopalypseE
                Ekopalypse @lifehack nerd
                last edited by

                @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
                • Michael VincentM
                  Michael Vincent @lifehack nerd
                  last edited by

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

                  lifehack nerdL 2 Replies Last reply Reply Quote 4
                  • lifehack nerdL
                    lifehack nerd @Michael Vincent
                    last edited by

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

                    1 Reply Last reply Reply Quote 1
                    • lifehack nerdL
                      lifehack nerd @Michael Vincent
                      last edited by lifehack nerd

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

                      Alan KilbornA 2 Replies Last reply Reply Quote 0
                      • Alan KilbornA
                        Alan Kilborn @lifehack nerd
                        last edited by

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

                        lifehack nerdL 1 Reply Last reply Reply Quote 3
                        • lifehack nerdL
                          lifehack nerd @Alan Kilborn
                          last edited by

                          @alan-kilborn Yes! Thank you!

                          1 Reply Last reply Reply Quote 1
                          • Alan KilbornA
                            Alan Kilborn @lifehack nerd
                            last edited by

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

                            lifehack nerdL 1 Reply Last reply Reply Quote 0
                            • lifehack nerdL
                              lifehack nerd @Alan Kilborn
                              last edited by

                              @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!

                              Michael VincentM 1 Reply Last reply Reply Quote 0
                              • Michael VincentM
                                Michael Vincent @lifehack nerd
                                last edited by

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

                                lifehack nerdL 1 Reply Last reply Reply Quote 0
                                • lifehack nerdL
                                  lifehack nerd @Michael Vincent
                                  last edited by lifehack nerd

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

                                  Michael VincentM 1 Reply Last reply Reply Quote 0
                                  • Michael VincentM
                                    Michael Vincent @lifehack nerd
                                    last edited by

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

                                    lifehack nerdL 1 Reply Last reply Reply Quote 1
                                    • lifehack nerdL
                                      lifehack nerd @Michael Vincent
                                      last edited by

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

                                      Alan KilbornA Michael VincentM 2 Replies Last reply Reply Quote 0
                                      • Alan KilbornA
                                        Alan Kilborn @lifehack nerd
                                        last edited by

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

                                        lifehack nerdL 1 Reply Last reply Reply Quote 2
                                        • Michael VincentM
                                          Michael Vincent @lifehack nerd
                                          last edited by

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

                                          lifehack nerdL 1 Reply Last reply Reply Quote 2
                                          • lifehack nerdL
                                            lifehack nerd @Alan Kilborn
                                            last edited by

                                            @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!

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