|
|
Every form is associated with a window and subwindow.
Windows are used to create borders, titles, and the like. Before ETI posts a form, it must determine the sizes of its window and subwindow.
To determine the minimum window or subwindow size for a form, ETI considers the following:
Considering the above information, this function returns the minimum window size necessary for containing the form.
SYNOPSIS
int scale_form (form, rows, cols) FORM form; int rows; int cols;Because function scale_form must return more than one value (namely, the minimum number of rows and columns for the form) and C passes parameters ``by value'' only, scale_form are pointers. The pointer arguments rows and cols point to locations used to return the minimum number of rows and columns for the form.
As an example, to return the minimum (sub)window size for form f in variables rows and cols, you can write:
FORM * form; int rows, cols;If function scale_form encounters an error, it returns one of the following:/* create fields create form */
/* determine minimum row and column size */ scale_form (form, &rows, &cols);
/* create form subwindow, as described in next section */