Pages: 1
Print
Author Topic: Override opening element on click event  (Read 2450 times)
NandoC
Member

Posts: 4


« on: August 19, 2014, 07:24:27 AM »

I 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?
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #1 on: August 28, 2014, 03:45:37 PM »

I'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.
Logged
NandoC
Member

Posts: 4


« Reply #2 on: September 10, 2014, 08:53:46 AM »

I 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.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #3 on: September 10, 2014, 12:05:10 PM »

Given 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
XMAX

The 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.
« Last Edit: September 10, 2014, 12:07:40 PM by Derek Read » Logged
Pages: 1
Print
Jump to: