General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion Override opening element on click event

  • NandoC

    Override opening element on click event

    Participants 2
    Replies 3
    Last Activity 8 years, 1 month ago

    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?

    Reply

    Derek Read

    Reply to: Override opening element on click event

    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.

    Reply

    NandoC

    Reply to: Override opening element on click event

    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.

    Reply

    Derek Read

    Reply to: Override opening element on click event

    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.

    Reply

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

Lost Your Password?

Products
Downloads
Support