From 8796882268879807962441c1667ad32cf08938c2 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 5 May 2022 15:03:56 +0300 Subject: Autocommit at 05.05.2022 @ 15:03 --- src/ConsoleInterface/Menu.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/ConsoleInterface/Menu.cpp') 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 -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(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++) -- cgit v1.3.1-23-gd82d