HOPEX Studio : Customizing the UI : Forms : FORMS properties page design : 3.4.4.4 Generic functions
   
3.4.4.4 Generic functions
These functions concern initialization, display and update of an element. If they are present in the updateTool, they are invoked whatever the element type.
 
Function AttCtl_SetText(Context,editText) As Boolean
This function is called at supply of the element, and can be used in particular when you want to display on the element a value not corresponding to the effective value of the property.
The editText argument corresponds to the value that will be displayed if the updateTool does not carry out any processing. This argument can be modified, and if the function returns True, then the text display area is updated with the new value.
 
Function AttCtl_SetDefaultText(Context,editText) As Boolean
This function is called when you want to display the element default value (for elements with default value view system). Its operation is identical to that of AttCtl_SetText.
 
Function AttCtl_UpdateText(Context,editText) As Boolean
This function is called after element validation, when we are preparing to display the new value after element update. Its operation is identical to that of AttCtl_SetText.
 
Functon AttCtl_UpdateCheck(Context,Status,ErrorMessage) as Boolean
This function is called at element validity check – when the page is in "ActiveValidation" mode. It should not execute any update.
In the case where the check detects an error, this error should be documented by updating the ErrorMessage argument with a character string explaining the error; this string will then be displayed to the user. If there is no error, an empty string should be returned, or the argument not modified.
The Status variable contains the return code, which in this case can be:
STATUS_ERROR (1): an error has been detected. If ErrorMessage is not empty, then STATUS_ERROR is automatically activated.
STATUS_NOCHANGE (2): indicates that the element will not result in property update.
If this function does not return value FALSE, standard validity checks of the property are called.
 
Function AttCtl_Update(Context,Status,ErrorMessage) as Boolean
This function is called at element validation; it should execute validity checks, then update the property – except if element default update is suitable.
In the case where the check detects an error, this error should be documented by updating the ErrorMessage argument with a character string explaining the error; this string will then be displayed to the user. If there is no error, an empty string should be returned, or the argument not modified.
The Status variable contains the return code, which in this case can be:
STATUS_ERROR (1): an error has been detected. If ErrorMessage is not empty, then STATUS_ERROR is automatically activated.
STATUS_NOCHANGE (2): indicates that the element will not result in property update.
STATUS_OK (4): the property has been correctly updated (in this case False should be returned so that standard update is not executed).
If this function does not return value False and status is not STATUS_ERROR, property standard update is called.