diff options
Autocommit at 05.05.2022 @ 21:34
2 files changed, 21 insertions, 22 deletions
| -rw-r--r-- | src/ConsoleInterface/Toolbox.cpp | 41 | ||||
| -rw-r--r-- | src/VenueConsoleUI.cpp | 2 |
diff --git a/src/ConsoleInterface/Toolbox.cpp b/src/ConsoleInterface/Toolbox.cpp index 6dca150..710390e 100644 --- a/src/ConsoleInterface/Toolbox.cpp +++ b/src/ConsoleInterface/Toolbox.cpp @@ -3,7 +3,7 @@ void clear() { // Clears console on Linux // Source: https://stackoverflow.com/a/52895729/12036073 - // std::cout << u8"\033[2J\033[1;1H"; + std::cout << u8"\033[2J\033[1;1H"; } int orderedListIndex = 1; @@ -12,30 +12,12 @@ void resetOrderedList(int starter) { orderedListIndex = starter; } -void _printOrderedListBeginning() { - std::cout << "[" << orderedListIndex++ << "] "; -} - -void _printInputBoxLabel(const char* label) { - std::cout << " (+) " << label; -} - -void _printAltInputBoxLabel(const char* label) { - std::cout << "(+) " << label; -} - -void inputLineBox(const char* label, char* output, unsigned maxWidth) { - _printInputBoxLabel(label); - std::cin.ignore(); - std::cin.getline(output, maxWidth); -} - void titleBox(const char* title) { - std::cout << std::endl << "### " << title << " ###" << std::endl; + std::cout << std::endl << "=== " << title << " ===" << std::endl; } void subTitleBox(const char* title) { - std::cout << std::endl << "+#+ " << title << " +#+" << std::endl; + std::cout << std::endl << "--- " << title << " ---" << std::endl; } void successBox(const char* message) { @@ -50,3 +32,20 @@ void errorBox(const char* message) { std::cout << "<E> " << message << std::endl; } +void _printOrderedListBeginning() { + std::cout << "[" << orderedListIndex++ << "] "; +} + +void _printInputBoxLabel(const char* label) { + std::cout << " (+) " << label; +} + +void _printAltInputBoxLabel(const char* label) { + std::cout << "(+) " << label; +} + +void inputLineBox(const char* label, char* output, unsigned maxWidth) { + _printInputBoxLabel(label); + std::cin.ignore(); + std::cin.getline(output, maxWidth); +} diff --git a/src/VenueConsoleUI.cpp b/src/VenueConsoleUI.cpp index 719b6d5..e82ea82 100644 --- a/src/VenueConsoleUI.cpp +++ b/src/VenueConsoleUI.cpp @@ -8,7 +8,7 @@ #include "ConsoleInterface/Toolbox.hpp" Venue* v; -Menu mainMenu("FMI Ticket System"), ticketManagementMenu("Ticket management"), eventManagementMenu("Event management"), reportsMenu("Report management"); +Menu mainMenu("FMI Ticket System", true, false), ticketManagementMenu("Ticket management", false, true), eventManagementMenu("Event management", false, true), reportsMenu("Report management", false, true); void handleStatusCode(StatusCode sc, Menu menu) { switch (sc) { |
