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
moveThe dialog was moved. Check
bounds
property for
the dialog's new position. Cancelling this event
will prevent the dialog from being repositioned.
resizeThe dialog was resized. Check
bounds
property for
the dialog's new dimmensions. Cancelling this event
will prevent the dialog from being resized.
modalIndicates the user clicked outside a dialog that is in "modal" mode.
minimizeThe title bar "minimize" button was pressed.
maximizeThe title bar "maximize" button was pressed.
windowThe title bar "window" button was pressed.
closeThe 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; } }