-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
54 lines (43 loc) · 1.38 KB
/
main.cpp
File metadata and controls
54 lines (43 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include "common_includes.hpp"
#include "math.hpp"
#include "item.hpp"
#include "button.hpp"
#include "slider.hpp"
#include "combo.hpp"
#include "tab.hpp"
#include "menu.hpp"
void run_menu() {
vector<unique_ptr<Item>> items;
bool val = true;
items.push_back(make_unique<Button>("Button", val));
vector<unique_ptr<Item>> items_b;
int slider = 100;
items_b.push_back(make_unique<Slider>("Slider", slider, 0, 100, 5));
vector<unique_ptr<Item>> items_c;
items_c.push_back(make_unique<Item>("Basic Item"));
int choice = 0;
vector<string> choices = { "X", "Y", "Z" };
items_c.push_back(make_unique<Combo>("Combo", choice, choices));
bool val_1 = true;
bool val_2 = true;
items_c.push_back(make_unique<Button>("Button#1", val_1));
items_c.push_back(make_unique<Button>("Button#2", val_2));
int slider_1 = 100;
items_c.push_back(make_unique<Slider>("Slider#1", slider_1, 0, 100, 5));
vector<unique_ptr<Tab>> tabs;
tabs.push_back(make_unique<Tab>("A", move(items)));
tabs.push_back(make_unique<Tab>("B", move(items_b)));
tabs.push_back(make_unique<Tab>("C", move(items_c)));
Menu menu = Menu("Console User Interface", move(tabs));
menu.init();
menu.think();
}
int main()
{
#ifdef _DEBUG
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_DEBUG);
#endif
run_menu();
return 0;
}