Question
NCURSES using C++ implement a basic text editor, texted.cpp, in C++ using system calls for low-level file I/O and the ncurses library for the Text
NCURSES using C++
implement a basic text editor, texted.cpp, in C++ using system calls for low-level file I/O and the ncurses library for the Text User Interface (TUI) using NCURSES.
In addition to the editable text area, the main editor window needs to include text for the menu, the title, and the name of the file currently open in the editor.
F1 Menu: If the user presses the F1 key (or fn-F1 on a Mac), then your editor needs to create a window somewhere in the terminal screen that allows the user to select from the following options:
Open: This option should prompt the user to enter in a filename. After the user presses return/enter, your editor should attempt to open the file for editing. If an unsaved file is open in the editor when the user chooses this option, then your editor needs to ask the user whether or not they want to save their changes before opening the other file.
Save: This option should attempt to save the file currently open in the editor. The mode of the file should not be changed by your editor.
Save As: This option should prompt the user to enter in a new filename and attempt to save the file currently open in the editor to that new filename. If the file already exists, then your editor should ask the user if they want to overwrite the existing file.
Exit: This option should exit your editor. If an unsaved file is open in the editor when the user chooses this option, then your editor needs to ask the user whether or not they want to save their changes before exiting.
Display Errors: If a system call issues an error, then your editor needs to create a window in the center of the terminal screen that displays that error. Whenever it makes sense to do so, your editor should prompt the user in an attempt to fix the problem. For example, if the open system call issues an error about a file not existing, then you might prompt the user to re-enter the filename.
My Menu Open Save Save As ExitStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started