Methods | Fields | This Package | All Packages

DhEventInfo Class

Carries event information from the event source to the event sink.

package com.ms.wfc.html

public class DhEventInfo

Remarks

When an event is triggered from an HTML element, the extendedInfo field of the Event object contains a DhEventInfo object. You use DhEventInfo to control subsequent actions taken by the event (such as bubbling) and to find out more about the context in which the event occurred.

The following example shows how to set up a basic event handler that displays the value of the DhEventInfo object for mouseMove events.

import com.ms.wfc.html.*;
import com.ms.wfc.html.event.*;
   
public class DumpEvent extends DhDocument
{
   DhText text;
   	
   public void initForm()
   {
      text = new DhText();
      this.add(text,DhInsertOptions.BEGINNING);
      this.addOnMouseMove( new MouseEventHandler(this.onMouseMove ) );
   }
   
   public void onMouseMove( Object sender, Event event )
   {
      text.setText( event.toString() );
      /* If you want to use more advanced features of HTML eventing model,
         or get more information about HTML events, use the DhEventInfo as
         shown below. */
      DhEventInfo eventInfo = (DhEventInfo)event.getExtendedInfo();
      eventInfo.cancelBubble();

   }
}