Hiding stacks from the project browser

Monte Goulding monte at sweattechnologies.com
Thu Apr 11 23:18:36 EDT 2013


On 12/04/2013, at 12:51 PM, Monte Goulding wrote:

> Would be better if this function dispatched to the actual stack so we didn't need to implement frontscripts for every plugin...

yeah... actually only one plugin can handle this but showing IDE stacks does bring them all back to the list... here's my implementation for my in-house custom controls which each have their own stackfile so they clutter up these lists.

function revHookIsUserStack pStack
   if word 1 of the short name of pStack is "LiveObject" then
      return false
   end if
   return true
end revHookIsUserStack

I've spotted a hook like this before that's a nice idea but the implementation hasn't been thought through because it could also only be used by a single plugin. This hook adds a Sign menu item to the script editor context menu.

on revHookBuildScriptEditorContextMenu pObject,pSelectedText,pText, at pModifiedText
   put pText&"-"&cr&"Sign" into pModifiedText
end revHookBuildScriptEditorContextMenu

on revHookScriptEditorContextMenuPick pItem
   if pItem = "Sign" then
      put the htmlText of the selectedChunk into tText
      put the seconds into tDate
      convert tDate to dateItems
      put item 1 of tDate&"-"&item 2 of tDate&"-"&item 3 of tDate into tDate
      set the htmlText of the selectedChunk to "<p>#### START MG "&tDate&cr&"</p>"&tText&cr& "<p>#### END MG "&tDate&"</p>"
   end if
   pass revHookScriptEditorContextMenuPick
end revHookScriptEditorContextMenuPick


For potential IDE contributors to improve the implementation these should be messages so they can be passed and they should check unhandled rather than handled to take account of the passed condition. Otherwise as I said they can only be handled by a single plugin.

--
M E R Goulding 
Software development services
Bespoke application development for vertical markets

mergExt - There's an external for that!




More information about the use-livecode mailing list