WhichHits?.gc

G4C
; illustration of use of xBEFORE to constitute a 'hitlist' of gadgets used in a clean way
; should permit you to optimise the layout of a first draft gui
WINBIG 0 -10 300 120 WhichHit?.gc
 
WINTYPE 11110001
 
xONLOAD
 Gosub #this Default
 
xONRELOAD
 Gosub #this Default
 
xONCLOSE
 GuiQuit #this
 
xROUTINE Default
 i = 0
 WHILE $i < 6
	Nr$i = 0
	++i
 ENDWHILE
 GuiOpen #this
 
xBEFORE        ; executed befor each command sequence attached to a gadget
 i = $$Gad.ID
 ++Nr$i
 j = 0
 
xONRMB  ; on Right Mouse button click
 Hits = ""
 i = 0
 WHILE $i < 6
	Hits = "$Hits\n$i $Nr$i"
	++i
 ENDWHILE
 EzReq $Hits OK var ; requester showing the hitlist
 
xBUTTON 0 0 60 17 "0" ; <<>> 
 GadID 0
 EzReq nul ok var
 
xBUTTON 60 0 60 17 "2" ; <<>> 
 GadID 2
 EzReq two ok var
 
xBUTTON 120 0 60 17 "3" ; <<>> 
 GadID 3
 EzReq three ok var
 
xBUTTON 180 0 60 17 "4" ; <<>> 
 GadID 4
 EzReq four ok var
 
xBUTTON 240 0 60 17 "5" ; <<>>
 GadID 5
 EzReq five ok var
 
 
xLISTVIEW 0 17 300 98  '' LVVar1 s:user-startup 30 MULTI
 GadID 1
 EzReq $LVVar1 ok var