Yannick
Nombre de messages : 8610 Age : 52 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: Ma Glycemie Lun 12 Jan 2015 - 19:26 | |
| Je suis en train de faire un petit utilitaire pour ma belle maman et son diabète et je vous livre mes débuts. Non pas que ce soit un projet abouti mais j' y ai mis un nouveau type de menu maison. ( pour ce qui sont curieux, les images sont sur mon webdav MaGlycemie_buttons.zip ) - Code:
-
Dim no%,i%,ns%,sc2%,Tim%,pan%(7) Dim Dr% Dim Inf% Dim Pharm% Dim PanEtat%(7) Label Detect,Clic_menu
' Form 0 height 0,600 : Width 0,400 top 0,(screen_y-height(0))/2 : left 0,(screen_x-width(0))/2 Color 0,255,255,255 :Caption 0,"Ma Glycémie" :Font_name 0,"arial"
' Panels for i%=1 to 7 no%=no%+1 : Pan%(i%)=no% Panel no% : height no%,height(0)-38 : width no%,width(0)-16 : top no%,height(no%)*-1 color no%,255,255,255 :font_name no%,"Times new roman" : Font_size no%,10 next i%
' --Panel 1 ' --Panel 2 ' --Panel 3 ' --Panel 4
' --Panel 5 no%=no%+1 Alpha no% : Parent no%,pan%(5) : top no%,52 : left no%,10 : caption no%,"Dr :" font_color no%,145,0,10 : font_bold no%
no%=no%+1 : Dr%=no% Edit no% : Parent no%,pan%(5) : top no%,67 : left no%,10 : width no%,300 color no%,250,250,200 : font_bold no%
' --Panel 6 no%=no%+1 Alpha no% : Parent no%,pan%(6) : top no%,52 : left no%,10 : caption no%,"Infirmier (e) :" font_color no%,145,0,10 : font_bold no%
no%=no%+1 : inf%=no% Edit no% : Parent no%,pan%(6) : top no%,67 : left no%,10 : width no%,300 color no%,250,250,200 : font_bold no%
' --Panel 7 no%=no%+1 Alpha no% : Parent no%,pan%(7) : top no%,52 : left no%,10 : caption no%,"Pharmacie :" font_color no%,145,0,10 : font_bold no%
no%=no%+1 : Pharm%=no% Edit no% : Parent no%,pan%(7) : top no%,67 : left no%,10 : width no%,300 color no%,250,250,200 : font_bold no%
' Scene2d support du menu no%=no%+1 : sc2%=no% scene2d no% : height no%,32 : width no%,width(0)-16 : color no%,230,230,230 on_click no%,Clic_menu
' Sprite menu for i%=1 to 7 sprite i% : sprite_file_load i%,str$(i%)+".bmp": sprite_x_position i%,(i%*32)-32 next i%
' Timer no%=no%+1 : Tim%=no% Timer no% : Timer_interval no%,100 : on_timer no%,Detect
end
Detect: FindMenuButton() return
Clic_menu: Off_click sc2% if Menu%>0 and Menu%<8 for i%= 1 to 7 if PanEtat%(i%)=1 ShowHidePanel(i%) end_if next i% ShowHidePanel(Menu%) end_if On_click sc2%,Clic_menu return
Sub FindMenuButton() dim_local p1%,p2%,x% if variable("Menu%")=0 then dim Menu% p1%=mouse_x_position(sc2%) p2%=mouse_y_position(sc2%) for x%=0 to (7*32) step 32 if p1%<x% and p2%<30 Menu%=x%/30 cursor_point sc2% Select Menu% case 1 : caption 0,"Ma Glycémie [ Ajouter une glycémie ]" case 2 : caption 0,"Ma Glycémie [ Journal ]" case 3 : caption 0,"Ma Glycémie [ Graphique 12 mois ]" case 4 : caption 0,"Ma Glycémie [ Prescriptions ]" case 5 : caption 0,"Ma Glycémie [ Docteur ]" case 6 : caption 0,"Ma Glycémie [ Infirmière ]" case 7 : caption 0,"Ma Glycémie [ Pharmacie ]" end_select exit_for else caption 0,"Ma Glycémie" cursor_default sc2% end_if next x% End_sub
Sub ShowHidePanel(pn%) timer_off tim% dim_local x% if PanEtat%(pn%)=0 PanEtat%(pn%)=1 for x%=1 to height(Pan%(pn%)) top pan%(pn%),top(pan%(pn%))+1 display next x% else PanEtat%(pn%)=0 for x%=1 to height(Pan%(pn%)) top pan%(pn%),top(pan%(pn%))-1 display next x% end_if timer_on tim% End_sub
Si cela peut aider ou donner des idées... | |
|