Website Summary Files Commits Branches @commit @diff @stats
path: root / src / ConsoleInterface / Menu.cpp
diff options
context:
space:
mode:
Commit8796882268879807962441c1667ad32cf08938c2 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-05 15:03:56 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-05 15:03:56 +0300
Files61c4037fc074a109619008dcc7f29dd7d8ed59ad /src/ConsoleInterface/Menu.cpp
FMI-OOP-P1_TicketSystem-8796882268879807962441c1667ad32cf08938c2.tar
FMI-OOP-P1_TicketSystem-8796882268879807962441c1667ad32cf08938c2.tar.gz
FMI-OOP-P1_TicketSystem-8796882268879807962441c1667ad32cf08938c2.zip
Parent110fdbde950490a1911c6033a602519f609b3192 (diff)
Autocommit at 05.05.2022 @ 15:03
1 files changed, 8 insertions, 2 deletions
-rw-r--r--src/ConsoleInterface/Menu.cpp10
diff --git a/src/ConsoleInterface/Menu.cpp b/src/ConsoleInterface/Menu.cpp
index 9c24d41..bc1c5f1 100644
--- a/src/ConsoleInterface/Menu.cpp
+++ b/src/ConsoleInterface/Menu.cpp
@@ -1,10 +1,14 @@
#include "Menu.h"
#include "Toolbox.hpp"
+#include <cstring>
-Menu::Menu() : menuOptions() {}
+Menu::Menu() : menuOptions() {
+ strcpy(title, "Menu");
+}
-Menu::Menu(const Command* commands, unsigned commandCount) {
+Menu::Menu(const Command* commands, unsigned commandCount, const char* title) {
menuOptions = List<Command>(commands, commandCount);
+ strcpy(this->title, title);
}
void Menu::addCommand(const Command& command) {
@@ -20,6 +24,8 @@ void Menu::navigate() const {
unsigned buffer = 1; // We immedeately read the value of buffer, so this is fine
while (buffer != 0) {
+ printTitle(title);
+
resetOrderedList(0);
printOrderedListElem("Go Back");
for (unsigned i = 0; i < menuOptions.get_count(); i++)