RasterDialogEvent

Object passed to a dialog event handler containing information about the event in progress. The object has the following properties:
event       The associated DOM event object.
type        Indicates the type of event.
dialog      The dialog control that issued the event.
bounds      Contains new position and dimmensions of the dialog.
Not all object properties apply to all event types. When a property is not relevant to a given event type, its value is set to null (Tip: do an alert() on the event object to see which properties are set for any particular event type).

The type property indicates what the event does. The following table lists its possible values:

Event Type Description move The dialog was moved. Check bounds property for the dialog's new position. Cancelling this event will prevent the dialog from being repositioned. resize The dialog was resized. Check bounds property for the dialog's new dimmensions. Cancelling this event will prevent the dialog from being resized. modal Indicates the user clicked outside a dialog that is in "modal" mode. minimize The title bar "minimize" button was pressed. maximize The title bar "maximize" button was pressed. window The title bar "window" button was pressed. close The title bar "close" button was pressed. Cancelling this event will prevent the dialog from closing.

Example: Hooking up a dialog event handler
var dg = new RasterDialog(null, ICONS16.APPLICATION, "A Dialog");
dg.setButtons( false, false, false, true ); //show close button
dg.setContent( "someDivId" ); //moves some div inside dialog
dg.setSize( 180, 180 );
dg.showAt( 300, 130 );
dg.setResizable( true ); //Allow dialog resizing

dg.setEventHandler( myHandler ); //hook event handler

...

function myHandler( evt )
{
    switch ( evt.type )
    {
       case "move"    : alert ( "I don't think so!" );
                        evt.cancel();
                        break;
       case "close"   : alert ( "Bye!" );
                        break;
    }
}

See Also

Home Examples Download License
 
Copyright © 2010-2017 Edwin R. López