AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox AT&T UNIX™PC Unix System V Users Manual - tenox

01.01.2013 Views

FORM(3T) (AT&T UNIX PC only ) FORM (3T) Move icon is not to be displayed on the border of the form. F _NOHELP is set if the Help icon is not to be displayed on the form border. F _win holds the window identifier associated with this form. It is allocated on an F _BEGIN call, used on subsequent calls, and �, deleted on an F _END call. F _track is a pointer to the mouse- \ tracking information required during form interaction. The space for this data is allocated on F _BEGIN and freed on F _END. F _fields points to the array of fields (see below). F _curfl points to the current field. The caller should point J_curfl to the default field. Form will modify J_curfl as the user moves the highlighting around in the form. The list of fields is terminated by a field whose fl_name is NULL. Each field in the array pointed to by /_fi elds and J_curcl has the following form: typedef struct { char char char char char char char menu_t char } field_t; *fl_name; fl_row; fl_ncol; fl_fcol; fl_len; fl_flags; *fl_value; *fl_menu; *fl_prompt; /* field name *I I* field row *I j* name column *I j* field column *I j* field length *I I* flags *I j* field values *I j* assoc. menu pointer *I j* field prompt *I Fl_name is the field name. Fl_row is the row number on which to display the field. Row (and column) numbers are form-relative with 0,0 being the upper-leftmost location in the form. The form name (!_name) is located above 0,0 so the user needn't allocate a row for it. Fl_ncol and flJc ol control where the field name (fl_ncol) and field value (flJcol) are displayed. Generally, flJc ol is greater than fl_ncol by at least the length of the field name. Fl_len is the length of the field. See fl_value, below. Fl_flags contains various flags which describe the field. F _CLEARIT specifies that any previous value for the field should be erased when the user tries to enter a new value. This is useful for fields where user editing makes little sense. F _MONL Y means that the only allowable input to this field is via the associated menu (see fl_menu, below). On call, jl_value contains the initial field value. On return, this string is modified to contain the user-supplied value. If no editing was performed by the user, the return value is the same as the call value. Note that the caller must supply a pointer to a character array at least jl_len + 1 bytes long. In addition, the caller should place a null byte after the end of the default value. For a 30 byte � 1 - 2-

FORM (3T) (AT&T UNIX PC only ) field, a default value might be of the form: "Default Value\0 " 1234567890123 45678901234567890 1 2 3 FORM(3T) Fl_menu points to an optional "associated menu." If the caller supplies a menu pointer, then the user may press the Cmd or Opts key on that field to invoke menu(3T) to parse the menu. The selected menu item's name (mi_name) is placed in the field's value (ft_value ). If the F _MONL Y flag is set for the field, then any attempt to edit the field's value will force the associated menu to pop-up. When a field has an associated menu, the SLECT and MARK keys step through the menu choices without displaying the menu. The optional message pointed to by ft_prompt is displayed on the prompt line whenever the field is selected. AB the user moves from field to field, the prompt changes. EXAMPLE The following program illustrates a typical use of form : #include #include #include #include #include mitem_t printitems[ ] = { }; "ASR-33", "Centronix", "Diablo #1", "Diablo #2", "Epson in lab", "Laser Printer", "File", 0, 0,0, 0,1, 0,2, 0,3, 0,4, 0,5, 0,6, 0,0 menu_t printmenu = { "Printers", 0, "Select a Printer from the list", 0, 1,0,0, M_SINGLE, {0}, 0,0,0,0,0, printitems, printitems, 0 }; mitem_t priitems[ ] = - 3-

FORM (3T) (AT&T UNIX PC only )<br />

field, a default value might be of the form:<br />

"Default Value\0 "<br />

1234567890123 45678901234567890<br />

1 2 3<br />

FORM(3T)<br />

Fl_menu points to an optional "associated menu." If the caller<br />

supplies a menu pointer, then the user may press the Cmd or Opts<br />

key on that field to invoke menu(3T) to parse the menu. The<br />

selected menu item's name (mi_name) is placed in the field's value<br />

(ft_value ). If the F _MONL Y flag is set for the field, then any<br />

attempt to edit the field's value will force the associated menu to<br />

pop-up. When a field has an associated menu, the SLECT and<br />

MARK keys step through the menu choices without displaying the<br />

menu.<br />

The optional message pointed to by ft_prompt is displayed on the<br />

prompt line whenever the field is selected. AB the user moves<br />

from field to field, the prompt changes.<br />

EXAMPLE<br />

The following program illustrates a typical use of form :<br />

#include <br />

#include <br />

#include <br />

#include <br />

#include <br />

mitem_t printitems[ ] =<br />

{<br />

};<br />

"ASR-33",<br />

"Centronix",<br />

"Diablo #1",<br />

"Diablo #2",<br />

"Epson in lab",<br />

"Laser Printer",<br />

"File",<br />

0,<br />

0,0,<br />

0,1,<br />

0,2,<br />

0,3,<br />

0,4,<br />

0,5,<br />

0,6,<br />

0,0<br />

menu_t printmenu =<br />

{<br />

"Printers",<br />

0,<br />

"Select a Printer from the list",<br />

0, 1,0,0,<br />

M_SINGLE,<br />

{0},<br />

0,0,0,0,0,<br />

printitems,<br />

printitems,<br />

0<br />

};<br />

mitem_t priitems[ ] =<br />

- 3-

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!