This repository has been archived on 2021-03-14. You can view files and clone it, but cannot push or open issues or pull requests.
2019-12-19 14:51:51 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "pch.h"
|
|
|
|
|
|
|
|
/// <summary>Represents one menu item in a menu.</summary>
|
|
|
|
struct MenuItem {
|
|
|
|
char* text;
|
|
|
|
char key;
|
|
|
|
void* (*action)(void);
|
|
|
|
};
|
|
|
|
|
2019-12-21 19:53:19 +01:00
|
|
|
|
|
|
|
/// <summary>Is used for style-switching</summary>
|
|
|
|
/// <item name="DEFAULT">Default style with asterisks around the terminal</item>
|
|
|
|
/// <item name="MODERN">Minimalistic design with bar instead of start>/item>
|
|
|
|
/// <item name="NO_BORDER">No border, just plain text</item>
|
|
|
|
enum MenuStyle {
|
|
|
|
DEFAULT,
|
|
|
|
MODERN,
|
|
|
|
NO_BORDER
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2019-12-19 14:51:51 +01:00
|
|
|
/// <summary>Displaces a CUI menu to the user and lets them choose an option, then calls the corresponding function.</summary>
|
|
|
|
/// <param name="itemc">The length of the array <c>itemv</c> of menu items.</param>
|
|
|
|
/// <param name="itemv">An array of all menu items to display in the menu.</param>
|
|
|
|
/// <param name="title">The title of the menu.</param>
|
|
|
|
/// <param name="loopback">If this parameter is set to <c>true</c>, the menu will be displayed again after an action is executed.</param>
|
|
|
|
/// <param name="pause">If this parameter is set to <c>true</c>, a <c>pause</c>command will be run after an action is executed.</param>
|
2019-12-21 19:53:19 +01:00
|
|
|
/// <param name="style">Specifies the style in which the menu is displayed.</param>
|
|
|
|
void show_menu(const int itemc, struct MenuItem itemv[], const char title[], bool loopback, bool pause, enum MenuStyle style);
|