Resources/Tutorial for Next Steps in Plugin Development?
-
I want to make a simple plugin for fun/work automation, and I found the C++ demo plugin and downloaded that. I have run it successfully!
I have:- Added my own menu item and function
- Able to grab text from clipboard via Windows.h
- Figured out that the plugin environment communicates to the “actual” editor via SendMessage
- Anything you want to do in the text window of the editor is bascially a Scintilla call, so thats easy to look up/brute force
- With this, I’m able to manipulate text in the clipboard, insert the text, and move the caret around as I want.
I also can see how to make a MessageBox from the demo plugin, but there’s just an OK button, no input boxes, radio buttons, text fields, etc.
I am kind of (very) lost on how to implement these features into a popup window when you click on the plugin.
I want the flow to be like this:- Copy text to clipboard
- Run plugin
- Plugin asks for a couple number inputs and maybe a couple radio buttons/check boxes. Then, I want the box to close and then paste your text that is manipulated based on your inputs.
How can I do this?
-
@Patrick-Jackson said in Resources/Tutorial for Next Steps in Plugin Development?:
I have run it successfully!
Seems like you’ve come a pretty long way down the path. Congrats!
Plugin asks for a couple number inputs and maybe a couple radio buttons/check boxes
Seems like you’ll have to dive into the world of generic Win32 C/C++ UI programming for that. That’s fairly off-topic for this forum, however, so…good luck.
-
@Patrick-Jackson said in Resources/Tutorial for Next Steps in Plugin Development?:
I also can see how to make a MessageBox from the demo plugin, but there’s just an OK button, no input boxes, radio buttons, text fields, etc.
I am kind of (very) lost on how to implement these features into a popup window when you click on the plugin.
If you haven’t written C or C++ programs using the Win32 API before, expect to need some time to get a grasp of that. The particular thing you need to look at is called a dialog box; but that will lead to other questions, which are (as Alan pointed out), too far off-topic for this forum. If you are using Visual Studio, you can design dialog boxes visually using the Resource View… but that, too, is still quite complex and not within the range of this forum.
If you are writing a simple plugin for personal use and don’t want to spend a lot of time on the Win32 learning curve, you might be better served to look at the scripting plugins for Notepad++, such as jn NotePad++ Plugin, LuaScript or PythonScript.
-
@Coises said in Resources/Tutorial for Next Steps in Plugin Development?:
If you are writing a simple plugin for personal use and don’t want to spend a lot of time on the Win32 learning curve, you might be better served to look at the scripting plugins for Notepad++, such as jn NotePad++ Plugin , LuaScript or PythonScript .
Indeed, even if not “simple” there’s nothing wrong with writing something for others in a scripting language. [ It probably even avoids THIS situation. ]
I did this at work and several hundred people were using it. In other words, no shame in scripting!
Thanks to another frequent contributor on the forum here, PythonScript has some nice dialog capability now.
-
This doesn’t exactly solve your problems with the C++ template, but…
I (along with several others) have made plugins with C#, rather than C++. The plugin template all the aforementioned plugins is here.
You can stop reading here if you dislike sales pitches for programming languages.
Reasons why I think using C# instead of C++ is a good idea:
- Windows Forms
- Visual Studio has a GUI so you don’t need to edit special config files to edit your forms
- Powerful controls like the TreeView (a huge help in the development of my JsonTools plugin)
- I find the event-and-subscriber-based system for handling events like clicking on the controls to be very intuitive
- Windows Forms have a lot of events defined, making it easy to respond to lots of types of user actions
- C# has nice productivity features and a garbage collector.
- C# is really fast. Seriously, though. I have definitely noticed plugins written in C# that perform X task faster than a comparable plugin implemented in C++.
- Windows Forms