Skip to main content
5-Regular Member
April 6, 2023
Question

Arbortext Listener C++ - Class Libraries

  • April 6, 2023
  • 1 reply
  • 865 views

Seeking advice from any Arbortext Developer in C++ who has successfully accessed the Arbortext IDOMEventListener class. Objective, add a custom left mouse click to the interface. 
There are no ACL calls for the mouse interface.
Attached is the Class view in Visual Studio V2022.
There is one undocumented page, C++ sample in the knowledge base shows AttachListener in 10 lines. 

 

Any advice  welcomed will share the magic.

 

 

 

 

 

 

 

 

 

1 reply

18-Opal
April 20, 2023

If you just want a click listener and don't care about C++, you can probably do this using Javascript and the AOM within Arbortext. Here's a brief example that watches for a click on a <title> element and takes action on it.

function clickEvent(event)
{
 var node = event.target;
 if (node.nodeName=="title") {
 Application.alert("You clicked " + node.nodeName + "\n");
 }
 event.stopPropagation();
}
var doc = Application.activeDocument;
var o = { handleEvent: clickEvent};
var listener = Packages.org.w3c.dom.events.EventListener(o);
doc.addEventListener("click", listener, true);