Setting Form Options for Individual Forms

Designer: You can change the option settings for a form within the Designer. See the Designer User's Guide for details. You can also change the option settings in your code, at any point after you have read the form from the Designer library.

Code: You can change the option settings for a form at any time after the form has been defined with fm_def().

General: To change form options in code, use the set form options function, sfm_opt():

void sfm_opt(fm_opts, state, dfmp);
 
long fm_opts;
/* Options to be changed
*/
int state;
/* State to change options to (ON or OFF)
*/
DFORMPTR dfmp;
/* Pointer to form to change options for
*/

The fm_opts argument is a combination of the options with the bitwise OR operator that you want changed, for example, VERIFYQUIT | FMWRAP. You can change more than one option at once, as long as all the options are to have the state specified in the call. Options that were previously set for the form are not changed by this call.

Designer: The following code fragment changes the options for a form:

DLIBPTR libp;

DFORMPTR dfmp;

...

...

libp = dl_open("my_lib.vvd");

dfmp = dl_fmget("my_form", &data, my_lib, NULLP, libp);



sfm_opt(AUTOEXIT, OFF, dfmp);

sfm_opt(VERIFYEXIT | FMWRAP, ON, dfmp);

Code: The following code fragment changes the options for a form:

DFORMPTR dfmp;

dfmp = fm_def(0, 0, 5, 80, LNORMAL, BDR_SLNP);

sfm_opt(AUTOEXIT, OFF, dfmp);

sfm_opt(VERIFYEXIT | FMWRAP, ON, dfmp);

The form now has the following options ON: VERIFYEXIT, AUTOMOVE, VERIFYQUIT, and FMWRAP. VERIFYEXIT and FMWRAP were set to ON by the call to sfm_opt(). VERIFYEXIT and AUTOMOVE are set to ON by default.


Home Contents Previous Next