macMikey / LCB-missing-manual

I'm trying to learn LCB, again, but the docs are thin.
MIT License
4 stars 4 forks source link

Custom Property Editor - location, how to cause it to load? #38

Closed macMikey closed 1 year ago

macMikey commented 1 year ago
macMikey commented 1 year ago

the stack exists in the editors subfolder, the way it does for the PB/PL/PG what doesn't work: metadata itemArray.editor is "/editors/com.livecode.pi.navRAD" metadata itemArray.editor is "editors/com.livecode.pi.navRAD"

macMikey commented 1 year ago

found in revInspectorBehavior.livecodescript:

   # open editor stack if it exists
   if there is not a file tEditorStackPath then 
      # check if an extension has provided its own editor
      # it is named <id>.editor.editorName
      local tId, tPath
      set the itemdelimiter to "."
      put item 1 to -3 of pEditor into tId
      put revIDEExtensionProperty(tId, "install_path") into tPath
      put tPath & "/editors/" & pEditor & ".livecode" into tEditorStackPath
      put tPath & "/editors/" & pEditor & ".behavior.livecodescript" into tEditorBehaviorPath
   end if

so the rule is:

  1. put it in the editors folder at the level of the .lcb file
  2. the name doesn't really matter. if the editor stack name is com.livecode.widget.navRad.editor.navData.livecode then the behavior is com.livecode.widget.navRad.editor.navData.behavior.livecodescript and the use line is metadata itemArray.editor is "com.livecode.widget.navRad.editor.navData"
BerndN commented 1 year ago

Bravo.

macMikey commented 1 year ago

documented in the wiki