General XMetaL Discussion

  • pooh2583

    Xmetal Toolbar macro

    Participants 13
    Replies 14
    Last Activity 10 years ago

    How to Add Macro to Xmetal toolbar icon like B I U?
    to listen to the events on those toolbar icons

    Reply

    Derek Read

    Reply to: Xmetal Toolbar macro

    If you are an author see XMetaL Author help (F1) topic “Associate a macro with a toolbar button”, or online version here:
    [url=http://na.justsystems.com/webhelp/en/xmetalauthor/enterprise/7.0/XMEE.html#Associate%20a%20macro%20with%20a%20toolbar%20button]Associate a macro with a toolbar button[/url]

    If you are a developer (customizing XMetaL Author for end users) please see the Customization Guide topic “Treat As” and the subsection “Toggling Elements”. No scripting is required in this case, just a CTM file change to associate those buttons with specific elements. See the online version of this topic here: [url=http://na.justsystems.com/webhelp/en/xmetaldeveloper/cg/6.0/cg.html#Treat%20As]Treat As[/url]

    If you have a DTD that needs to do more with the markup than simply wrap text in an element (which is what the Treat As setting above does) then additional scripting will be required. Assuming you have written the script to create the proper markup already connecting it to those buttons is quite a bit more challenging. The recommended method is add buttons to a toolbar using the CommandBars API. The same script may also remove the existing buttons. See the Programmers Guide for information on this API.

    Reply

    pooh2583

    Reply to: Xmetal Toolbar macro

    Hi,

    Thanks for the reply.

    I have written 3 Macros  for OnAction of B I U toolbar buttons, in those Macro file I have written Selection.ToggleInline(“b”) and i , u respectively for  I , U buttons, when i click B it element gets added n text becomes bold ,but on the same cursor location if I click I Or U the style is not applied, it fails to add those , elements inside

    Reply

    Derek Read

    Reply to: Xmetal Toolbar macro

    If that is the case then perhaps the DTD does not support this type of nesting?

    If it does, then it sounds like the document model is similar to the Journalist sample. I would recommend having a look at that. In your case it is likely as simple as setting the relevant settings in the CTM file similar to journalist.ctm and in that case there is no need for any macros.

    Reply

    pooh2583

    Reply to: Xmetal Toolbar macro

    Hey Thanks a lot ,

    I made changes in .ctm and DTD file and it is working fine for B, I , U

    Now I have to develope the functionality for Numberdlist and OrderderList? have to assign two elements to 2 of them ? I have assigned the 2 elements using .ctm file and they are getting created when I click on the respective icon  but it is not having the actual functionality.
    I have added property in .ctm file so that when my cursor is in listitem and press Enter then another listitem should be created.
    but that functionality is not achieved so far

    Could you please guide for this functionality

    Thanks

    Reply

    Derek Read

    Reply to: Xmetal Toolbar macro

    Best to have a look at the Journalist customization again. It enables the most basic version of this functionality.

    Reply

    pooh2583

    Reply to: Xmetal Toolbar macro

    Hi,

    I have created a  button on the toolbar using script and assigned the .bmp image (not a built in icon)image to it using Makefaceid, the image has been placed in the XmetalAuthorIconsAnnoation Custom, but is there any other way I can place that image in the projects folder and assign that image to the button.

    Thanks

    Reply

    Derek Read

    Reply to: Xmetal Toolbar macro

    There is no other way. You must use the documented method for adding custom icons to the installation.

    Reply

    pooh2583

    Reply to: Xmetal Toolbar macro

    Hi,

    I am using numberdlist and orderlist item customiztion, in that i have customized elements to those icons on the toolbar using.ctm file
    but when I press enter carriage enter is not retuned,when i press ENTER though the cursor goes down(to the next line) ,Xmetal considers that whole as a one line and instead of creating bullet it gives 1 bullet to the enter thing in that Tag element
    Eg.

    1. this is first line
    this is second line
    this is third line

    instead it has to be in this format

    1.this is first lijne
    2.this is second line
    3.this is third line

    I have written following code in my .ctm file

      ListItem
        item
         
       
       
     
     
    I have checked sample journalist  ctm and dtd file and did chages as per the requirements, but still it is not working
    What changes i need to do?
    Please Reply

    Thanks

    Reply

    Derek Read

    Reply to: Xmetal Toolbar macro

    Looks to me like your CSS file probably has “white-space:pre” set for your list items so that white-space is being rendered, and that includes carriage returns.

    The section you have posted here from your CTM doesn't do anything except set up the pretty printing options. It does not control list behaviour. That is contained in a separate section. Might be easier for you to work with XMetaL Developer as configuring these types of CTM properties can be done with the CTM editor and accompanying documentation. Or have another look at the CSS and CTM files for Journalist as everything is in there.

    Reply

    pooh2583

    Reply to: Xmetal Toolbar macro

    Hey Thanks a lot

    It is working properly now.

    Reply

    pooh2583

    Reply to: Xmetal Toolbar macro

    Hi,

    I am developing a code for Mouse_over macro in which when my mouse is over the specific element it shold be seen as a hyperlink,i.e cursor is changed to hand cursor ad color of the text of the node should change.

    my element stucture is
    text-string
    aaa
    ….
    ..
    ajgh

    my functionality is when my mouse is over the node named the color of the tesxt-string should change and cursor

    bI am using following code from journalist.mcr
    var curNode = Application.MouseOverNode;
     if (curNode) {
       var nodeName = curNode.NodeName;
       if (nodeName == “element”) {
         Application.SetCursor(sqCursorHand);
         var rng = ActiveDocument.Range;
         rng.SelectNodeContents(curNode);
         rng.ContainerStyle = “color:red”;
         rng = null;
         return;
       }

    but the above code changes the color of the entire content of the including subelement,I just want the color of the(PCDATA) ie. text-string to be changed(marked as bold)

    what is the  way to select only the PCDATA string i.e text-string “text-string”
    and change the color of that TEXT-Node only

    Please reply
    Regards

    Reply

    Derek Read

    Reply to: Xmetal Toolbar macro

    This type of CSS modification cascades to child elements as well (as per the standard CSS cascading rules). So, if in your CSS file the child elements are inheriting their text colour from the parent (which is the default if they do not have the “color” property explicitly set) then that is probably what is happening.

    The easiest fix is to set the “color” property for the children in the CSS file.

    Reply

    pooh2583

    Reply to: Xmetal Toolbar macro

    Hi,

    Thanks for a reply

    Could ypu please explain how to check whether the string enetered in atext field  is a numeric value or not in Xmetal using JScript?

    Please Reply

    Regards

    Reply

    Derek Read

    Reply to: Xmetal Toolbar macro

    This sounds like a completely new subject. Let's try to keep the forum making sense for other people reading it.
    Please submit this as a new post (don't reply here) and add some more detail (is this in an XFT form or something else?)

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support