Hello,
I am wondering whether anyone can help me with integrating a CorelDraw GMS file in CorelDraw menu bars.
Some time ago, I created a GMS add-on which worked perfectly in CorelDraw X5 and X6 (32-bit). The add-on folder was located under "Programs\Addons\" directory inside "C:\Program Files (x86)\Corel\...". As instructed at https://community.coreldraw.com/sdk/w/articles/173.custom-add-ons-in-coreldraw-corel-designer-and-corel-photo-paint , it contained 4 files: AppUI.xslt, UserDraw.xslt, coreldrw.addon and the GMS file itself. The add-on installed a top-level menu called "Translation Toolbox" with 2 subitems which, when clicked, ran appropriate subs defined in the GMS file.
For X7 version, I renamed UserDraw.xslt to UserUI.xslt as instructed at https://forum.oberonplace.com/blog.php?b=39018 and recompiled it for the new object model in CorelDraw X7. I can run the add-on commands from the Macro Manager panel, but no command bar menu items are created, even if I reload the workspace with F8. I use CorelDraw X7 64-bit if this is important for the XSLT file structure (previously I didn't test in 64-bit versions of X5 and X6).
Here are the contents of the XSLT files:
================================AppUI.xslt================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:frmwrk="Corel Framework Data"> <xsl:output method="xml" encoding="UTF-8" indent="yes"/> <frmwrk:uiconfig> <frmwrk:applicationInfo userConfiguration="true" /> </frmwrk:uiconfig> <xsl:template match="node()|@*"> <xsl:copy> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </xsl:template>
<xsl:template match="uiConfig/items"> <xsl:copy> <xsl:apply-templates select="node()|@*"/> <itemData guid="edfed38e-72d0-4a87-8e3b-bd5a6dba64ab" flyoutBarRef="397eee82-dec3-448a-8bdc-be59d45437e7" userCreated="true" noBmpOnMenu="true" userToolTip="Commands for exporting translatable text and importing translations" userCaption="Translation Toolbox"/>
<itemData guid="ae7bd48f-649b-4489-b50a-cea1322257c3" dynamicCommand="TranslationToolbox.Translation.Export" dynamicCategory="2cc24a3e-fe24-4708-9a74-9c75406eebcd" userCaption="Export Text for Translation" userToolTip="Export translatable text from the current document to a Word table"/> <itemData guid="7030b9e9-7ec2-4109-a905-add11f459bcf" dynamicCommand="TranslationToolbox.Translation.Import" dynamicCategory="2cc24a3e-fe24-4708-9a74-9c75406eebcd" userCaption="Import Translation" userToolTip="Import translation into the current document from translated Word table"/> </xsl:copy> </xsl:template>
<xsl:template match="uiConfig/commandBars"> <xsl:copy> <xsl:apply-templates select="node()|@*"/> <commandBarData guid="397eee82-dec3-448a-8bdc-be59d45437e7" type="menu" nonLocalizableName="Translation Toolbox" flyout="true"> <container> <item guidRef="ae7bd48f-649b-4489-b50a-cea1322257c3"/> <item guidRef="7030b9e9-7ec2-4109-a905-add11f459bcf"/> </container> </commandBarData> </xsl:copy> </xsl:template> </xsl:stylesheet>
================================UserUI.xslt (previously UserDraw.xslt)================================
<?xml version="1.0"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:frmwrk="Corel Framework Data"> <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
<frmwrk:uiconfig> <frmwrk:applicationInfo name="CorelDRAW" framework="CorelDRAW" userConfiguration="true" /> <frmwrk:compositeNode xPath="/uiConfig/commandBars/commandBarData[@guid='f3016f3c-2847-4557-b61a-a2d05319cf18']"/> <frmwrk:compositeNode xPath="/uiConfig/frame"/> </frmwrk:uiconfig>
<xsl:template match="node()|@*"> <xsl:copy> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </xsl:template>
<xsl:template match="uiConfig/commandBars/commandBarData[@guid='f3016f3c-2847-4557-b61a-a2d05319cf18']/container/container[@modeID='76d73481-9076-44c9-821c-52de9408cce2']/item[@guidRef='6c91d5ab-d648-4364-96fb-3e71bcfaf70d']"> <xsl:copy> <xsl:apply-templates select="node()|@*"/> </xsl:copy> <item guidRef="edfed38e-72d0-4a87-8e3b-bd5a6dba64ab"/> </xsl:template> </xsl:stylesheet>
----
I will appreciate any help. Thank you!
Best regards,Stanislav