C-Menu 0.2.9
A User Interface Toolkit
Loading...
Searching...
No Matches
Form Struct Reference

#include <form.h>

Collaboration diagram for Form:
[legend]

Data Fields

int fg_clr_idx
int bg_clr_idx
int bo_clr_idx
int lines
int cols
int begy
int begx
WINDOW * win
WINDOW * box
char title [MAXLEN]
FILE * in_fp
FILE * out_fp
int in_fd
int out_fd
char mapp_spec [FIELD_MAXLEN]
char provider_cmd [MAXLEN]
char receiver_cmd [MAXLEN]
char cmd [MAXLEN]
bool f_mapp_spec
char help_spec [MAXLEN]
char in_spec [MAXLEN]
char out_spec [MAXLEN]
bool f_in_spec
bool f_out_spec
bool f_in_pipe
bool f_out_pipe
bool f_help_spec
bool f_erase_remainder
bool f_calculate
bool f_process
bool f_query
bool help
bool f_provider_cmd
bool f_receiver_cmd
bool f_cmd
char brackets [3]
char fill_char [2]
int fidx
int fcnt
int didx
int dcnt
Texttext [FIELD_MAXCNT]
Fieldfield [FIELD_MAXCNT]
Chyronchyron

Detailed Description

Definition at line 145 of file form.h.

Field Documentation

◆ begx

int Form::begx

the screen column number for the upper left corner of the form window

Definition at line 153 of file form.h.

Referenced by form_display_screen(), form_engine(), init_form(), and new_form().

◆ begy

int Form::begy

the screen line number for the upper left corner of the form window

Definition at line 151 of file form.h.

Referenced by form_display_screen(), form_engine(), init_form(), and new_form().

◆ bg_clr_idx

int Form::bg_clr_idx

the background color for the form window

Definition at line 147 of file form.h.

◆ bo_clr_idx

int Form::bo_clr_idx

the border color for the form window

Definition at line 148 of file form.h.

◆ box

WINDOW* Form::box

ncurses window structure for form box border

Definition at line 156 of file form.h.

Referenced by form_display_field_brackets(), and form_display_screen().

◆ brackets

char Form::brackets[3]

the characters used to indicate field input areas in the form description file, e.g. "[]" for square brackets or "<>" for angle brackets. The first character is the left bracket and the second character is the right bracket. These characters may be left blank, especially if fill_char is used. The choice of brackets can affect the visual appearance of the form and how users perceive the input areas for each field, with some preferring the traditional look of brackets while others may prefer a cleaner look without them. The use of brackets can also help to visually separate the field input areas from other text on the form, making it easier for users to identify where they need to enter their input during form processing.

Definition at line 277 of file form.h.

Referenced by form_display_field_brackets(), and new_form().

◆ chyron

Chyron* Form::chyron

a structure for managing the chyron string and its display properties on the form window during form processing. The chyron can be used to provide instructions, feedback, or other information to the user during form processing, and it can be updated dynamically based on user actions or other events to enhance the user experience and provide context- sensitive information as needed.

Definition at line 356 of file form.h.

Referenced by field_editor(), form_display_fields(), form_post(), form_process(), and init_form().

◆ cmd

char Form::cmd[MAXLEN]

a command that can be executed in the foreground, possibly taking control of the screen, by the menu application, e.g. an editor. This command can be used to allow the user to perform additional actions or tasks as part of the form processing, such as editing a file or running a script, providing a more interactive and flexible user experience during form processing.

Definition at line 185 of file form.h.

Referenced by init_form_files().

◆ cols

int Form::cols

the number of columns for the form windowi

Definition at line 150 of file form.h.

Referenced by form_display_fields(), form_display_screen(), and form_parse_desc().

◆ dcnt

int Form::dcnt

the number of text strings to be displayed on the form window, used for iterating through the text array and managing the display of text during form processing. This count can be used to determine how many text strings need to be displayed on the form window and to validate that all necessary text has been provided for display during form processing. The dcnt can also be used to dynamically allocate resources or manage memory for the text data during form processing.

Definition at line 323 of file form.h.

Referenced by form_display_screen(), and form_parse_desc().

◆ didx

int Form::didx

an index to the array of text strings to be displayed on the form window, used for iterating through the text array and managing the display of text during form processing. This index can be updated as needed to control which text strings are currently being displayed on the form window, allowing for dynamic updates to the form's content based on user actions or other events during form processing.

Definition at line 316 of file form.h.

Referenced by form_parse_desc().

◆ f_calculate

bool Form::f_calculate

flag - if set, Form presents an option to perform an external query or calculation.

Definition at line 243 of file form.h.

Referenced by form_engine(), form_parse_desc(), and form_process().

◆ f_cmd

bool Form::f_cmd

flag - if set, indicates that the command has been verified and is valid for execution. This can be used to ensure that the command specified in the form structure is valid and can be executed successfully during form processing, allowing for additional actions or tasks to be performed as part of the form's functionality, such as editing a file or running a script.

Definition at line 270 of file form.h.

Referenced by init_form_files().

◆ f_erase_remainder

bool Form::f_erase_remainder

flag - if set, causes the data above the cursor and to the right to be cleared when the user presses the enter key, e.g. to prevent leftover characters from previous field values from being left on the screen when a shorter value is entered in a field. This is essential for veteran keyboard users, accountants and the like, who rarely even look at the screen during data entry.

Definition at line 235 of file form.h.

Referenced by field_editor(), and init_form_files().

◆ f_help_spec

bool Form::f_help_spec

flag - help_spec verified, indicating that the help file spec has been validated and is ready for use during form processing

Definition at line 231 of file form.h.

Referenced by form_engine(), and init_form_files().

◆ f_in_pipe

bool Form::f_in_pipe

flag - in_spec is a pipe, indicating that the input file spec is a command that can be executed to provide input data for the form fields during form processing, allowing for dynamic and flexible input sources for the form fields.

Definition at line 221 of file form.h.

Referenced by form_process(), form_read_data(), and init_form().

◆ f_in_spec

bool Form::f_in_spec

flag - in_spec verified, indicating that the input file spec has been validated and is ready for use during form processing

Definition at line 215 of file form.h.

Referenced by form_read_data(), init_form(), and init_form_files().

◆ f_mapp_spec

bool Form::f_mapp_spec

flag - mapp_spec verified

Definition at line 192 of file form.h.

Referenced by init_form(), and init_form_files().

◆ f_out_pipe

bool Form::f_out_pipe

flag - out_spec is a pipe, indicating that the output file spec is a command that can be executed to handle the accepted field values for the form fields during form processing, allowing for dynamic and flexible output handling for the form results.

Definition at line 226 of file form.h.

Referenced by form_write().

◆ f_out_spec

bool Form::f_out_spec

flag - out_spec verified, indicating that the output file spec has been validated and is ready for use during form processing

Definition at line 218 of file form.h.

Referenced by form_engine(), form_exec_cmd(), form_process(), form_write(), and init_form_files().

◆ f_process

bool Form::f_process

flag - if set, Form presents an option to perform an external query or calculation.

Definition at line 245 of file form.h.

Referenced by field_navigator(), form_engine(), form_exec_cmd(), form_parse_desc(), and form_process().

◆ f_provider_cmd

bool Form::f_provider_cmd

flag - if set, indicates that the provider command has been verified and is valid for execution. This can be used to ensure that the provider command specified in the form structure is valid and can be executed successfully during form processing, allowing for dynamic content generation or retrieval as part of the form's functionality.

Definition at line 255 of file form.h.

Referenced by form_process(), and init_form_files().

◆ f_query

bool Form::f_query

flag - if set, the action key label will be "query" instead of "process" or "calculate".

Definition at line 247 of file form.h.

Referenced by form_engine(), form_parse_desc(), and form_process().

◆ f_receiver_cmd

bool Form::f_receiver_cmd

flag - if set, indicates that the receiver command has been verified and is valid for execution. This can be used to ensure that the receiver command specified in the form structure is valid and can be executed successfully during form processing, allowing for dynamic handling of the results or output generated by process programs or commands as part of the form's functionality.

Definition at line 262 of file form.h.

Referenced by form_engine(), and init_form_files().

◆ fcnt

int Form::fcnt

the number of fields in the form, used for iterating through the field array and managing field data during form processing. This count can be used to determine when the user has reached the end of the fields or to validate that all required fields have been completed before accepting the form. The fcnt can also be used to dynamically allocate resources or manage memory for the field data during form processing.

Definition at line 309 of file form.h.

Referenced by field_navigator(), form_display_fields(), form_display_screen(), form_exec_cmd(), form_parse_desc(), form_process(), form_write(), and form_yx_to_fidx().

◆ fg_clr_idx

int Form::fg_clr_idx

the foreground color for the form window

Definition at line 146 of file form.h.

◆ fidx

int Form::fidx

the index of the currently selected field, used for highlighting and selection purposes during form processing. This index corresponds to the position of the field in the field array, allowing for easy access to the current field's data and properties during form processing. The fidx can be updated as the user navigates through the form fields, providing visual feedback and allowing for dynamic interactions based on the selected field.

Definition at line 301 of file form.h.

Referenced by field_editor(), field_navigator(), form_display_field(), form_display_field_brackets(), form_display_field_n(), form_engine(), form_fmt_field(), form_parse_desc(), form_read_data(), and form_validate_field().

◆ field

Field* Form::field[FIELD_MAXCNT]

an array of pointers to the field structures for the fields in this form, used for managing and processing the form fields during form processing. Each pointer in this array corresponds to a Field structure that contains the line, column, length, field format, input string, accepted string, display string, and filler string information for a specific field in the form. This allows for dynamic management of the form fields, enabling validation, formatting, and processing of user input based on the specified field formats and properties during form processing.

Definition at line 344 of file form.h.

Referenced by destroy_form(), field_editor(), form_display_field(), form_display_field_brackets(), form_display_fields(), form_display_screen(), form_exec_cmd(), form_fmt_field(), form_parse_desc(), form_process(), form_validate_field(), form_write(), and form_yx_to_fidx().

◆ fill_char

char Form::fill_char[2]

the character used to fill the field input areas in the form, e.g. "_" for underscores or " " for spaces. This character is used to visually indicate the input area for each field in the form, and it can be used in conjunction with brackets or on its own if brackets are not used. Many feel that using fill characters without brackets creates a cleaner and more modern look for the form, while others prefer the traditional look of brackets. The choice of whether to use brackets, fill characters, or both is a matter of personal preference and design style for the form.

Definition at line 290 of file form.h.

Referenced by form_display_fields(), mk_filler(), and new_form().

◆ help

bool Form::help

flag - if set, indicates that the user has requested help during form processing, e.g. by pressing a help key or button. This can be used to trigger the display of context-sensitive help information for the form, providing guidance and assistance to the user based on their current actions or the specific form they are working with.

Definition at line 249 of file form.h.

◆ help_spec

char Form::help_spec[MAXLEN]

the menu application help file spec, e.g. a qualified path to a file containing help information for the menu application and its associated forms. This file can be used to provide context-sensitive help to the user during form processing, allowing them to access relevant information and guidance based on their current actions or the specific form they are working with.

Definition at line 193 of file form.h.

Referenced by form_engine(), form_parse_desc(), and init_form_files().

◆ in_fd

int Form::in_fd

input file descriptor, e.g. for reading from a file or pipe

Definition at line 163 of file form.h.

◆ in_fp

FILE* Form::in_fp

input stream pointer, e.g. for reading from a file or pipe

Definition at line 159 of file form.h.

Referenced by form_process(), and form_read_data().

◆ in_spec

char Form::in_spec[MAXLEN]

the input file spec, e.g. a qualified path to a file containing initial values for the form fields. This file can be used to pre-populate the form fields with existing data or default values during form processing, allowing for a more efficient and user-friendly experience when working with forms that require input values.

Definition at line 201 of file form.h.

Referenced by form_read_data(), init_form(), and init_form_files().

◆ lines

int Form::lines

the number of lines for the form window

Definition at line 149 of file form.h.

Referenced by field_editor(), form_display_fields(), form_display_screen(), form_post(), and form_process().

◆ mapp_spec

char Form::mapp_spec[FIELD_MAXLEN]

the menu application description file spec

Definition at line 167 of file form.h.

Referenced by form_desc_error(), form_parse_desc(), init_form(), and init_form_files().

◆ out_fd

int Form::out_fd

output file descriptor, e.g. for writing to a file or pipe

Definition at line 165 of file form.h.

Referenced by form_write().

◆ out_fp

FILE* Form::out_fp

output stream pointer, e.g. for writing to a file or pipe

Definition at line 161 of file form.h.

Referenced by form_write().

◆ out_spec

char Form::out_spec[MAXLEN]

the output file spec, e.g. a qualified path to a file where the accepted values for the form fields will be written after form processing. This file can be used to save or export the results of the form processing, allowing for further use or analysis of the accepted field values after the form has been completed.

Definition at line 208 of file form.h.

Referenced by form_engine(), form_exec_cmd(), form_write(), and init_form_files().

◆ provider_cmd

char Form::provider_cmd[MAXLEN]

the provider command, which can be executed in the background to provide dynamic content for a program called by the menu application. This command can be used to generate or retrieve data that will be displayed on the form or used for processing the form fields, allowing for dynamic and interactive forms that can adapt to changing data or user input during form processing.

Definition at line 169 of file form.h.

Referenced by form_process(), and init_form_files().

◆ receiver_cmd

char Form::receiver_cmd[MAXLEN]

the receiver command, which can be executed in the background to process the output of a program called by the menu application. This command can be used to handle the results or output generated by a program that is executed as part of the form processing, allowing for dynamic and interactive forms that can respond to the results of process programs or commands during form processing.

Definition at line 177 of file form.h.

Referenced by form_engine(), form_exec_cmd(), form_parse_desc(), and init_form_files().

◆ text

Text* Form::text[FIELD_MAXCNT]

an array of pointers to the text structures for the text strings to be displayed on the form window, used for managing and displaying the text content of the form during form processing. Each pointer in this array corresponds to a Text structure that contains the line, column, string, and length information for a specific text string to be displayed on the form window. This allows for dynamic management of the text content on the form, enabling updates and changes to the displayed text based on user actions or other events during form processing.

Definition at line 331 of file form.h.

Referenced by destroy_form(), form_display_screen(), and form_parse_desc().

◆ title

char Form::title[MAXLEN]

the title of the form, displayed in the form box border

Definition at line 157 of file form.h.

Referenced by form_display_screen(), form_parse_desc(), init_form(), and init_form_files().

◆ win

WINDOW* Form::win

ncurses window structure for form

Definition at line 155 of file form.h.

Referenced by field_editor(), form_display_field(), form_display_fields(), form_display_screen(), form_post(), form_process(), and init_form().


The documentation for this struct was generated from the following file: