Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Generic / ConsoleInterface / Menu.cpp
diff options
context:
space:
mode:
Commit1aaef6ff5bf41bfccba8944f734dea3434ac2bfc (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-05-28 20:15:01 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-05-28 20:15:01 +0300
Files7b05c28653eb48b8f4449089c35774ec5973d28b /src/Generic/ConsoleInterface/Menu.cpp
FMI-OOP-P2_Tables-1aaef6ff5bf41bfccba8944f734dea3434ac2bfc.tar
FMI-OOP-P2_Tables-1aaef6ff5bf41bfccba8944f734dea3434ac2bfc.tar.gz
FMI-OOP-P2_Tables-1aaef6ff5bf41bfccba8944f734dea3434ac2bfc.zip
Parentd01238def9403291528436aae7f0be9bcc8a921c (diff)
Autocommit at 28.05.2022 @ 20:15
1 files changed, 2 insertions, 17 deletions
-rw-r--r--src/Generic/ConsoleInterface/Menu.cpp19
diff --git a/src/Generic/ConsoleInterface/Menu.cpp b/src/Generic/ConsoleInterface/Menu.cpp
index 39084a1..71bafaf 100644
--- a/src/Generic/ConsoleInterface/Menu.cpp
+++ b/src/Generic/ConsoleInterface/Menu.cpp
@@ -22,26 +22,11 @@ void Menu::navigate() const {
return;
}
- unsigned buffer = 1; // We immedeately read the value of buffer, so this is fine
+ char buffer[MAX_LINE_WIDTH];
while (buffer != 0) {
clear();
- print("> ");
- readLine();
-
- resetOrderedList(0);
- if (backExistsApp)
- printOrderedListElem("Exit");
- else
- printOrderedListElem("Go Back");
-
- for (unsigned i = 0; i < menuOptions.get_count(); i++)
- printOrderedListElem(menuOptions[i].get_nameInMenu());
-
- _printInputBoxLabel("Execute No [0-");
- print(menuOptions.get_count());
- print("]: ");
- read(buffer);
+ inputLineBox("> ", buffer, MAX_LINE_WIDTH);
if (buffer > menuOptions.get_count())
registerError("Invalid menu option!");