-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexecouti.c
executable file
·180 lines (180 loc) · 5.18 KB
/
execouti.c
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
#include <STDIO.H>
#include <CONIO.H>
#include <STRING.H>
#include "SOUREXEC/EXECCLAV.H"
#include "SOUREXEC/EXECGRAP.H"
#include "SOUREXEC/EXECOUTI.H"
#include "SOUREXEC/EXECCHAR.H"
void Marquer_Option (char,enreg_menu*,char);
void Marquer_Option_Texte (enreg_menu*,char);
void Afficher_Menu (enreg_menu *pt)
{
OCTET couleur;
short x_option;
short y_option;
short largeur_menu;
short hauteur_menu;
short hauteur_option;
short xg,xd;
short longueur;
char cpt;
largeur_menu = 0;
for (cpt = 0;
cpt < pt->nombre_option;
cpt ++)
{
longueur = strlen (pt->option [cpt]);
if (longueur > largeur_menu)
largeur_menu = longueur;
}
largeur_menu *= (8 * pt->echelle_x);
x_option = (pt->largeur_ecran - largeur_menu) / 2;
hauteur_menu = pt->nombre_option * (8 * pt->echelle_y);
if (pt->nombre_option > 1)
{
hauteur_option = (pt->hauteur_option_maxi - hauteur_menu) /
(pt->nombre_option - 1);
hauteur_option += (8 * pt->echelle_y);
}
y_option = pt->y_ecran;
for (cpt = 0;
cpt < pt->nombre_option;
cpt ++)
{
longueur = strlen (pt->option [cpt]);
longueur *= (8 * pt->echelle_x);
xg = ( (largeur_menu - longueur) / 2) + x_option;
xd = ( (xg + longueur) - pt->echelle_x) - 1;
pt->xgt [cpt] = xg;
pt->xdt [cpt] = xd;
pt->yt [cpt] = y_option;
if (pt->cl_fond == 255)
{
couleur = 240;
Print (pt->page,
pt->echelle_x,
pt->echelle_y,
xg - 1,
y_option,
couleur,
pt->cl_fond,
pt->option [cpt]);
Print (pt->page,
pt->echelle_x,
pt->echelle_y,
xg + 1,
y_option,
couleur,
pt->cl_fond,
pt->option [cpt]);
Print (pt->page,
pt->echelle_x,
pt->echelle_y,
xg,
y_option - 1,
couleur,
pt->cl_fond,
pt->option [cpt]);
Print (pt->page,
pt->echelle_x,
pt->echelle_y,
xg,
y_option + 1,
couleur,
pt->cl_fond,
pt->option [cpt]);
}
Print (pt->page,
pt->echelle_x,
pt->echelle_y,
xg,y_option,
pt->cl_car2,
pt->cl_fond,
pt->option [cpt]);
y_option += hauteur_option;
}
Marquer_Option (pt->page,pt,ON);
}
void Marquer_Option (char page,enreg_menu *pt,char etat)
{
Marquer_Option_Serpent (page,pt,etat);
Marquer_Option_Texte (pt,etat);
}
void Marquer_Option_Serpent (char page,enreg_menu *pt,char etat)
{
short xg,xd,y;
xg = pt->xgt [pt->select] - ( (3*7) + 2 );
xd = pt->xdt [pt->select] + 3;
y = pt->yt [pt->select] + ( ((pt->echelle_y * 7) - 11) / 2);
if (etat == ON)
{
Afficher_Bob (page,5,xg,y,MASK_ON);
Afficher_Bob (page,6,xg+ 7,y,MASK_ON);
Afficher_Bob (page,4,xg+14,y,MASK_ON);
Afficher_Bob (page,2,xd,y,MASK_ON);
Afficher_Bob (page,6,xd+ 7,y,MASK_ON);
Afficher_Bob (page,3,xd+14,y,MASK_ON);
}
else
{
Afficher_Bob (page,1,xg+ 0,y,MASK_ON);
Afficher_Bob (page,1,xg+ 7,y,MASK_ON);
Afficher_Bob (page,1,xg+14,y,MASK_ON);
Afficher_Bob (page,1,xd+ 0,y,MASK_ON);
Afficher_Bob (page,1,xd+ 7,y,MASK_ON);
Afficher_Bob (page,1,xd+14,y,MASK_ON);
}
}
void Marquer_Option_Texte (enreg_menu *pt,char etat)
{
if (etat == ON)
{
Print (pt->page,
pt->echelle_x,
pt->echelle_y,
pt->xgt [pt->select],
pt->yt [pt->select],
pt->cl_car1,
pt->cl_fond,
pt->option [pt->select]);
}
else
{
Print (pt->page,
pt->echelle_x,
pt->echelle_y,
pt->xgt [pt->select],
pt->yt [pt->select],
pt->cl_car2,
pt->cl_fond,
pt->option [pt->select]);
}
}
void Select_Option (char page,enreg_menu *pt)
{
Marquer_Option_Serpent (page,pt,ON);
do
{
if (pt->nombre_option > 1)
{
if (Lire_Action_Touche (FLECHE_BAS) == 1)
{
Marquer_Option (page,pt,OFF);
pt->select ++;
if (pt->select >= pt->nombre_option)
pt->select = 0;
Marquer_Option (page,pt,ON);
}
if (Lire_Action_Touche (FLECHE_HAUT) == 1)
{
Marquer_Option (page,pt,OFF);
pt->select --;
if (pt->select < 0)
pt->select = pt->nombre_option - 1;
Marquer_Option (page,pt,ON);
}
}
}
while (Lire_Action_Touche (ENTREE) != 1);
Marquer_Option_Serpent (page,pt,OFF);
}