AddDialogHandler


 

AddDialogHandler>DialogName,ObjectName,EventName,Subroutine

 

Not supported in Macro Scheduler Lite.

 

Assigns a subroutine to an object's event procedure.  Use AddDialogHandler to make a subroutine respond to user interaction, e.g. when a button is clicked.

 

For the dialog's own events, leave ObjectName blank.

 

For a list of possible event names edit the dialog in the Dialog Designer, right click on an object and select "List Event Names".

 

For non-modal dialogs you will almost always want to create a dialog handler for the dialog's OnClose event so that you know when the user has closed the dialog.

 

You can specify values to pass into the subroutine by including them within parentheses after the subroutine name.  These are then set to Subroutine_Var_1, Subroutine_Var_2 etc, in the same way as parameters passed via GoSub.  See examples.

 

See also: Dialog, Show, CloseDialog, GetDialogProperty, SetDialogProperty

Abbreviation: ADH

 

Example:

 

Dialog>Dialog1

..

End>Dialog1

 

AddDialogHandler>Dialog1,Button1,OnClick,DoClick(1)

AddDialogHandler>Dialog1,Button2,OnClick,DoClick(2)

AddDialogHandler>Dialog1,,OnClose,DoClose

 

...

...

 

SRT>DoClick

 MessageModal>Button clicked: %DoClick_Var_1%

End>DoClick

 

SRT>DoClose

 Let>Terminated=TRUE

End>DoClose