Yannick
Nombre de messages : 8635 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: petit minuteur en panoramic Sam 19 Mar 2011 - 17:42 | |
| Voilà le code : - Code:
-
dim x,M% dim Tps% dim F1% dim h%,mn%,s%,r% label Init,Menu,Reglage,MAJ,Marche,Arret,Quitter
caption 0,"Minuteur Panoramic":width 0,260:height 0,100:color 0,0,0,0 main_menu 1 sub_menu 2:parent 2,1:caption 2,"Réglage":on_click 2,Menu sub_menu 3:parent 3,1:caption 3,"Marche" :on_click 3,Menu:inactive 3 sub_menu 4:parent 4,1:caption 4,"Arrêt" :on_click 4,Menu:inactive 4 sub_menu 5:parent 5,1:caption 5,"Quitter":on_click 5,Menu alpha 6 :top 6,10 :left 6,50 :caption 6,"00" :font_name 6,"times new roman" :font_size 6,18 font_color 6,250,250,1 alpha 7 :top 7,10 :left 7,78 :caption 7,":" :font_name 7,"times new roman" :font_size 7,18 font_color 7,250,250,1 alpha 8 :top 8,10 :left 8,90 :caption 8,"00" :font_name 8,"times new roman" :font_size 8,18 font_color 8,250,250,1 alpha 9 :top 9,10 :left 9,118 :caption 9,":" :font_name 9,"times new roman" :font_size 9,18 font_color 9,250,250,1 alpha 10:top 10,10:left 10,130:caption 10,"00":font_name 10,"times new roman":font_size 10,18 font_color 10,250,250,1 alpha 11:top 11,10:left 11,175:caption 11,"" :font_name 11,"times new roman":font_size 11,18
timer 12:timer_off 12
gosub Init end rem'____________________________________________________________________________ Init: timer_off 12 caption 6,"00":caption 8,"00":caption 10,"00" Tps%=0 return rem'____________________________________________________________________________ menu: for x=2 to 5 if clicked(x)=1 then M%=x next x select M% case 2 gosub Reglage case 3 timer_on 12 on_timer 12,Marche case 4 gosub Arret case 5 gosub Quitter end_select return rem'____________________________________________________________________________ Reglage: if F1%=1 Show 13 else F1%=1 form 13:caption 13,"Réglage":width 13,300:height 13,180:top 13,110:command_target_is 13 alpha 14:top 14,20:left 14,20:caption 14,"Nombre d'heures : ":font_name 14,"Arial" spin 15 :top 15,17:left 15,150:width 15,40:min 15,0:max 15,60 alpha 16:top 16,50:left 16,20:caption 16,"Nombre de minutes : ":font_name 16,"Arial" spin 17 :top 17,47:left 17,150:width 17,40:min 17,0:max 17,60 alpha 18:top 18,80:left 18,20:caption 18,"Nombre de secondes : ":font_name 18,"Arial" spin 19 :top 19,77:left 19,150:width 19,40:min 19,0:max 19,60 button 20:top 20,110:left 20,200:caption 20,"Ok":width 20,25:font_name 20,"Arial" on_click 20,MAJ:cursor_point 20 end_if return rem'____________________________________________________________________________ MAJ: Tps%=(val(text$(15))*3600)+(val(text$(17))*60)+val(text$(19)) if len(text$(15))=2 caption 6,text$(15) else caption 6,"0"+text$(15) end_if if len(text$(17))=2 caption 8,text$(17) else caption 8,"0"+text$(17) end_if if len(text$(19))=2 caption 10,text$(19) else caption 10,"0"+text$(19) end_if position 15,0:position 17,0:position 19,0 hide 13 command_target_is 13 active 3:active 4 return rem'____________________________________________________________________________ Marche: if Tps% <>0 Tps%=Tps%-1 h%=int(Tps%/3600) mn%=int(Tps%/60)-(h%*60) s%=Tps% -((h%*3600)+(mn%*60)) if len(str$(h%))<2 caption 6,"0"+str$(h%) else caption 6,str$(h%) end_if if len(str$(mn%))<2 caption 8,"0"+str$(mn%) else caption 8,str$(mn%) end_if if len(str$(s%))<2 caption 10,"0"+str$(s%) else caption 10,str$(s%) end_if if Tps%=0 timer_off 12 beep inactive 3 end_if else message "Valeur nul !" timer_off 12 inactive 3 end_if return rem'____________________________________________________________________________ Arret: timer_off 12 return rem'____________________________________________________________________________ Quitter: terminate
Dernière édition par ygeronimi le Sam 19 Mar 2011 - 18:52, édité 1 fois (Raison : Petites modifs affichage et sécurité) | |
|
jjn4
Nombre de messages : 2747 Date d'inscription : 13/09/2009
| Sujet: +++ Dim 20 Mar 2011 - 0:26 | |
| Eh, pas mal du tout ! Juste un détail : la sonnerie est un peu rudimentaire. Sinon, c'est | |
|