Code : Tout sélectionner
; réalisez par : gadget35
; le : 06/11/05
; à : 20 h 11 min
OpenWindow(0,0,0,500,500,#PB_Window_SystemMenu,"page perso")
CreateGadgetList(WindowID(0))
ComboBoxGadget(1,200,250,100,125)
AddGadgetItem(1,0,"<aucun>")
StringGadget(2,200,300,150,20,"",#PB_String_Password)
ButtonGadget(3,325,250,50,25,"valider")
ButtonGadget(4,200,100,100,50,"inscription")
StringGadget(6,60,100,100,20,"")
StringGadget(7,60,150,100,20,"",#PB_String_Password)
ButtonGadget(8,80,200,50,25,"valider")
Frame3DGadget(9,50,60,120,175,"inscription")
TextGadget(10,70,80,50,20,"login:")
TextGadget(11,70,130,50,20,"passe:")
DisableGadget(6,1)
DisableGadget(7,1)
DisableGadget(8,1)
DisableGadget(9,1)
DisableGadget(10,1)
DisableGadget(11,1)
Global passe.s
Global pointeur
pointeur = 1
Dim passe.s(9999)
Procedure save()
EndProcedure
Procedure log1()
EndProcedure
Procedure log2()
EndProcedure
Procedure inscription()
DisableGadget(6,0)
DisableGadget(7,0)
DisableGadget(8,0)
DisableGadget(9,0)
DisableGadget(10,0)
DisableGadget(11,0)
Repeat
If EventGadgetID()=8
AddGadgetItem(1,pointeur,GetGadgetText(6))
passe.s(pointeur) = GetGadgetText(7)
pointeur = pointeur + 1
SetGadgetState(1,pointeur)
DisableGadget(6,1)
DisableGadget(7,1)
DisableGadget(8,1)
DisableGadget(9,1)
DisableGadget(10,1)
DisableGadget(11,1)
SetGadgetText(6,"")
SetGadgetText(7,"")
Break
EndIf
Until WaitWindowEvent()=#PB_Event_CloseWindow
EndProcedure
Procedure identification()
Select GetGadgetState(1)
Case 0
MessageRequester("login","veuiller selectioner un login (ou vous inscrire)")
Case 1
If GetGadgetText(2) = passe.s(1)
log1()
Else
MessageRequester("code","faux code")
EndIf
Case 2
If GetGadgetText(2) = passe.s(2)
Log2()
Else
MessageRequester("code","faux code")
EndIf
EndSelect
EndProcedure
Repeat
Select EventGadgetID()
Case 3
quit = 1
identification()
Case 4
inscription()
EndSelect
Until WaitWindowEvent()=#PB_Event_CloseWindow Or quit = 1
save()
End