Open topic with navigation
WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
subroutine EENTRST_METHOD a_nomod ,n a_reset ,n
The true/false flag that specifies whether the data was modified. (n)
The true/false flag that determines whether to reset the field’s contents. (n)
When the user selects a menu entry, the default behavior is to cancel pending input. EENTRST_METHOD enables you to override this default behavior, so you can retain the pending input.
EENTRST_METHOD is a subroutine that you write and name. The name of your subroutine is registered with UI Toolkit using the E_METHOD subroutine.
UI Toolkit calls your EENTRST_METHOD subroutine when an input field is exited due to a menu entry being invoked. This occurs when %M_SIGNAL is called or when the user selects a menu entry, presses a menu entry shortcut, or presses a standard button. On Windows, this includes I_CANCEL; EENTRST_METHOD overrides I_CANCEL.
When this subroutine is called, if the user has not modified the input field contents, a_nomod is passed as true; otherwise it’s passed as false.
When this subroutine is called, a_reset is always passed as true unless the field is a check box or a multi‑line text field, in which case it’s passed as false. On Windows, a_reset is also passed as false if the field is a radio button or combo box (selection window).
If this subroutine sets a_reset to false, Toolkit will accept and validate the pending data. If a_reset is set to false when a_nomod is true, this means that the existing contents of the field will be validated as if they were entered for the first time, even though no change has been made. Note that this can cause validation errors on existing data, for example an error will occur on a required field that is blank. Also, setting a_reset to false can cause a break to occur on a field.
If using I_INPFLD, validation does not occur until you leave the field, so a button with a method does not trigger the EENTRST_METHOD unless the button method signals a menu entry.
Note that the IF statement in the following example tests for the I_CANCEL menu entry and prevents the EENTRST_METHOD from overriding the cancel, which it would do on Windows systems. (You can create similar tests for other menu entries for which you do not want to accept pending data.)
subroutine eentrst_method a_nomod ,n a_reset ,n .include 'WND:tools.def' proc if(g_entnam.ne.'I_CANCEL'.and..not.a_nomod) a_reset = 0 xreturn endsubroutine