john at splash21.com
Sat Jun 29 03:33:25 EDT 2013
I just double checked with community 6.0.2 and it works fine.
Set up 2 frontscripts with something like the foloowing code. Stick a
slightly different message in each one for identification of which is which.
When right clicking in the editor, you'll see both customizations are
there and they both work as expected.
on revHookBuildScriptEditorContextMenu pObject, pSelectedText, @pText,
put "Script Editor Customization" & LF & "-" & LF before pText
on revHookScriptEditorContextMenuPick pItem
if pItem = "Script Editor Customization" then
answer "Run your custom code!"
exit to top
On 28/06/2013 22:48, Peter Haworth wrote:
> Hi John,
> I was hoping that would work too, but it doesn't seem to in my testing. I
> set up two front scripts, each with a handler with a
> revHookBuildScriptEditorContextMenu in it and a pass statement at the end
> but only one of them was executed.
> I think it's because it's not a built-in LC message, just something that
> is dispatched from the script editor mouseDown handler ,so the first
> handler to see it is executed then control goes right back to the statement
> after the dispatch.
> Same problem occurs with the revHookScriptEditorContextMenuPick handling.
> Hope I'm wrong but don't think so :-)
> lcSQL Software <http://www.lcsql.com>
> On Fri, Jun 28, 2013 at 1:24 PM, John Craig <john at splash21.com> wrote:
>> Hi, Pete. As long as you pass the message, the other frontscripts will
>> also receive the message, so you're not limited.
>> On 28/06/2013 19:54, Peter Haworth wrote:
>>> I would like to use the above to add some items to the script editor
>>> contextual menu but I see from a recent discussion that only one plugin's
>>> front script will receive the message.
>>> Does anyone have any thoughts on a cooperative architecture that can be
>>> implemented now to allow multiple plugins to have access to this hook?
>>> Perhaps a custom property of the IDE Home stack (in the uRIP property
>>> that defines the plugin stack name/handler to be invoked by the hook?
>>> Would still need a generic front script to trap the hook message and
>>> the defined plugin handlers.
>>> lcSQL Software <http://www.lcsql.com>
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the Use-livecode