Visual Designer
Publié : mar. 07/mars/2006 23:11
Vous avez vu le code généré pour la boucle par le nouveau Visual Designer?
Qu'est-ce que vous en pensez?
Vous pensez qu'il y a vraiment besoin de se compliquer la vie à ce point là! L'ancien systeme de boucle fonctionne toujours très bien.
Qu'est-ce que vous en pensez?
Vous pensez qu'il y a vraiment besoin de se compliquer la vie à ce point là! L'ancien systeme de boucle fonctionne toujours très bien.
Code : Tout sélectionner
Global Window_0
Structure VisualDesignerGadgets
Gadget.l
EventFunction.l
EndStructure
Global NewList EventProcedures.VisualDesignerGadgets()
Procedure RegisterGadgetEvent(Gadget, *Function)
If IsGadget(Gadget)
AddElement(EventProcedures())
EventProcedures()\Gadget = Gadget
EventProcedures()\EventFunction = *Function
EndIf
EndProcedure
Procedure CallEventFunction(Window, Event, Gadget, Type)
ForEach EventProcedures()
If EventProcedures()\Gadget = Gadget
CallFunctionFast(EventProcedures()\EventFunction, Window, Event, Gadget, Type)
LastElement(EventProcedures())
EndIf
Next
EndProcedure
Procedure Open_Window_0()
Window_0 = OpenWindow(#PB_Any, 200, 200, 200, 200, #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar , "Window 0")
If Window_0
If CreateGadgetList(WindowID(Window_0))
EndIf
EndIf
EndProcedure
Open_Window_0()
Repeat
Event = WaitWindowEvent()
Gadget = EventGadget()
Type = EventType()
Window = EventWindow()
Select Event
Case #PB_Event_Gadget
CallEventFunction(Window, Event, Gadget, Type)
EndSelect
Until Event = #PB_Event_CloseWindow
End