Programming Guide : 13. Creating Dynamic Frames : How You Can Change Field and Frame Appearance and Behavior : Frame Modes
 
Share this page                  
Frame Modes
OpenROAD provides the following frame modes:
FM_UPDATE
Specifies that default biases for entry fields allow reading and updating. All other fields can be selected (clicked). All menu items are enabled.
FM_QUERY
Specifies that default biases for entry fields allow reading and updating. All other fields can be selected (clicked). All menu items are enabled.
FM_READ
Specifies that default biases for entry fields allow reading but not updating. All other fields can be selected (clicked). All menu items are enabled.
FM_USER1
Specifies a name that lets you create your own mode (default biases allow reading and updating)
FM_USER2
Specifies a name that lets you create your own mode (default biases allow reading and updating)
FM_USER3
Specifies a name that lets you create your own mode (default biases allow reading and updating)
Although OpenROAD provides a set of default biases for each of the modes, the most useful modes are the default Update and Read modes. Switching between Update and Read modes is effective when you want to change a frame from an interactive to a passive state. For example, the video_detail frame script sets the frame mode to Read to provide a view-only version of the video details.
Because the Query, User1, User2, and User3 modes have the same defaults as Update mode, these modes are useful only when you want to create your own customized mode by explicitly setting the biases of the individual fields and menu items in that mode. You can do this from OpenROAD Workbench using the Frame Editor's Bias menu or from your 4GL code with the mode-bias attributes.
When you create a frame with Workbench, OpenROAD uses Update mode as the default mode. You can change this initial frame mode on the frame's Property Inspector. To change the frame mode at runtime, use the CurMode attribute of the frame's FrameExec object.
How You Can Use the CurMode Attribute
The CurMode attribute specifies the current mode for a frame. When you set this attribute, OpenROAD changes all fields and menu items on the frame to the appropriate bias for the new mode. The CurMode attribute can be set to any valid mode.
You can force the bias of an individual field or menu item to change when the frame changes modes by setting the mode-bias attribute. However, you need not change frame modes to change the biases of individual fields. The CurBias attribute for fields lets you set the field bias regardless of the frame mode.
How You Can Use the Mode-Bias Attributes
To enable you to change the bias of a field when the frame is in a specific mode, OpenROAD provides the following set of attributes for every field and menu item:
UpdateBias
Sets the bias for the field when the frame is in Update mode
QueryBias
Sets the bias for the field when the frame is in Query mode
ReadBias
Sets the bias for the field when the frame is in Read mode
User1Bias
Sets the bias for the field when the frame is in User1 mode
User2Bias
Sets the bias for the field when the frame is in User2 mode
User3Bias
Sets the bias for the field when the frame is in User3 mode
AllBias
Sets the bias for the field item for all six modes
These attributes let you override the field's initial bias settings specified by using the Frame Editor's Bias menu or using the system defaults. The new setting takes effect the next time you change the frame to the specified mode (immediately if the frame is already in that mode).
How You Can Use the Frame Status Bar
You can enhance an application's ease of use by using the frame status bar. The frame status bar is a read-only text field that contains user-specified text associated either with the frame, or with a specific field.
When the mouse cursor is placed over a field or a menu item, OpenROAD automatically displays the status bar text associated with the field or menu item in the status bar. If the field or menu item has no status text defined for it, OpenROAD places the status text of the first parent of the field or menu item that has status text defined for it. If no fields have status text, or if the mouse cursor is over the frame's form, OpenROAD automatically places the status text associated with the frame in the status bar.
The presence of the frame status bar and its associated informational text can be set in OpenROAD Workbench, or in the 4GL script of the frame. The following code is an example of how the status bar can be used when the mouse is over a particular field:
Begin
    curframe.hasstatusbar = true;
    curframe.statustext = 'Your mouse cursor is over
        the form.';
    field(field0).mousemovetext = 'Your mouse cursor
        is over field0';
end
For more information about how to use the frame status bar, see the attributes of the FrameSource, FrameExec, FormField, and MenuField classes in the Language Reference Guide.