Community
    • Login

    [C#] Gray Out Plugin's Tab Icon

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    8 Posts 3 Posters 711 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.
    • Sover theS
      Sover the
      last edited by

      Can you gray out the icon of your plugin in the upper tab, like the undo button when there’s nothing left to undo, for example? (And also turn it back to normal, of course.)
      Also, it’s important not to disable that button, so it’s still possible to be clicked, unlike the default grayed-out buttons.
      Isn’t that big of a deal if you can’t, but it’d be nice

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @Sover the
        last edited by Alan Kilborn

        @sover-david said in [C#] Gray Out Plugin's Tab Icon:

        Can you gray out the icon of your plugin in the upper tab

        I suppose you are talking about a toolbar button that your plugin has added to the toolbar?

        If so, you could set the graphic on that toolbar to give the appearance of being “greyed” but you wouldn’t actually disable the button to get a system-set greyed appearance, because you said you wanted to keep it possible to click it.

        But really, this is a generic programming issue, and nothing specific to Notepad++, so it really isn’t a great question for this forum, if you need more than what I’ve indicated.

        Sover theS EkopalypseE 2 Replies Last reply Reply Quote 0
        • Sover theS
          Sover the @Alan Kilborn
          last edited by

          @alan-kilborn Yeah I was just asking if there’s some built-in way to do that in notepad++, but I guess not

          Alan KilbornA 1 Reply Last reply Reply Quote 0
          • Alan KilbornA
            Alan Kilborn @Sover the
            last edited by Alan Kilborn

            @sover-david said in [C#] Gray Out Plugin's Tab Icon:

            I was just asking if there’s some built-in way to do that in notepad++, but I guess not

            In this POSTING you mentioned NPPM_LAUNCHFINDINFILESDLG which you either found in the documentation or in the file in the source code called Notepad_plus_msgs.h.

            And based upon your first posting in this thread, in your plugin-under-development you’ve probably successfully added a toolbar icon via NPPM_ADDTOOLBARICON.

            So I think you already have some understanding… These NPPM_ messages are your interface into and out of Notepad++ … this is what I think of when you say “some built-in way to do that in Notepad++”.

            So if there’s a functionality that you DON’T see among these NPPM_ messages, you aren’t going to be able to get that functionality from Notepad++, in a nice prepackaged (i.e., “easy”) form.

            1 Reply Last reply Reply Quote 1
            • EkopalypseE
              Ekopalypse @Alan Kilborn
              last edited by

              @alan-kilborn said in [C#] Gray Out Plugin's Tab Icon:

              But really, this is a generic programming issue, and nothing specific to Notepad++

              Somehow I can’t agree with you here. For me, this falls into the same type of questions as all regex questions. If you replace regex with “another kind of programming language”, this one is even more Npp-relevant than the others, because this one addresses an Npp-specific element, where regex questions actually only address text.

              Alan KilbornA 1 Reply Last reply Reply Quote 2
              • Alan KilbornA
                Alan Kilborn @Ekopalypse
                last edited by

                @ekopalypse

                Disagreement is fine. :-)

                I really don’t see the utility of this forum teaching someone basic C# (I presume) and basic Windows programming.

                Disabling/enabling/changing-the-image-on a toolbar button is basic Windows programming, not something Notepad++ specific. At least as far as I can tell from the original question.

                If we get a question that is related to this, but has a specific Notepad++ tie-in, of course I would let it go through without any sort of challenge of on-topic-ness.

                Something like, perhaps, “when my plugin disables a toolbar button, I can see Notepad++ reenabling it right after, how can I stop that from happening?” (totally made up “problem”).

                Regex questions without a real Notepad++ tie-in are (IMO) annoying. The tie-in there is something interesting and specific to the Boost engine and how N++ uses it. Otherwise, it is all regex and really should be asked somewhere where everyone on the forum is totally excited about regex.

                I’m just trying to keep a maximum of on-topic-ness. Of course, nobody appointed me the “traffic cop” for this forum.

                Right now I’m struggling with a way to shell-open explorer from a PythonScript and put the user in their “Downloads” folder–just can’t seem to make it do it–but I wouldn’t use the P.S. tie-in to Notepad++ to post such a question here. But maybe I just did? :-) No, I didn’t, but I may contact you offline about that @Ekopalypse

                EkopalypseE 1 Reply Last reply Reply Quote 1
                • EkopalypseE
                  Ekopalypse @Alan Kilborn
                  last edited by Ekopalypse

                  @alan-kilborn

                  I really don’t see the utility of this forum teaching someone basic programming ( replaced by me )

                  I agree, but if we stick to the need for questions to be tied to Npp, then I think this question meets the requirement.

                  Right now I’m struggling with a way

                  Hmm … I tried it briefly and it does indeed seem to be a challenge. :-)

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

                    @ekopalypse said in [C#] Gray Out Plugin's Tab Icon:

                    I agree, but if we stick to the need for questions to be tied to Npp, then I think this question meets the requirement

                    Well, I’ve given up trying to police regex questions (because it simply doesn’t work), so in general for other things I just try to hint that people will find better help elsewhere (when they will).

                    I do still try to discourage people that ask regex question after regex question from doing that.

                    Probably for the toolbar icon question, if answered here the likely advice would show it in PythonScript (well, if I were answering it). That could be helpful to the OP, but probably on the right forum (e.g. StackOverflow ?), code in the desired language to do exactly what is wanted is to be found. Thus getting to a better answer faster and not being off-topic (IMO) on this forum – 2 desirable goals.

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