Salut,
Comment être sûr, que si la touche ESC est pressée dans une DIALOGBOX ou un POPUP, de revenir à cette DIALOGBOX ou à ce POPUP ?
Utilisation de la variable "ok"?
zegoo (./12) :
En fait j'ai besoin d'initialiser p à une des valeurs souhaitées par défaut dans le popup; je ne peux donc utiliser cette méthode même si elle solutionne mon problème.
Prgm DelVar p ClrIO {"Choix 1","Super choix 2","Choix 3","Plus de choix"}lmen1 Custom Title "" Title " MENU " Title "" EndCustm CustmOn ClrHome Lbl m1 dim(lmen1[1])d0 For i,2,dim(lmen1) dim(lmen1[i])d1 If d1žd0 d1d0 EndFor 6*(2+iPart((37-d0)/2))x For i,1,dim(lmen1) Output 30+8*i,x,lmen1[i] EndFor 2p Output 30+8*p,x-18,"" 0k While k13 or k340 getKey()k ©descendre If k=344 and p<dim(lmen1) Then Output 30+8*p,x-18," " p+1p Output 30+8*p,x-18,"" ElseIf k=344 and p=4 Then Output 30+8*p,x-18," " 1p Output 30+8*p,x-18,"" EndIf ©monter If k=338 and p-1>0 Then Output 30+8*p,x-18," " p-1p Output 30+8*p,x-18,"" ElseIf k=338 and p=1 Then Output 30+8*p,x-18," " 4p Output 30+8*p,x-18,"" EndIf If k=13 or k=340 Exit EndWhile EndPrgm
2 -> p while .. getkey() -> k If deplacement Then p -> p_ancien If descendre mod(p-1, nb_choix) -> p If monter mod(p+1, nb_choix) -> p effacer_en(p_ancien) afficher_en(p) EndIf EndWhilete permettrait d'éviter les répétitions d'output, et puis ensuite tu pourrais facilement rajouter "aller tout en bas" (
if k=344 and p<dim(lst) Then p+1 -> p elseIf k=344 and p=dim(lst) Then 1 -> ppar
if k=344 mod(p, dim(lst))+1 -> p
if k=338 and p>1 Then p-1 -> p elseIf k=338 and p=1 Then dim(lst) -> ppar
if k=338 mod(p-2, dim(lst))+1 -> p