Home › Forums › XMetaL Tips and Tricks › Script Example: Add Edit Attribute and Insert Element Functions to Context Menu › Reply To: Script Example: Add Edit Attribute and Insert Element Functions to Context Menu
Reply to: Script Example: Add Edit Attribute and Insert Element Functions to Context MenuAugust 11, 2010 at 8:27 pm
I updated this sample code to address the issue mentioned by bzebian. It uses an XFT form instead of the builtin “Prompt()” API so that it can detect which button was clicked.
Usage instructions and all other information is the same as before except there are now two files that you must place in the Startup folder together: demo_contextMenuElemListAttrInsp.mcr and Edit_attribute.xft.
I tested this XFT form with XMetaL 6.0.1.030, but I believe it should work with previous versions going years back. If anyone has problems, please let us know.
One remaining nuisance is that I can't see a way to “pre-select” an existing attribute value when it is placed into the form. Instead, the cursor goes at the beginning of the field. I suspect this is a limitation of XFT, but if anyone knows a trick, I'd be interested to hear it.