Option Panels

Option Panels

Updated - 02 April 2020

An option panel is a panel that can be processed outside of normal 4C fld loop processing. An option panel can accept input even when input would not normally be allowed in the MainFldLp. When an option panel has the focus, traversal between fields stays inside of the option panel until focus is changed by the user or the application. There is no StartFldLp or EndFldLp processing within an option panel. When focus is outside of any option panel, field traversal is between all fields that are not in any option panel of the program. The StartFldLp and EndFldLp processing is always done when inside of this MainFldLp. Each option panel and the MainFldLp each maintain their own fld loop, but only the MainFldLp ever processes the StartFldLp PCL and EndFldLp PCL.

There are several scenarios that benefit from using option panels. Some of them are Some of the attributes that you can specify for option panels are There are some restrictions on option panels including There are several ways to give the focus to an option panel When you use an Initial option panel with a scrolling program, you will normally enter the main fld loop processing by executing code similar to the following:
          if (sys.get_fltype()==FLTYPE_INIT)
            sys.exit_fldloop();
          else
            sys.dr_restart(<asfile>,DR_CLEAR);
sys.get_fltype() will only return FLTYPE_INIT if the option panel is the Initial option panel and that option panelfld loop was started automatically by 4C following the Start/Restart PCL. If that option panel is traversed to via the mouse or keyboard then it is not running as an Initial Option panel and sys.get_fltype() will return FLTYPE_OPTION.

If the Initial Option panel is set to rerun on exit of the main fld loop, then it may be necessary to reset some variables either to their original shared in value or some other value. The following PCLs may be useful for this: Code similar to the following might be useful in the Start/Restart PCL
          if (firsttimef!='y')
            sys.restore_share(<asfile>);
          else
            firsttimef = 'n'
See Also

Back to Top