xml spy
Previous  Top  Next
XMLSpyDocumentEditor.attachCallBack

See also

Declaration: attachCallBack(bstrName as String,varCallBack as Variant)

Description

The Document Editor PlugIn provides events which can be handled using custom callback functions. All event handlers take no parameters and any returned value will be ignored. To retrieve information when a specific event is raised you have to read the according properties of the event object.

List of currently available events:

   ondragover
   ondrop   
   onkeydown
   onkeyup
   onkeypressed
   onmousemove
   onbuttonup
   onbuttondown
   oncontextmenu
   oneditpaste
   oneditcut
   oneditcopy
   oneditclear


JavaScript example:

   // somwhere in your script:
   objPlugIn.attachCallBack("ondragover",OnDragOver);
   objPlugIn.attachCallBack("ondrop",OnDrop);

   // event handlers
   function OnDragOver()
   {
      if
(   !objPlugIn.event.dataTransfer.ownDrag &&
         objPlugIn.event.dataTransfer.type == "TEXT"))
      {
         objPlugIn.event.dataTransfer.dropEffect = 1;
         objPlugIn.event.cancelBubble = true;
      }
   }

   // OnDrop() replaces the complete text value of the XML
   // element with the selection from the drag operation
   function OnDrop()
   {
      var
 objTransfer = objPlugIn.event.dataTransfer;

      if
(   !objTransfer.ownDrag &&
         (objTransfer.type == "TEXT"))
         objPlugIn.event.srcElement.TextValue = objTransfer.getData();
   }


Previous  Top  Next

© 2002 Altova