{"id":15964838,"url":"https://github.com/lxstvayne/interactiveconsolemenu","last_synced_at":"2025-04-04T13:17:04.669Z","repository":{"id":137493467,"uuid":"343416952","full_name":"lxstvayne/InteractiveConsoleMenu","owner":"lxstvayne","description":"Меню, которое можно кастомизировать","archived":false,"fork":false,"pushed_at":"2021-06-01T10:22:23.000Z","size":44,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T22:47:19.543Z","etag":null,"topics":["console","cpp","interactive","menu"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lxstvayne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-01T12:58:07.000Z","updated_at":"2023-03-24T16:42:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"8dc7d6b8-261e-4c7c-bab4-6529d12cd3a2","html_url":"https://github.com/lxstvayne/InteractiveConsoleMenu","commit_stats":{"total_commits":21,"total_committers":1,"mean_commits":21.0,"dds":0.0,"last_synced_commit":"8b6bfe380c40e4925aa67c6cfdaefa6b5d2aa563"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lxstvayne%2FInteractiveConsoleMenu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lxstvayne%2FInteractiveConsoleMenu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lxstvayne%2FInteractiveConsoleMenu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lxstvayne%2FInteractiveConsoleMenu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lxstvayne","download_url":"https://codeload.github.com/lxstvayne/InteractiveConsoleMenu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247182424,"owners_count":20897381,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["console","cpp","interactive","menu"],"created_at":"2024-10-07T17:21:18.726Z","updated_at":"2025-04-04T13:17:04.646Z","avatar_url":"https://github.com/lxstvayne.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cp align=\"center\"\u003eMenu.h\r\n\r\nДанная библиотека помогает очень просто создавать интерактивные меню для вашей программы.\r\n___\r\n## Использование\r\n```cpp\r\n#include \u003ciostream\u003e\r\n#include \"Menu.h\"\r\n#include \u003cvector\u003e\r\n\r\n\r\nusing namespace std;\r\n\r\nvoid script(vector\u003cint\u003e\u0026 v);\r\nvoid print_vector(vector\u003cint\u003e v);\r\nvoid print_smth();\r\n\r\n\r\nint main()\r\n{\r\n\tvector\u003cint\u003e v;\r\n\r\n\tMenu menu(\"Моё меню: \");\r\n\r\n\tmenu.add_row(\r\n\t\t\" 1. Строка номер 1\", print_smth\r\n\t);\r\n\r\n\tmenu.add_row(\r\n\t\t\" 2. Добавить элементы в вектор\", [\u0026]() { script(v); }\r\n\t);\r\n\r\n\tmenu.add_row(\r\n\t\t\" 3. Вывести вектор\", [\u0026]() { print_vector(v); }\r\n\t);\r\n\t\r\n\tmenu.add_row(\r\n\t\t\" Выход\", nullptr\r\n\t);\r\n\r\n\tmenu.run();\r\n}\r\n\r\nvoid script(vector\u003cint\u003e\u0026 v)\r\n{\r\n\tint n;\r\n\tint number;\r\n\tcout \u003c\u003c \"Сколько чисел: \";\r\n\tcin \u003e\u003e n;\r\n\tcout \u003c\u003c \"Вводите ваши числа: \" \u003c\u003c endl;\r\n\tfor (size_t i = 0; i \u003c n; i++)\r\n\t{\r\n\t\tcin \u003e\u003e number;\r\n\t\tv.push_back(number);\r\n\t}\r\n}\r\n\r\nvoid print_vector(vector\u003cint\u003e v)\r\n{\r\n\tfor (auto el: v)\r\n\t\tcout \u003c\u003c el \u003c\u003c endl;\r\n\r\n}\r\n\r\nvoid print_smth()\r\n{\r\n\tcout \u003c\u003c \"Вы в пункте 1\" \u003c\u003c endl;\r\n}\r\n```\r\n![Alt-текст](example.png \"Пример\")\r\n___\r\n## Создание меню\r\nЧтобы создать меню необходимо создать объект класса **Menu**:\r\n```cpp\r\nMenu menu(string title); // title -\u003e Заголовок вашего меню, по умолчанию нет.\r\n```\r\n\r\nУстановить по необходимости свои цвета для консоли, добавить строчки выбора:\r\n```cpp\r\nmenu.add_row(\r\n    string name,\r\n    void function,\r\n    bool pause = true\r\n);\r\n```\r\nАргумент pause отвечает за то, будет ли ожидаться ввод любой клавиши после выполнения фукнции, использовать false при вложенном меню.\r\n\t\r\nЛямба функция, если необходимо передать какие-то аргументы:\r\n```cpp\r\nmenu.add_row(\r\n    string name,\r\n    [\u0026]() { function(a, b, c) }\r\n);\r\n```\r\nИ запустить само меню:\r\n```cpp\r\nmenu.run();\r\n```\r\n## Изменение цветов консоли\r\nВы также можете изменить цвет текста или заднего фона консоли:\r\n```cpp\r\n    menu.set_color(char BG_COLOR, char FONT_COLOR);\r\n```\r\nПараметры **BG_COLOR** и **FONT_COLOR** используют в качестве аргумента перечисления Colors. Доступные цвета:\r\n+ BLUE\r\n+ LIGHT_GREEN\r\n+ LIGHT_AQUA\r\n+ AQUA\r\n+ LIGHT_RED\r\n+ RED\r\n+ LIGHT_PURPLE\r\n+ PURPLE\r\n+ LIGHT_YELLOW\r\n+ YELLOW\r\n+ BRIGHT_WHITE\r\n+ WHITE\r\n+ GRAY\r\n+ LIGHT_BLUE\r\n+ BLACK\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flxstvayne%2Finteractiveconsolemenu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flxstvayne%2Finteractiveconsolemenu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flxstvayne%2Finteractiveconsolemenu/lists"}