Plugin Source

  • Hi,
    Some of the plugins don’t have source code(?). I’m interested in adding to the toolbar.
    customize-toolbar has a download but no source code that i can find…
    Is this a policy? And…Can anyone point me to documentation where I can find how to add toolbar events and icons?

  • @Tod-Mar

    every free plugin developer has the right to freely share his source code for free, as well as having the free right to omit any further free publication, to eventually protect his and/or her intellectual property.

    additionally: as soon as you would be able and ready to modify, for example @dave-user 's customize toolbar plugin, you will have enough knowledge to write it from scratch, as you will be quicker doing that than to read and comprehend the existing code.

  • There is no requirement for a plugin to publish its source code. Even when available, the source code usually won’t come bundled if you download it through the Plugins Admin. You can check the plugin’s individual website to see if it’s available.

  • Something strange …plugins which I use you can freely download the source code

    And the authors of these plugins helped me with advice on how to compile these projects! For which they thank you!

  • @andrecool-68

    yes, and most of the plugins are open source.

    but there are many developers that published source code, and had a very bad experience, as some rogue entities took profit on selling it, and worst case, trying or accomplishing to patent, what they have taken from another person’s open source project.

    so i can fully understand why some developers, especially the ones with a lot of bad experiences, choose to omit to publish any further source codes.

  • @Meta-Chuh
    Me a thief and a bad seller turns out)))
    Parents are not taught to steal)))

  • @andrecool-68

    of course i did not mean you, but big, big enterprises.
    i hope this was a joke from you, because otherwise maybe you need a better translator after all 😉

  • @Meta-Chuh
    A translator is a robot, not a living person. You want to say one thing, but it turns out quite another.

  • Super I’m glad I started the conversation but my 2nd question was where to find any doc. about adding icons to the toolbar and getting their events. I can search and find it but if anyone can point me anywhere. Also…the code here is classic Windows code without even MFC or ATL/WTL I assume?

  • @Tod-Mar said:

    the code here is classic Windows code without even MFC or ATL/WTL I assume?

    Yes…double-edged sword I guess. Personally, I’m glad it is not MFC-based. I always found MFC to be a joke.

  • Yet some plugins are C#. I thought C# was only a .Net platform, but they could be compiled with .NET Native…

  • @Tod-Mar

    You can write plugins in a lot of languages. Notepad++ itself is as you said, “classic Windows code”, C++ and straight Windows API function calls, so maybe the natural choice for a plugin is to stick with same.

  • So you do everything using window handles and messages? how about icons/images? (looking at the toolbar…)

  • @Tod-Mar

    When I started to develop plugins for Notepad++ the following links have been helpful:

    How to develop a plugin or a lexer
    Messages and notifications
    Sources of plugin interface
    Scintilla documentation

    Regarding toolbar buttons

    The handling of toolbar buttons is totally transparent to a plugin developer because they work like a menu entry.

    A plugin developer has to fill an array at plugin’s startup that contains structs of type FuncItem. Every array element describes a menu entry of the plugin (text, click handler function, menu command id, Checked state, and keyboard shortcut).

    Notepad++ queries a pointer to this array at a certain time in the startup process. It generates the menu entry of the plugin in the Plugins menu, adds for every array element a submenu entry and fills the menu command id member of the array elements. So you know the menu command ids of your menu entries.

    If you want to have a toolbar button you have to hook the NPPN_TB_MODIFICATION event sent by Notepad++ to your plugin. In the handler of this event you have to fill a struct of type toolbarIcons (please note: you have to fill only one of its two members, either hToolbarBmp or hToolbarIcon but it seems only the first one works). The bitmap whose handle you provide has to be in a 8 bits-per-pixel palletized format (max. 256 colors) and its size has to be 16x16 pixels. Then you can send a NPPM_ADDTOOLBARICON event to Notepad++ where you provide the menu command id of the menu entry which you want to connect with your toolbar button and a pointer to the toolbarIcons struct you filled before.

Log in to reply