-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclsCurrencyExchangeMainScreen.h
More file actions
126 lines (97 loc) · 4.13 KB
/
Copy pathclsCurrencyExchangeMainScreen.h
File metadata and controls
126 lines (97 loc) · 4.13 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#pragma once
#include <iostream>
#include <iomanip>
#include "clsScreen.h"
#include "clsColor.h"
#include "clsInputValidate.h"
#include "clsCurrenciesListScreen.h"
#include "clsFindCurrencyScreen.h"
#include "clsUpdateCurrencyRateScreen.h"
#include "clsCurrencyCalculatorScreen.h"
using namespace std;
class clsCurrencyExchangeMainScreen : protected clsScreen
{
private:
enum enCurrenciesMainMenuOptions
{
enListCurrencies = 1, enFindCurrency = 2, enUpdateCurrencyRate = 3,
enCurrencyCalculator = 4, enMainMenu = 5
};
static short _ReadCurrenciesMainMenuOptions()
{
cout << setw(37) << left << "" << clsColor::Text(196) + "Choose What Do You Want To Do ? [ " + clsColor::Text(226)
+ "1" + clsColor::GetColor(clsColor::enBrightCyan) + " to " + clsColor::Text(226) + " 5 " + clsColor::Text(196) + "]" + " ? " + clsColor::Text(93);
short Choice = clsInputValidate::ReadIntNumberBetween(1, 5, "Enter Number Between 1 to 5 ? ");
return Choice;
}
static void _GoBackToCurrenciesMenu()
{
cout << setw(37) << left << "" << clsColor::GetColor(clsColor::enCyan) + "\n\tPress Any Key To Go Back To Currencies Menu...\n" + clsColor::GetColor(clsColor::enReset);
system("pause>0");
ShowCurrenciesMenu();
}
static void _ShowCurrenciesListScreen()
{
clsCurrenciesListScreen::ShowCurrenciesListScreen();
}
static void _ShowFindCurrencyScreen()
{
clsFindCurrencyScreen::ShowFindCurrencyScreen();
}
static void _ShowUpdateCurrencyRateScreen()
{
clsUpdateCurrencyRateScreen::ShowUpdateCurrencyRateScreen();
}
static void _ShowCurrencyCalculatorScreen()
{
clsCurrencyCalculatorScreen::ShowCurrencyCalculatorScreen();
}
static void _PerformCurrenciesMainMenuOptions(enCurrenciesMainMenuOptions CurrenciesMainMenuOptions)
{
switch (CurrenciesMainMenuOptions)
{
case enCurrenciesMainMenuOptions::enListCurrencies:
system("cls");
_ShowCurrenciesListScreen();
_GoBackToCurrenciesMenu();
break;
case enCurrenciesMainMenuOptions::enFindCurrency:
system("cls");
_ShowFindCurrencyScreen();
_GoBackToCurrenciesMenu();
break;
case enCurrenciesMainMenuOptions::enUpdateCurrencyRate:
system("cls");
_ShowUpdateCurrencyRateScreen();
_GoBackToCurrenciesMenu();
break;
case enCurrenciesMainMenuOptions::enCurrencyCalculator:
system("cls");
_ShowCurrencyCalculatorScreen();
_GoBackToCurrenciesMenu();
break;
case enCurrenciesMainMenuOptions::enMainMenu:
break;
}
}
public:
static void ShowCurrenciesMenu()
{
if (!CheckAccessRights(clsUser::enPermissions::PShowCurrencyExchange))
{
return;
}
system("cls");
_DrawScreenHeader(clsColor::Text(126) + " Currency Exchange Main Screen" + clsColor::Reset());
cout << '\n' << setw(37) << left << "" << clsColor::GetColor(clsColor::enBrightRed) + "==========================================\n";
cout << setw(37) << left << "" << clsColor::GetColor(clsColor::enBlink) + clsColor::GetColor(clsColor::enBrightGreen) + "\t\tCurrency Exchange Menu\n" + clsColor::GetColor(clsColor::enReset);
cout << setw(37) << left << "" << clsColor::GetColor(clsColor::enBrightRed) + "==========================================\n";
cout << setw(37) << left << "" << clsColor::GetColor(clsColor::enYellow) + "\t[1]" + clsColor::GetColor(clsColor::enBrightCyan) + " List Currencies.\n";
cout << setw(37) << left << "" << clsColor::GetColor(clsColor::enYellow) + "\t[2]" + clsColor::GetColor(clsColor::enBrightCyan) + " Find Currency.\n";
cout << setw(37) << left << "" << clsColor::GetColor(clsColor::enYellow) + "\t[3]" + clsColor::GetColor(clsColor::enBrightCyan) + " Update Rate.\n";
cout << setw(37) << left << "" << clsColor::GetColor(clsColor::enYellow) + "\t[4]" + clsColor::GetColor(clsColor::enBrightCyan) + " Currency Calculator.\n";
cout << setw(37) << left << "" << clsColor::GetColor(clsColor::enYellow) + "\t[5]" + clsColor::GetColor(clsColor::enBrightCyan) + " Main Menu.\n";
cout << setw(37) << left << "" << clsColor::GetColor(clsColor::enBrightRed) + "==========================================\n" + clsColor::GetColor(clsColor::enReset);
_PerformCurrenciesMainMenuOptions((enCurrenciesMainMenuOptions)_ReadCurrenciesMainMenuOptions());
}
};