Demonstrates now a UIfield can be returned to a NULL value in both V and C code.
When designed a user interface it can often be useful to be able force the user to enter data again. For some components this can be done by setting them to a know default value. For other components, such as text boxes, this can be done by resetting them to a NULL value. This project demonstrates now the UIfield component can be reset to a NULL value. Examples are provided that do this in module C code and network editor V code.
Returning a UIfield to a NULL value can be achieved by simply executing the following V statement:
MyField.value = ;
However normally you would want to reset a field interactively, when a button is pressed or a calculation has completed. This can be achieved by using the parse_v module. This module executes a specified V statement whenever it is triggered. Hence it can be setup so that it can reset the UIfield component whenever a button is pressed. This is shown in the V_Ret2NullEg example application.
Returning a UIfield to a NULL value in C code can be achieved in a similar way to V code. Primarily it is necessary to set the MyField.value object equal to the OMnull_obj object. OMnull_obj is a special object that is used by the Object Manager to represent a NULL or empty value. However as we wish to use this function interactively we need to detect when the module has been triggered by an external input. This can be done by using the OMchanged() function to test if the parameter has changed.
The ReturnToNull module and source code provides a simple implementation of this. The C_Ret2NullEg example application shows how this module can be used.
&ui_field
Reference to a UIfield component that is to be returned to NULL by the ReturnToNull module.
trigger
Integer trigger parameter used by the ReturnToNull module. Whenever this parameter is set to 1 the referenced UIfield component to returned to NULL.
iac_proj/ret2null/rt2nmods.v contains the V definition of the ReturnToNull low-level module.
iac_proj/ret2null/rt2nmacs.v contains the V definitions of the example applications V_Ret2NullEg and C_Ret2NullEg.
The low-level Ret2NullMods library containing the module does not specify a process. By default the express process will be used.
Leigh J. Grundy Advanced Visual Systems, Inc. Andrew Dodd International AVS Centre
International AVS Centre Manchester Visualization Centre Manchester Computing University of Manchester Oxford Road Manchester United Kingdom M13 9PL
AVS module parse_v