Workbench User Guide : Creating and Modifying Menus : Common Menu Properties : How You Can Set Focus Behavior
 
Share this page          
How You Can Set Focus Behavior
OpenROAD Workbench lets you control the effect that selecting a menu item has on the previous field on the form (the field previously having the input focus and displaying the text cursor). You control this behavior by setting the Focus Behavior property for each menu item.
The Focus Behavior property can have any of the following values:
FT_SETVALUE
Specifies that clicking this menu item triggers the SetValue event for the current field. However, since the focus remains in that field, there is no Exit field event.
This setting is useful for data validation tasks. For example, you could provide a Save menu item that activates a SetValue event block that validates the data in the field.
When you use this setting, OpenROAD activates the SetValue event for the current field only when the user has changed the data in the field. FT_SETVALUE is the default setting for all menu items.
FT_TABTO
Specifies that clicking this menu item triggers the SetValue and Exit events for the current field. If the current field is part of a composite field, you can use this setting to force validation and ChildExit events for the child fields. When you use this setting, OpenROAD always triggers the Exit event but only triggers the SetValue event if the user has changed data in the current field.
FT_NOSETVALUE
Clicking this menu item does not trigger the SetValue event for the current field. This setting is useful for menu items that do not require any interaction with data, such as Help, or those that do not require data validation, such as Cancel.
FT_TAKEFOCUS
Specifies the same as FT_TABTO.
Default: FT_SETVALUE
For more information about the focus behavior of menu items, see the description of the FocusBehavior attribute in the Language Reference Guide. Also, for information about the SetValue event, see the Language Reference Guide.