1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| Procedure OpenDialog(id, Dialog_Larg, Dialog_Haut, Dialog_Texte.s, Window_Main, Dialog_Option)
Protected Valeur.l
Valeur.l=OpenWindow(id, 0, 0, Dialog_Larg, Dialog_Haut, Dialog_Texte, Dialog_Option, WindowID(Window_Main))
If id=#PB_Any
id=Valeur
EndIf
DisableWindow(Window_Main, 1)
ProcedureReturn Valeur
EndProcedure
Procedure CloseDialog(Window_Dialog.l, Window_Main.l)
DisableWindow(Window_Main, 0)
SetActiveWindow_(Window_Main)
CloseWindow(Window_Dialog)
EndProcedure
OpenWindow(1, 200, 200, 400, 400, "Fenêtre principale", #PB_Window_SystemMenu)
StringGadget(0, 100, 20, 180, 20, "")
;--------------------------------------------------------------------
Dialog=OpenDialog(#PB_Any, 280, 100, "Boite de Dialogue", 1, #PB_Window_WindowCentered)
;Je crée une liste de gadget comme pour une fenêtre normal
TextGadget(2, 40, 10, 180, 20, "Entrez le mot de passe pour continuer", #PB_Text_Center)
StringGadget(3, 40, 40, 180, 20, "", #PB_String_Password)
ButtonGadget(4, 80, 70, 100, 20, "OK")
;--------------------------------------------------------------------
Repeat
EventID.l=WaitWindowEvent()
Select EventID
Case #PB_Event_Gadget
Select EventGadget()
Case 4
texte.s=GetGadgetText(3)
If texte<>""
SetGadgetText(0, "Mot de passe correct")
EndIf
CloseDialog(Dialog,1)
EndSelect
Case #PB_Event_CloseWindow
Quit=1
EndSelect
Until Quit=1 |
Partager