voila j'ai fait un petit convertisseur euro, francs basic tres simple d'utilisation




Code : Tout sélectionner
;- Window Constants
Enumeration
#Window_0
EndEnumeration
;- Gadget Constants
Enumeration
#String_0
#String_1
#String_2
#String_3
#Button_0
#Button_1
#texte_0
#texte_1
EndEnumeration
;on ouvre windows
If OpenWindow(#Window_0, 282, 57, 320, 150, #PB_Window_SystemMenu | #PB_Window_TitleBar | #PB_Window_ScreenCentered , "convertisseur euro / francs")
If CreateGadgetList(WindowID())
StringGadget(#String_0, 10, 30, 140, 25, "");le string numero 1 sert a a mrquer la somme en franc
StringGadget(#String_1, 10, 115, 140, 25, "");le string numero 2 sert a marquer la somme en euro apres appuie du bouttons euro
ButtonGadget(#Button_0, 20, 70, 120, 25, "converir francs");le boutton de convertion
StringGadget(#String_2, 170, 30, 140, 25, "");le string numero 1 sert a a mrquer la somme en franc
StringGadget(#String_3, 170, 115, 140, 25, "");le string numero 2 sert a marquer la somme en euro apres appuie du bouttons euro
ButtonGadget(#Button_1, 180, 70, 120, 25, "converir euro");le boutton de convertion
TextGadget(#texte_0, 45, 10, 100, 20, "euro ---> francs")
TextGadget(#texte_1, 205, 10, 100, 20, "francs ---> euro")
EndIf
EndIf
Repeat
If StartDrawing(WindowOutput())
DrawingMode(1)
Line(160, 0, 0, 150 , RGB(0,0,0))
StopDrawing()
EndIf
Event = WaitWindowEvent()
If Event = #PB_EventGadget
Select EventGadgetID()
Case #Button_0
ValFranc.f = ValF(GetGadgetText(#String_0))
Beep(800,50)
If ValFranc
ValEuros.f = ValFranc * 6.55957
SetGadgetText(#String_1, StrF(ValEuros, 2))
EndIf
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Case #Button_1
ValFranc.f = ValF(GetGadgetText(#String_2))
Beep(800,50)
If ValFranc
ValEuros.f = ValFranc / 6.55957
SetGadgetText(#String_3, StrF(ValEuros, 2))
EndIf
EndSelect
EndIf
If Event = #PB_EventCloseWindow
Quit = 1
EndIf
Until Quit ;ferme la fenetre
End
@++