General XMetaL Discussion
XMetaL Community Forum › General XMetaL Discussion › Override opening element on click event
-
NandoC August 19, 2014 at 1:24 pm
Override opening element on click event
August 19, 2014 at 1:24 pmParticipants 2Replies 3Last Activity 8 years, 5 months agoI am looking to customize the on click event on the opening element tag that makes a select all node. Is there a way around this?
Derek Read August 28, 2014 at 9:45 pm
Reply to: Override opening element on click event
August 28, 2014 at 9:45 pmI'm not sure which feature you are describing. Please describe your need in more detail.
Which product is this for?
Which schema are you working with?
Which element?
What do you mean by “makes a select all node”?
Plus what you want it to do instead.NandoC September 10, 2014 at 2:53 pm
Reply to: Override opening element on click event
September 10, 2014 at 2:53 pmI am using Xmetal 7.0.
I have a function that selects/highlights a parent Node
XmetalControl.Selection.SelectNodeContents(parent)
XmetalControl.Selection.SelectElement()This is working well, but the issue I am having is that if the node is longer that what is displayed on the screen, the editor scrolls to the end of the Node, is there a way to prevent the scrolling from happening?
Thanks.
Derek Read September 10, 2014 at 6:05 pm
Reply to: Override opening element on click event
September 10, 2014 at 6:05 pmGiven your code it looks like this is XMAX?
When I asked about which product I was hoping for one of these:
XMetaL Author Enterprise
XMetaL Author Essential
XMAXThe code you have quoted here will likely run the same in all three products.
I suspect your issue with scrolling can be resolved by using Range instead of Selection. The former generally does not move the selection, the latter does. In a few cases using Range will move the selection. Some Range APIs have no option but to do that — the most obvious being Range.Select(). In those cases the solution is to store the current range in a variable, then create another one you will use to make your document changes and when all of that is complete restore the selection to the stored range. If the changes you make to the document have not messed up the original selection (deleting it for example) then you can often restore it. -
AuthorPosts
- You must be logged in to reply to this topic.