[Chameleon-dev] [Bug 629] [Chameleon - Widget] Add ability for ROI to call JS function when changed

bugzilla-daemon at www.maptools.org bugzilla-daemon at www.maptools.org
Wed Aug 25 15:12:31 EDT 2004


pspencer at dmsolutions.ca changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

------- Additional Comments From pspencer at dmsolutions.ca  2004-08-25 15:12 -------
ability added.  ROIManager now has a ONROICHANGED attribute that can be set to
some javascript code to be executed when the ROI changes in some way.  

The implementation adds three new methods to the global ROI Manager object:

Public Functions:

* RegisterEvent( event, code )

this is called by a client of the ROIManager that wants to be informed when an
event happens.  In the case of the ROIManager widget, it automatically registers
the code in the ONROICHANGED attribute ... but any javascript code can
theoretically use it.

* DeregisterEvent( event, code )

this is called by a client to remove a registered call back.  Pass the same code
as was passed to the RegisterEvent

Private Functions:

TriggerEvent( event )

this is called internally to signal that an event has occurred, this function
will then invoke all the callbacks registered for an event.

There is currently only one event registered:


it is declared as a global javascript variable, so your code would look like:

function myROICallback()
    alert( 'roi changed' );
goROIManager.RegisterEvent( ROI_CHANGED, 'myROICallback( )' );

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the Chameleon-dev mailing list