Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define ui unsigned int
- #define L 20
- #define C 30
- #define css char(201) // 01. ╔
- #define cds char(187) // 02. ╗
- #define csj char(200) // 03. ╚
- #define cdj char(188) // 04. ╝
- #define ori char(205) // 05. ═
- #define ver char(186) // 06. ║
- #define vsm char(204) // 07. ╠
- #define vdm char(185) // 08. ╣
- #define osm char(203) // 09. ╦
- #define ojm char(202) // 10. ╩
- void menu(unsigned int optiune)
- {
- #define start_title 10
- #define start_op_adauga 2
- #define start_op_editeaza 2
- #define start_op_listare 2
- #define start_op_stergere 2
- #define start_op_cautare 2
- #define lista 5
- #define op_exit 2
- for (ui i = 0; i < L; i++)
- {
- cout << " ";
- for (ui j = 0; j < C; j++)
- {
- if (i == 0 || i == L - 1 || j == 0 || j == C - 1 || i == 2)
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN);
- else
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15); // ALB
- if (a[i][j] == 1) cout << css;
- else if (a[i][j] == 2) cout << cds;
- else if (a[i][j] == 3) cout << csj;
- else if (a[i][j] == 4) cout << cdj;
- else if (a[i][j] == 5) cout << ori;
- else if (a[i][j] == 6) cout << ver;
- else if (a[i][j] == 7) cout << vsm;
- else if (a[i][j] == 8) cout << vdm;
- else if (a[i][j] == 9) cout << osm;
- else if (a[i][j] == 10) cout << ojm;
- else if (i == 1 && j > start_title - 1 && j < start_title + 10){
- cout << "MANAGEMENT";
- j = start_title + 9;
- /*if (i == 1 && j == start_title) cout << "M";
- if (i == 1 && j == start_title + 1) cout << "A";
- if (i == 1 && j == start_title + 2) cout << "N";
- if (i == 1 && j == start_title + 3) cout << "A";
- if (i == 1 && j == start_title + 4) cout << "G";
- if (i == 1 && j == start_title + 5) cout << "E";
- if (i == 1 && j == start_title + 6) cout << "M";
- if (i == 1 && j == start_title + 7) cout << "E";
- if (i == 1 && j == start_title + 8) cout << "N";
- if (i == 1 && j == start_title + 9) cout << "T";*/
- }
- else if (i == lista && j > start_op_adauga && j < start_op_adauga + 15)
- {
- if (optiune == 1)
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 3);
- cout << "1. Adauga copil";
- j = start_op_adauga + 15;
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
- }
- else if (i == lista + 2 && j > start_op_editeaza && j < start_op_editeaza + 16)
- {
- if (optiune == 2)
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 3);
- cout << "2. Editeaza date";
- j = start_op_editeaza + 16;
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
- }
- else if (i == lista + 4 && j > start_op_listare && j < start_op_listare + 16)
- {
- if (optiune == 3)
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 3);
- cout << "3. Listare copii";
- j = start_op_listare + 16;
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
- }
- else if (i == lista + 6 && j > start_op_stergere && j < start_op_stergere + 17)
- {
- if (optiune == 4)
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 3);
- cout << "4. Stergere copil";
- j = start_op_stergere + 17;
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
- }
- else if (i == lista + 8 && j > start_op_cautare && j < start_op_cautare + 16)
- {
- if (optiune == 5)
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 3);
- cout << "5. Cautare copii";
- j = start_op_cautare + 16;
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
- }
- else if (i == lista + 10 && j > op_exit && j < op_exit + 7)
- {
- cout << "6. Exit";
- j = op_exit + 7;
- }
- else
- cout << " ";
- }
- cout << endl;
- }
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15); // ALB
- }
- void desenare_lista()
- {
- for (ui i = 0; i < C; i++)
- {
- a[0][i] = 5;
- a[L - 1][i] = 5;
- a[2][i] = 5;
- }
- for (ui i = 0; i < L; i++)
- {
- a[i][0] = 6;
- a[i][C - 1] = 6;
- }
- a[0][0] = 1; // ╔
- a[0][C - 1] = 2; // ╗
- a[L - 1][0] = 3; // ╚
- a[L - 1][C - 1] = 4;// ╝
- a[2][0] = 7; // ╠
- a[2][C - 1] = 8; // ╣
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement