REMARQUE: Ceci n'est qu'un teste, donc absolument pas finalisé.
Je sais que beaucoup d'entre-vous sont opposé au développement de type Poo. Mais voila ce que cela pourrait donné pour créer une fenêtre de type dialogue.
Dans ce teste je peux enchevêtrer plusieurs containers.
N'hésiter pas à donné votre avis, cela m'intéresse
lien Github
Code de l'exemple
Code : Tout sélectionner
XIncludeFile "DIALOG.pbi"
EnableExplicit
Global myForm.DIALOG::_DIALOG = DIALOG::New(0,0,0,0,"Teste")
Global.CONTAINER::_CONTAINER mainContainer,ContentContainer,ButtonContainer
Global.GADGET::_GADGET name,address,city,ButtonValidate,ButtonChancel
; Create main container
mainContainer=myForm\AddContainer("item:1")
; Create a container for the fields it's a son of main container.
ContentContainer=mainContainer\AddContainer("no",CONTAINER::#Vertical)
; Create a container for the buttons it's a son of main container.
ButtonContainer=mainContainer\AddContainer("no",CONTAINER::#Vertical)
; set width for all buttons
ButtonContainer\SetWidth(100)
; set width for all fields
ContentContainer\SetWidth(300)
; add fields to their container
name=ContentContainer\AddStringGadget("Name")
address=ContentContainer\AddStringGadget("Address")
city=ContentContainer\AddStringGadget("City")
; add buttons to their container
ButtonValidate=ButtonContainer\AddButtonGadget("Validate")
ButtonChancel=ButtonContainer\AddButtonGadget("Chancel")
; define some procedures for testing.
Procedure EventToValide(*gadget.GADGET::_GADGET)
MessageRequester("Info","Clic sur "+*gadget\GetTitle())
EndProcedure
Procedure EventToChancel(*gadget.GADGET::_GADGET)
MessageRequester("Info","Clic sur "+*gadget\GetTitle())
End
EndProcedure
; Add callback at validate button
ButtonValidate\AddCallback(@EventToValide())
; Add callback at chancel button
ButtonChancel\AddCallback(@EventToChancel())
If Not myForm\Open()
End
EndIf
Repeat
WaitWindowEvent()
ForEver