Dialog Events
Common information about dialog event handler
When the 9-th argument in the far.DialogInit or far.Dialog
call is function (event handler), that function will be called by Far
whenever any of the numerous dialog events occur.
ret = fDlgProc (hDlg, Msg, Param1, Param2)
Parameters:
hDlg : userdata
Msg : integer
Param1 : integer
Param2 : depends on Msg
Returns:
ret : depends on Msg
Parameters passed to event handler
hDlg: dialog handle. It is the same userdata kind thatfar.DialogInitreturns.
See description of its methods onfar.DialogInitpage.Msg: integer, anyDN_*value, e.g.DN_BTNCLICK,DN_CLOSE, etc.Param1: integer (1-based if it is ID of a dialog element, 0-based otherwise).Param2: integer for most event types, in accordance to Far API.
For some events,Param2is non-integer, see the articles describing those events.
Treating the return value of dialog event handler (in the order of preference)
- Return value of nil (or no value) causes
DefDlgProcto be called. Its return value is returned to Far. - For some events (
DN_CTLCOLORDLGLIST,DN_HELP, etc.), see the return values and their meaning in the article describing that event. - If the return value is number, then that number is returned to Far.
- Otherwise, the boolean equivalent of the return value (that is, either 0 or 1) is returned to Far.