|
service routine that is called, among others, by mt_wdlg_evnt().
This function may be called if an exit or touchexit object was clicked on (in that case obj is a positive object number) or when an event has occurred that affects the dialog (in that case obj is negative and contains a corresponding function number such as HNDL_CLSD, for instance).
If obj is an object number (>= 0), then events points to the EVNT structure that was passed by mt_wdlg_evnt(). Otherwise events is basically 0L and can not be used for addressing.
clicks contains then number of mouse clicks (if obj is an object number)
Here is a list of event (value given in the obj parameter):
- HNDL_INIT (-1) :
data is the variable passed by wdlg_create. If handle_exit() returns 0, mt_wdlg_create() does not create a dialog structure (error). The variable code is passed in clicks . - HNDL_OPEN (-5) :
data is the variable passed by wdlg_open. The variable code is passed in clicks . - HNDL_CLSD (-3) :
data is user_data . If handle_exit() returns 0, the dialog will be closed -- mt_wdlg_evnt() returns 0 events points to the EVNT structure passed by mt_wdlg_evnt(). - HNDL_MOVE (-9) :
data is user_data . If handle_exit() returns 0, the dialog will be closed -- mt_wdlg_evnt() returns 0. events points to the EVNT structure passed by mt_wdlg_evnt(). - HNDL_TOPW (-10) :
data is user_data . If handle_exit() returns 0, the dialog will be closed -- mt_wdlg_evnt() returns 0. events points to the EVNT structure passed by mt_wdlg_evnt(). - HNDL_UNTP (-11) :
data is user_data . If handle_exit() returns 0, the dialog will be closed -- mt_wdlg_evnt() returns 0. events points to the EVNT structure passed by mt_wdlg_evnt(). - HNDL_EDIT (-6) :
data points to a word with the key code. If handle_exit() returns 1, the key press will be evaluated, if 0 ignored. events points to the EVNT structure passed by mt_wdlg_evnt(). - HNDL_EDDN (-7) :
data points to a word with the key code. events points to the EVNT structure passed by mt_wdlg_evnt(). - HNDL_EDCH (-8) :
data points to a word with the object number of the new editable field. - HNDL_MESG (-2) :
data is user_data . If handle_exit() returns 0, the dialog will be closed -- mt_wdlg_evnt() returns 0. events points to the EVNT structure passed by mt_wdlg_evnt().
HNDL_MESG is only passed if a message code between 20 and 39 was received that is not handled by other opcodes. Is required for iconification, for instance.
Warning: This opcode is only present from MagiC 4.5 of 18.4.96
Of these function numbers one only has to react to HNDL_CLSD. All other events need only be paid attention to when needed.
If handle_exit is called with an unknown function number in obj , or one of the above function numbers is to be ignored, then 1 has to be returned.
The parameters are passed via the stack and the routine may alter registers d0-d2/a0-a2. |