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 ) FORM (3T)<br />

Move icon is not to be displayed on the border of the form.<br />

F _NOHELP is set if the Help icon is not to be displayed on the<br />

form border.<br />

F _win holds the window identifier associated with this form. It is<br />

allocated on an F _BEGIN call, used on subsequent calls, and �,<br />

deleted on an F _END call. F _track is a pointer to the mouse- \<br />

tracking information required during form interaction. The space<br />

for this data is allocated on F _BEGIN and freed on F _END.<br />

F _fields points to the array of fields (see below). F _curfl points to<br />

the current field. The caller should point J_curfl to the default<br />

field. Form will modify J_curfl as the user moves the highlighting<br />

around in the form. The list of fields is terminated by a field<br />

whose fl_name is NULL.<br />

Each field in the array pointed to by /_fi elds and J_curcl has the<br />

following form:<br />

typedef struct<br />

{<br />

char<br />

char<br />

char<br />

char<br />

char<br />

char<br />

char<br />

menu_t<br />

char<br />

} field_t;<br />

*fl_name;<br />

fl_row;<br />

fl_ncol;<br />

fl_fcol;<br />

fl_len;<br />

fl_flags;<br />

*fl_value;<br />

*fl_menu;<br />

*fl_prompt;<br />

/* field name *I<br />

I* field row *I<br />

j* name column *I<br />

j* field column *I<br />

j* field length *I<br />

I* flags *I<br />

j* field values *I<br />

j* assoc. menu pointer *I<br />

j* field prompt *I<br />

Fl_name is the field name. Fl_row is the row number on which to<br />

display the field. Row (and column) numbers are form-relative<br />

with 0,0 being the upper-leftmost location in the form. The form<br />

name (!_name) is located above 0,0 so the user needn't allocate a<br />

row for it.<br />

Fl_ncol and flJc ol control where the field name (fl_ncol) and<br />

field value (flJcol) are displayed. Generally, flJc ol is greater<br />

than fl_ncol by at least the length of the field name.<br />

Fl_len is the length of the field. See fl_value, below.<br />

Fl_flags contains various flags which describe the field.<br />

F _CLEARIT specifies that any previous value for the field should<br />

be erased when the user tries to enter a new value. This is useful<br />

for fields where user editing makes little sense. F _MONL Y means<br />

that the only allowable input to this field is via the associated<br />

menu (see fl_menu, below).<br />

On call, jl_value contains the initial field value. On return, this<br />

string is modified to contain the user-supplied value. If no editing<br />

was performed by the user, the return value is the same as the call<br />

value. Note that the caller must supply a pointer to a character<br />

array at least jl_len + 1 bytes long. In addition, the caller should<br />

place a null byte after the end of the default value. For a 30 byte<br />

�<br />

1<br />

- 2-

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

Saved successfully!

Ooh no, something went wrong!