Website Summary Files Commits Branches @commit @diff @stats
path: root / src / ConsoleInterface / Menu.cpp
diff options
context:
space:
mode:
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++)