Programming Guide : 13. Creating Dynamic Frames : How You Can Change Field and Frame Appearance and Behavior : How You Can Set Field and Menu Biases
 
Share this page                  
How You Can Set Field and Menu Biases
There are two ways to set the bias of an individual field or menu item from 4GL. The simplest way is to use the CurBias attribute to set the current bias. The alternative way is to set the bias for a particular mode with the ReadBias, QueryBias, UpdateBias, User1Bias, User2Bias, or User3Bias attributes. Use the mode-bias settings only when you are working with frame modes.
The following section describes the CurBias attribute. For a discussion of using the mode-bias attributes, see How You Can Use the Mode-Bias Attributes.
How You Can Use the CurBias Attribute
Every field and menu item has a CurBias attribute that lets you specify the current bias for the field. This attribute changes the field bias immediately, regardless of the current frame mode.
The CurBias attribute for fields has the following valid values:
FB_CHANGEABLE
FB_LANDABLE
FB_VISIBLE
FB_VIEWABLE
FB_DIMMED
FB_INVISIBLE
FB_FLEXIBLE
FB_RESIZEABLE
FB_MARKABLE
FB_MOVEABLE
FB_CLICKPOINT
FB_DRAGBOX
FB_DRAGSEGMENT
If the field does not support the Dimmed bias, OpenROAD uses FB_VISIBLE instead. If the field does not support the Flexible bias (cannot be resized), OpenROAD uses FB_MOVEABLE instead.
The CurBias attribute for menu items has the following valid values:
MB_INVISIBLE
MB_DISABLED
MB_ENABLED
Changing the CurBias attribute also changes the field's bias for the current mode. For a discussion of using the mode-bias attributes, see How You Can Use the Mode-Bias Attributes.
How You Can Use the CurBias Attribute for Composite Fields
When you set the CurBias attribute of a composite field, it indirectly affects the biases of its child fields. Based on the new bias of the composite field, OpenROAD sets a maximum bias for the children.
For example, if you change the CurBias attribute for a table field from FB_CHANGEABLE to FB_VISIBLE, the user cannot access any of the columns in the table, even though their individual biases are still FB_CHANGEABLE.
This maximum bias is changed when you reset the CurBias for the composite field. For example, if you reset the CurBias for the table field to FB_CHANGEABLE, the user can then access any of the columns in the table (so long as their individual bias setting allows it).
Changing the CurBias attribute also changes the field's bias for the current value of CurMode. For example, if the frame's CurMode setting is FM_READ and you set CurBias for a field to FB_INVISIBLE, the ReadBias attribute for that field is also changed to FB_INVISIBLE.
For more information about changing a field or menu item's bias, see the Language Reference Guide.