Extend plugin "RegisterDocumentAction" with codetypes.

Let us know what you would like to see in the next version of this software

Moderator: kfury77

Forum rules
Please follow these guidelines when posting feature requests. This will help to increase the value of your contribution.

  • Do not create new topics for already requested features. Add your comments to the existing feature request topics instead;
  • Create separate topic for each feature suggestion. Do NOT post a number of non-related feature suggestions in a single topic;
  • Give your topic a meaningful title. Do NOT create topics with meaningless titles, such as "My Suggestion" or "My Problem".

Please note that we DO READ all suggestions, even if a reply is not posted. Thanks!

Extend plugin "RegisterDocumentAction" with codetypes.

Postby pmk65 » Thu Jul 02, 2015 2:26 pm

Currently when a plugin uses "RegisterDocumentAction", a menuitem is added to the Plugins menu.
When no document is open, the menuitem is disabled. When document is open, the menuitem is enabled.

But it would be smarter if you could control in which documents/codetypes the menuitem should be enabled.
Let's say I write a plugin to process only PHP code, then there's no need for the menuitem to be enabled in HTML/CSS code etc.

Current implementation:
Code: Select all
Script.RegisterDocumentAction(<submenu>, <menuitem>, <shortcut>, <function>);


Suggested changes:
Code: Select all
Script.RegisterDocumentAction(<submenu>, <menuitem>, <shortcut>, <codeTypeList>, <function>);

<codeTypeList> could be something like: [ltPHP, ltJScript] to allow plugin in PHP and JavaScript code. Or empty to allow in all codetypes.

Or even better:
Code: Select all
Script.RegisterDocumentAction(<submenu>, <menuitem>, <shortcut>, <iconfile>, <codeTypeList>, <function>);

Where <iconfile> is a path to an icon image for use as menu icon.
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark

Re: Extend plugin "RegisterDocumentAction" with codetypes.

Postby Aivars » Thu Jul 23, 2015 3:54 pm

I could add an additional signal for when surrounding code (possibly) changes (the same place that disables and enables CSS toolbar actions) which will allow you to enable/disable your actions. Making it exactly the way you want would require some architectural changes that I'd like to avoid.
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2453
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Extend plugin "RegisterDocumentAction" with codetypes.

Postby pmk65 » Fri Jul 24, 2015 3:36 pm

The code change I posted was just meant as an examples/idea. I just figured it was the most logic place to put it.

How you implement the feature doesn't really matter, just as long as you can enable/disable a plugin at specific code/document types.
And add menu icon(s) :D
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark


Return to HTMLPad / Rapid CSS / Rapid PHP / WeBuilder Feature Requests

Who is online

Users browsing this forum: No registered users and 13 guests