Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

SetCommand() has unneeded parameter #29

Open
dail8859 opened this issue Feb 16, 2017 · 2 comments
Open

SetCommand() has unneeded parameter #29

dail8859 opened this issue Feb 16, 2017 · 2 comments

Comments

@dail8859
Copy link
Contributor

SetCommand() currently takes an index as its first parameter. It uses this to set the _cmdID field. However, this is a field N++ sets internally. All of my C++ plugins just set the initial value of _cmdID to 0 and it has always worked fine. Since removing that parameter would break backwards compatibilty with older versions of the plugin pack you may want to wait till a "stable" 1.0 release or just do it now since it is very easy for developers to make the change.

Something else to note, there are cases where you need to store the index, like this example. Instead of making the developer manually count what index it is getting inserted at, you can make SetCommand() return the newly added index, so that the example I referenced will look like this:

idMyDlg = PluginBase.SetCommand("MyDockableDialog", myDockableDialog);
@kbilsted
Copy link
Owner

great maybe it fixes #17

@dail8859
Copy link
Contributor Author

Hmm, not sure if it is related or not. I would think if wrong command IDs are getting used it would run into issues much sooner.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants