Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case на принт списка:
- if (!beg)
- {
- numberOfMessage = 1;
- counterMenu -= 0;
- continue;
- }
- else
- {
- system("cls");
- int depth = foundDepth(beg);
- int left_bound = 1;
- int right_bound = 7;
- key = 's';
- int pos = left_bound;
- cur = getElement(beg, 1);
- while (1)
- {
- system("cls");
- printList(cur, pos, left_bound, right_bound + 1);
- key = _getch();
- if (key == 's' || key == 'S')
- pos += 1;
- if (key == 'w' || key == 'W')
- pos-=1;
- if (key == '*')
- break;
- if (pos < left_bound && pos > 0)
- {
- left_bound -= 7;
- right_bound = left_bound + 6;
- cur = getElement(beg, left_bound);
- system("cls");
- }
- if (pos > right_bound && pos < depth)
- {
- left_bound = right_bound + 1;
- right_bound += 7;
- cur = getElement(beg, left_bound);
- system("cls");
- }
- if (pos > depth)
- pos = depth;
- if (pos < 1)
- pos = 1;
- }
- key = 's';
- break;
- }
- }
- --------------------------------------------
- int printList(list *beg, int pos, int left_bound, int right_bound)
- {
- if (!beg)
- return 0;
- list *temp;
- temp = beg;
- int i = 1;
- int counter = left_bound;
- while (temp && counter < right_bound)
- {
- print(*temp, i, counter, pos);
- temp = temp->right;
- i += 2;
- counter++;
- }
- + каркас таблицы
- }
- ----------------------------------------------------
- печать одной записи
- ----------------------------------------------------
- void print(const list &info, int i, int counter, int position)
- {
- if (i == -1)
- printf("%-21s%-5s%-5s%-2s%-13s%-3s%-2s%-3s%-3s%-6s\n", info.data.name, info.data.t_number, info.data.birthday, info.data.gender, info.data.prof, info.data.exp, info.data.level, info.data.b_number, info.data.s_number, info.data.salary);
- else
- {
- if (position == counter)
- changeTextColor("red");
- //SetConsoleTextAttribute(hConsole, (WORD)((15 << 4) | 12));
- else
- changeTextColor("yellow");
- gotoxy(0, i + 3);
- printf(" %-4d%-21s%-6s%-7s%-3s%-14s%-5s%-4s%-4s%-4s%-6s\n", counter, info.data.name, info.data.t_number, info.data.birthday, info.data.gender, info.data.prof, info.data.exp, info.data.level, info.data.b_number, info.data.s_number, info.data.salary);
- SetConsoleCP(866);
- SetConsoleOutputCP(866);
- changeTextColor("lightblue");
- gotoxy(0, i + 3); cout << "\xBA";
- gotoxy(79, i + 3); cout << "\xBA";
- gotoxy(0, i + 4); cout << "\xCC";
- gotoxy(79, i + 4); cout << "\xB9";
- for (int j = 1; j < 79; j++)
- {
- gotoxy(j, i + 4);
- cout << "\xCD";
- if (j == 4 || j == 25 || j == 31 || j == 37 || j == 41 || j == 54 || j == 59 || j == 63 || j == 68 || j == 72)
- {
- gotoxy(j, i+3); cout << "\xBA";
- gotoxy(j, i+4); cout << "\xCE";
- }
- }
- SetConsoleCP(1251);
- SetConsoleOutputCP(1251);
- }
- return;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement