Project plugin functionality
-
yes, you need to use Win32 api calls to interact with the FAW.
Something like what I am doing here. -
thx for the reply
my win32 skills are very rusty so if someone could show me an example of how to receive the file list from the workspace or something simpler I would appreciated it
I’m coding with C#
thx!
-
@General-Coder said in Project plugin functionality:
my win32 skills are very rusty so if someone could show me
As I said earlier,
… but that’s a generic Win32 programming problem and you would probably find more answers at a site for Win32-programming in specific or at a stack overflowing with programming questions;
Given your recent comments that you want to grab the list of files out of the treeview, I might recommend searching the internet for
c# csharp win32-api grab values from treeview control
along with the other searches I recommended above. Or use Eko’s example – it might be in a different programming language, but it gives the same basic idea, and one benefit of the “win32 API” being an “API” is that the function names are the same across languages (or mostly so). But, in general, this Community focuses on Notepad++, and this Plugin Development category is focused on the Notepad+±specific aspects of plugin programming; a plugin programmer is expected to understand how to do the generic win32 API framework around their Notepad+±specific calls. And extracting the list out of a treeview control is not specific to Notepad++. -
Well I’ve learned reading the treeview is not an easy task especially if you are using C#.
So I would like to forget it. But what about the functions list in notepad++, can you somehow use that? And can you allow jump to function definition via context menu. I should probably make a new thread about this… -
@General-Coder said in Project plugin functionality:
I should probably make a new thread about this…
Don’t bother.
what about the functions list in notepad++, can you somehow use that?
Nope. The Function List panel also does not have any messages for a plugin to call, so once again, you would be using the generic Win32 API calls – and IIRC, it’s a TreeView as well, so there’s no benefit of trying to access that over trying the Project or FolderAsWorkspace.
-
What about my own context menu entry (that calls my C# function) or custom hovering tooltip type display, are those possible?
-
What about my own context menu entry (that calls my C# function) or custom hovering tooltip type display, are those possible?
I am sure such are possible. I think they are probably done with standard Win32 API calls, but I don’t know for sure. I know that some of the other regulars here have done their own popups and such, so hopefully someone else will be able to give you pointers as where to go next.
-
If it is the context menu that opens in the Scintilla area, then it is editable via
Settings->Edit Popup ContextMenu
. See here. But if you’re thinking of having it in other dialogs like FAW, Project Panel, or third-party plugins like NppExec, then you’ll need to subclass the appropriate window message queue and catch the messages you’re interested in, do your own thing, and let the main message handler know that this was done to prevent the main action from being executed. -
I have put my own entry to the context menu via xml but now would like to do that via C# plugin. Is this possible?
The link you gave me brings up security warning (which is why I haven’t been reading those docs)I’m also wondering if it’s possible to use windows form under notepad++ process or do I have to use np++ own window creation commands?
I was able to create the form but it’s in independent process.
-
@General-Coder said in Project plugin functionality:
The link you gave me brings up security warning (which is why I haven’t been reading those docs)
This has been fixed and so https://npp-user-manual.org/docs/config-files/#the-context-menu-contextmenu-xml should now be viewable.
-
@General-Coder said in Project plugin functionality:
… now would like to do that via C# plugin. Is this possible?
Yes, you need to subclass the wndproc …
… possible to use windows form under notepad++
Even though I’m not a C# developer, I can say that yes, you can.
The .Net framework is basically a wrapper around the Win32 API.
You just need to make sure that you pass the expected values to Npp. -
couple questions
how do you center the view on line? I used SciMsg.SCI_GOTOLINE to go to the line but it doesn’t center the view
also is it possible to get the text under the cursor? i can get selection but this one I havent figured out yet
thx
-
@General-Coder said in Project plugin functionality:
couple questions
What you are asking about are some Scintilla functions.
The Scintilla docs are HERE. -
hey, thx I’m aware of the scintilla docs but they are pain to read so i thought I’d ask scintilla experts here.
that’s where I found the SCI_GOTOLINE ;) -
@General-Coder said in Project plugin functionality:
but they are pain to read
Nobody here wants to spoon-feed you. Sorry.