This commit is contained in:
Lukian 2023-11-13 19:31:59 +01:00
parent e704df4a8d
commit d149e5c768
4 changed files with 103 additions and 22 deletions

BIN
a.exe Normal file

Binary file not shown.

4
main.c
View file

@ -5,7 +5,7 @@
int main() int main()
{ {
ptConf confChain = newConfChain(); /*ptConf confChain = newConfChain();
ptListener listenerChain = newListenerChain(); ptListener listenerChain = newListenerChain();
addConf(confChain, "test", "tesst", 21, 120, 2023); addConf(confChain, "test", "tesst", 21, 120, 2023);
@ -26,7 +26,7 @@ int main()
while (py -> next != NULL) { while (py -> next != NULL) {
printf("name: %s\nage: %d\nlevel: %d", py -> name, py -> age, py -> level); printf("name: %s\nage: %d\nlevel: %d", py -> name, py -> age, py -> level);
py = py -> next; py = py -> next;
} }*/
menu(); menu();

BIN
main.exe

Binary file not shown.

View file

@ -1,13 +1,94 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <windows.h> #include <windows.h>
#include "screenManager.h" #include "screenManager.h"
void menu() { void goToCoords(int x, int y)
int i=0; {
COORD coords;
////////////////////////// Menu 1 //////////////////////////////// coords.X = x;
coords.Y = y;
printf("\n 1/ Gestion des conferences\n 2/ Gestion des abonnes\n 3/ Participer a une conference"); SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coords);
}
void drawRectangle(int screenX, int screenY)
{
int lenght = screenX * 2 / 3, height = screenY * 1 / 2;
int i;
system("cls");
goToCoords(screenX * 1 / 6, 3);
printf("%c", 201);
i = lenght - 2;
while (i > 0)
{
printf("%c", 205);
i--;
}
printf("%c", 187);
i = height - 2;
while (i > 0)
{
goToCoords(screenX * 1 / 6, 3 + i);
printf("%c", 186);
goToCoords(screenX * 1 / 6 + lenght - 1, 3 + i);
printf("%c", 186);
i--;
}
goToCoords(screenX * 1 / 6, 2 + height);
printf("%c", 200);
i = lenght - 2;
while (i > 0)
{
printf("%c", 205);
i--;
}
printf("%c", 188);
}
void drawMenu(int screenX, int screenY) {
goToCoords(screenX * 1/6 + 3, 4);
printf("1/ Gestion des conferences");
goToCoords(screenX * 1/6 + 3, 5);
printf("2/ Gestion des abonnes");
goToCoords(screenX * 1/6 + 3, 6);
printf("3/ Participer a une conference");
goToCoords(screenX * 1/6 + 3, 7);
printf("4/ Voir la meilleure conference");
goToCoords(screenX * 1/6 + 3, 8);
printf("5/ Voir la participation a une conference");
goToCoords(screenX * 1/6 + 3, 9);
printf("6/ Quitter");
}
void menu()
{
CONSOLE_SCREEN_BUFFER_INFO info;
int columns, rows;
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &info);
columns = info.srWindow.Right - info.srWindow.Left + 1;
rows = info.srWindow.Bottom - info.srWindow.Top + 1;
drawRectangle(columns, rows);
drawMenu(columns, rows);
goToCoords(0, rows / 2 + 5);
printf("Que voulez vous choisir ? ");
int choice;
scanf("%d", &choice);
}
/*
int i=0;
////////////////////////// Menu 1 ////////////////////////////////
printf("\n 1/ Gestion des conferences\n 2/ Gestion des abonnes\n 3/ Participer a une conference");
printf("\n 4/ Voir la meilleure conference\n 5/ Voir la participation a une conference"); printf("\n 4/ Voir la meilleure conference\n 5/ Voir la participation a une conference");
printf("\n 6/ Quitter\n"); printf("\n 6/ Quitter\n");
@ -52,4 +133,4 @@ void menu() {
break; break;
} }
} }
} */