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

The Menu structure is the main data structure for the menu application, containing all the information about the menu, its lines, and its display properties. More...

#include <menu.h>

Collaboration diagram for Menu:
[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]
int argc
char ** argv
char mapp_spec [MAXLEN]
char help_spec [MAXLEN]
char provider_cmd [MAXLEN]
char receiver_cmd [MAXLEN]
char cmd [MAXLEN]
bool f_mapp_spec
bool f_help_spec
bool f_provider_cmd
bool f_receiver_cmd
bool f_cmd
int choice_max_len
int text_max_len
int item_count
int line_idx
Lineline [MAX_MENU_LINES]

Detailed Description

The Menu structure is the main data structure for the menu application, containing all the information about the menu, its lines, and its display properties.

Definition at line 81 of file menu.h.

Field Documentation

◆ argc

int Menu::argc

The number of arguments on the command line, used to determine how many arguments were passed to the menu application when it was executed

Definition at line 109 of file menu.h.

◆ argv

char** Menu::argv

The argument vector from the command line, used to access the specific arguments passed to the menu application when it was executed

Definition at line 112 of file menu.h.

◆ begx

int Menu::begx

The screen column for the upper left corner of the menu window, used to determine the horizontal position of the menu display on the screen

Definition at line 97 of file menu.h.

Referenced by menu_cmd_processor(), menu_engine(), and new_menu().

◆ begy

int Menu::begy

The screen line for the upper left corner of the menu window, used to determine the vertical position of the menu display on the screen

Definition at line 94 of file menu.h.

Referenced by menu_cmd_processor(), menu_engine(), and new_menu().

◆ bg_clr_idx

int Menu::bg_clr_idx

Definition at line 85 of file menu.h.

◆ bo_clr_idx

int Menu::bo_clr_idx

<The background color for the menu display, used to determine the color of the background in the menu display The color for the box around the menu, used to determine the color of the box in the menu display

Definition at line 88 of file menu.h.

◆ box

WINDOW* Menu::box

The ncurses window structure for the box around the menu, used to manage the display of the box around the menu on the screen

Definition at line 103 of file menu.h.

Referenced by menu_engine().

◆ choice_max_len

int Menu::choice_max_len

The longest choice text string of all menu lines, used to determine the width of the menu window, calculated based on the length of the choice_text for all menu lines and used to ensure that the menu window is wide enough to accommodate the longest choice text without truncation or wrapping

Definition at line 175 of file menu.h.

Referenced by menu_engine(), and parse_menu_description().

◆ cmd

char Menu::cmd[MAXLEN]

A command that can be executed in the foreground, possibly taking control of the screen, by the menu application, such as an editor or other program that is called by the menu application, used to specify a command that can be run in the foreground when selected from the menu, which may take control of the screen and require user interaction

Definition at line 141 of file menu.h.

◆ cols

int Menu::cols

The number of columns for the menu window size, used to determine the width of the menu display

Definition at line 92 of file menu.h.

Referenced by menu_cmd_processor(), menu_engine(), and parse_menu_description().

◆ f_cmd

bool Menu::f_cmd

A flag to indicate whether the foreground command has been verified, used to indicate whether the command specified by cmd has been successfully verified and can be executed in the foreground when selected from the menu

Definition at line 171 of file menu.h.

◆ f_help_spec

bool Menu::f_help_spec

A flag to indicate whether the menu application help file has been verified, used to indicate whether the help file specified by help_spec has been successfully verified and can be used to provide help information for the menu application

Definition at line 153 of file menu.h.

Referenced by init_menu_files(), and menu_cmd_processor().

◆ f_mapp_spec

bool Menu::f_mapp_spec

A flag to indicate whether the menu application description file has been verified, used to indicate whether the menu description file specified by mapp_spec has been successfully verified and can be used to populate the menu lines and their properties

Definition at line 148 of file menu.h.

Referenced by init_menu_files().

◆ f_provider_cmd

bool Menu::f_provider_cmd

A flag to indicate whether the provider command has been verified, used to indicate whether the provider command specified by provider_cmd has been successfully verified and can be executed in the background to provide dynamic content for the menu display or for a program called by the menu application

Definition at line 158 of file menu.h.

◆ f_receiver_cmd

bool Menu::f_receiver_cmd

A flag to indicate whether the receiver command has been verified, used to indicate whether the receiver command specified by receiver_cmd has been successfully verified and can be executed in the background to process the output of a program called by the menu application

Definition at line 165 of file menu.h.

◆ fg_clr_idx

int Menu::fg_clr_idx

The foreground color for the menu display, used to determine the color of the text and other elements in the menu display

Definition at line 82 of file menu.h.

◆ help_spec

char Menu::help_spec[MAXLEN]

The menu application help file spec, which may be a file name or a fully qualified path to a file, used to specify the location of the help file that contains the information about the menu application and how to use it

Definition at line 121 of file menu.h.

Referenced by init_menu_files(), and menu_cmd_processor().

◆ item_count

int Menu::item_count

The number of menu lines in this menu, used to determine how many lines are currently defined in the menu and to manage the array of menu lines

Definition at line 187 of file menu.h.

Referenced by destroy_menu(), menu_cmd_processor(), menu_engine(), and parse_menu_description().

◆ line

Line* Menu::line[MAX_MENU_LINES]

An array of pointers to the menu line structures in this menu, used to store the information about each menu line, including its type, text, choice letter, command type, and command string, and to manage the menu lines in the menu display

Definition at line 194 of file menu.h.

Referenced by destroy_menu(), menu_cmd_processor(), menu_engine(), and parse_menu_description().

◆ line_idx

int Menu::line_idx

The index of the currently selected menu line, used for highlighting and selection purposes, updated based on user input to indicate which menu line is currently selected and should be highlighted in the menu display

Definition at line 190 of file menu.h.

Referenced by destroy_menu(), menu_cmd_processor(), menu_engine(), and parse_menu_description().

◆ lines

int Menu::lines

The number of lines for the menu window size, used to determine the height of the menu display

Definition at line 90 of file menu.h.

Referenced by menu_engine(), and parse_menu_description().

◆ mapp_spec

char Menu::mapp_spec[MAXLEN]

The menu application description file spec, which may be a file name or a fully qualified path to a file, used to specify the location of the menu description file that contains the information about the menu lines and their properties

Definition at line 115 of file menu.h.

Referenced by init_menu_files(), and parse_menu_description().

◆ provider_cmd

char Menu::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, used to specify a command that can be run in the background to generate dynamic content for the menu display or for a program that is called by the menu application

Definition at line 126 of file menu.h.

◆ receiver_cmd

char Menu::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, used to specify a command that can be run in the background to process the output of a program that is called by the menu application, such as parsing the output and updating the menu display or performing some other action based on the output

Definition at line 133 of file menu.h.

◆ text_max_len

int Menu::text_max_len

The longest text string of all menu lines, used to determine the width of the menu window, calculated based on the length of the raw_text for all menu lines and used to ensure that the menu window is wide enough to accommodate the longest text without truncation or wrapping

Definition at line 181 of file menu.h.

Referenced by menu_engine(), and parse_menu_description().

◆ title

char Menu::title[MAXLEN]

The title to display on the top line of the box window, used to provide a title or header for the menu display

Definition at line 106 of file menu.h.

Referenced by menu_engine(), and parse_menu_description().

◆ win

WINDOW* Menu::win

The ncurses window structure for the menu display, used to manage the display of the menu on the screen and handle user input

Definition at line 100 of file menu.h.

Referenced by menu_cmd_processor(), and menu_engine().


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