General XMetaL Discussion
XMetaL Community Forum › General XMetaL Discussion › Xmetal Toolbar macro
-
pooh2583 September 18, 2012 at 7:05 am
Xmetal Toolbar macro
September 18, 2012 at 7:05 amParticipants 13Replies 14Last Activity 10 years, 4 months agoHow to Add Macro to Xmetal toolbar icon like B I U?
to listen to the events on those toolbar iconsDerek Read September 18, 2012 at 7:33 pm
Reply to: Xmetal Toolbar macro
September 18, 2012 at 7:33 pmIf 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.
pooh2583 September 19, 2012 at 10:58 am
Reply to: Xmetal Toolbar macro
September 19, 2012 at 10:58 amHi,
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
Derek Read September 19, 2012 at 5:24 pm
Reply to: Xmetal Toolbar macro
September 19, 2012 at 5:24 pmIf 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.
pooh2583 September 25, 2012 at 9:31 am
Reply to: Xmetal Toolbar macro
September 25, 2012 at 9:31 amHey 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 addedproperty 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 farCould you please guide for this functionality
Thanks
Derek Read September 26, 2012 at 8:44 pm
Reply to: Xmetal Toolbar macro
September 26, 2012 at 8:44 pmBest to have a look at the Journalist customization again. It enables the most basic version of this functionality.
pooh2583 October 5, 2012 at 5:14 am
Reply to: Xmetal Toolbar macro
October 5, 2012 at 5:14 amHi,
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
Derek Read October 5, 2012 at 4:42 pm
Reply to: Xmetal Toolbar macro
October 5, 2012 at 4:42 pmThere is no other way. You must use the documented method for adding custom icons to the installation.
pooh2583 October 10, 2012 at 9:26 am
Reply to: Xmetal Toolbar macro
October 10, 2012 at 9:26 amHi,
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 lineinstead it has to be in this format
1.this is first lijne
2.this is second line
3.this is third lineI 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 ReplyThanks
Derek Read October 10, 2012 at 5:31 pm
Reply to: Xmetal Toolbar macro
October 10, 2012 at 5:31 pmLooks 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.
pooh2583 October 11, 2012 at 9:00 am
Reply to: Xmetal Toolbar macro
October 11, 2012 at 9:00 ampooh2583 November 21, 2012 at 6:09 am
Reply to: Xmetal Toolbar macro
November 21, 2012 at 6:09 amHi,
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 onlyPlease reply
RegardsDerek Read November 21, 2012 at 6:14 pm
Reply to: Xmetal Toolbar macro
November 21, 2012 at 6:14 pmThis 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.
pooh2583 November 22, 2012 at 9:24 am
Reply to: Xmetal Toolbar macro
November 22, 2012 at 9:24 amHi,
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
Derek Read November 22, 2012 at 11:01 pm
Reply to: Xmetal Toolbar macro
November 22, 2012 at 11:01 pmThis 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?) -
AuthorPosts
- You must be logged in to reply to this topic.