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

BIN
main.exe

Binary file not shown.

View file

@ -1,55 +1,136 @@
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include "screenManager.h"
void menu() {
int i=0;
////////////////////////// Menu 1 ////////////////////////////////
printf("\n 1/ Gestion des conferences\n 2/ Gestion des abonnes\n 3/ Participer a une conference");
void goToCoords(int x, int y)
{
COORD coords;
coords.X = x;
coords.Y = y;
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 6/ Quitter\n");
scanf("%d",&i);
//////////////////////////////////////////////////////////////////
switch (i){
//////////////////////// Menu conf /////////////////////////
case 1:{
printf("\n 1/ Voir la liste des conferences\n 2/ Ajouter une conference \n 3/ Suprimer une conference\n 4/ Retour\n");
break;
}
/////////////////////// Menu abonne /////////////////////////
case 2: {
printf("\n 1/ Voir la liste des abonnes\n 2/ Ajouter un abonne \n 3/ Suprimer un abonne\n 4/ Retour\n");
break;
}
case 3: {
printf("\n Nom de l'abonne : \n Nom de la conference : \n Note de la conference : ");
break;
}
case 4: {
printf("\n Nom : \n Note : ");
break;
}
case 5: {
printf("\n Entrer le nom de la conference : ");
break;
}
case 6: {
break;
}
}
}
*/