Problème de détection de la souris
Bonjour à tous,
je suis nouveau sur ce forum et je l'ai parcouru, mais je n'ai trouvé aucune information concernant mon problème.
Je cherche à gérer un menu dans la fenêtre texte avec la souris.
Le problème est que je n'ai aucun retour quand je cherche à connaitre les valeur des GETMOUSEY et GETMOUSEBUTTONS.
même les setmousexy,showmouse... ont l'air inactifs.
voici le code concerné :
Code:
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
| pos := 1 ;
x1 := 0 ;
x2 := 0 ;
x3 := 0 ;
x4 := 0 ;
x5 := 0 ;
x6 := 0 ;
x7 := 0 ;
detectmouse ;
InitMouse ;
showmouse ;
setmousexy(10,10) ;
repeat
ms1 :
clrscr ;
textbackground(15) ;
textcolor(0) ;
writeln('SELECTIONNEZ VOTRE UNITE :') ;
writeln ;
writeln ;
writeln ;
writeln(' ');
textcolor(x1) ;
writeln(' D5 ');
textcolor(0) ;
writeln(' ');
textcolor(x2) ;
writeln(' Visco ');
textcolor(0) ;
writeln(' ');
textcolor(x3) ;
writeln(' D2 ');
textcolor(0) ;
writeln(' ');
textcolor(x4) ;
writeln(' SDB ');
textcolor(0) ;
writeln(' ');
textcolor(x5) ;
writeln(' DAS1 ');
textcolor(0) ;
writeln(' ');
textcolor(x6) ;
writeln(' CH-CH ');
textcolor(0) ;
writeln(' ');
textcolor(x7) ;
writeln(' BHV ');
textcolor(0) ;
writeln(' ');
writeln ;
ms2 :
if GetMouseY = 5
then begin
x1 := 7 ;
x2 := 0 ;
x3 := 0 ;
x4 := 0 ;
x5 := 0 ;
x6 := 0 ;
x7 := 0 ;
goto ms1 ;
end ;
if GetMouseY = 7
then begin
x1 := 0 ;
x2 := 7 ;
x3 := 0 ;
x4 := 0 ;
x5 := 0 ;
x6 := 0 ;
x7 := 0 ;
goto ms1 ;
end ;
if GetMouseY = 9
then begin
x1 := 0 ;
x2 := 0 ;
x3 := 7 ;
x4 := 0 ;
x5 := 0 ;
x6 := 0 ;
x7 := 0 ;
goto ms1 ;
end ;
if GetMouseY = 11
then begin
x1 := 0 ;
x2 := 0 ;
x3 := 0 ;
x4 := 7 ;
x5 := 0 ;
x6 := 0 ;
x7 := 0 ;
goto ms1 ;
end ;
if GetMouseY = 13
then begin
x1 := 0 ;
x2 := 0 ;
x3 := 0 ;
x4 := 0 ;
x5 := 7 ;
x6 := 0 ;
x7 := 0 ;
goto ms1 ;
end ;
if GetMouseY = 15
then begin
x1 := 0 ;
x2 := 0 ;
x3 := 0 ;
x4 := 0 ;
x5 := 0 ;
x6 := 7 ;
x7 := 0 ;
goto ms1 ;
end ;
if GetMouseY = 17
then begin
x1 := 0 ;
x2 := 0 ;
x3 := 0 ;
x4 := 0 ;
x5 := 0 ;
x6 := 0 ;
x7 := 7 ;
goto ms1 ;
end ;
if (GetMouseY=5)and(GetMouseButtons=MouseLeftButton)
then begin
unite := 'D5' ; pos := 0 ;
end ;
if (GetMouseY=7)and(GetMouseButtons=MouseLeftButton)
then begin
unite := 'Visco' ; pos := 0 ;
end ;
if (GetMouseY=9)and(GetMouseButtons=MouseLeftButton)
then begin
unite := 'D2' ; pos := 0 ;
end ;
if (GetMouseY=11)and(GetMouseButtons=MouseLeftButton)
then begin
unite := 'SDB' ; pos := 0 ;
end ;
if (GetMouseY=13)and(GetMouseButtons=MouseLeftButton)
then begin
unite := 'DAS1' ; pos := 0 ;
end ;
if (GetMouseY=15)and(GetMouseButtons=MouseLeftButton)
then begin
unite := 'CH-CH' ; pos := 0 ;
end ;
if (GetMouseY=17)and(GetMouseButtons=MouseLeftButton)
then begin
unite := 'BHV' ; pos := 0 ;
end ;
goto ms2 ;
until pos=0 ;
hidemouse;
DoneMouse ; |
Le but est de faire changer la couleur du texte au passage de la souris et d'attribuer une valeur à 'unite' lors d'un clic gauche.
Merci d'avance pour vos réponses.