OPT PREPROCESS

MODULE 'feelin','libraries/feelin'

PROC main()
   DEF c,w,
	   g1,g2,g3,g4,g5,v1=0,v2=100

   IF feelinbase := OpenLibrary('feelin.library',0)
	  c := ClientObject,
		 Child, w := WindowObject, FA_Window_Title,'Feelin\a : Gauges',
			Child, HGroup, NoFrame, FA_ID,'Root',
			   Child, VGroup, NoFrame, ->FA_FixedHeight,TRUE,
				  Child, hGauge(0,100,25),
				  Child, hGauge(0,100,50),
				  Child, hGauge(0,100,75),
				  Child, hGauge(0,100,100),
				  Child, g5 := hGauge(0,100, 0),
			   End,

			   Child, VBar(2),

			   Child, VGroup, NoFrame, FA_FixedHeight,TRUE,
				  Child, g1 := hGauge(0,100,  0),
				  Child, g2 := hGauge(0,100,100),
				  Child, g3 := hGauge(0,100,  0),
				  Child, g4 := hGauge(0,100,100),
			   End,
			End,
		 End,
	  End

	  IF c
		 F_DoA(g1,FM_Notify,[FA_Numeric_Value,FV_Notify_Always, g4,3,FM_Set,FA_Numeric_Value,FV_Notify_Value])
		 F_DoA(g2,FM_Notify,[FA_Numeric_Value,FV_Notify_Always, g3,3,FM_Set,FA_Numeric_Value,FV_Notify_Value])
		 F_DoA(w,FM_Notify,[FA_Window_CloseRequest,TRUE,FV_Notify_Client,2,FM_Client_ReturnID,FV_Client_Quit])
		 F_Set(w,FA_Window_Open,TRUE)

		 WHILE F_DoA(c,FM_Client_Event,NIL) <> FV_Client_Quit
			F_Set(g1,FA_Numeric_Value,v1) ; INC v1 ; IF v1 = 100 THEN v1 := 0
			F_Set(g2,FA_Numeric_Value,v2) ; DEC v2 ; IF v2 = NIL THEN v2 := 100
			F_Set(g5,FA_Numeric_Value,Rnd(101))
		 ENDWHILE

		 F_DisposeObj(c)
	  ENDIF

	  CloseLibrary(feelinbase)
   ELSE
	  WriteF('Unable to open feelin.library\n')
   ENDIF
ENDPROC

PROC hGauge(min,max,val)
   RETURN GaugeObject, FA_Frame,FV_Frame_Gauge, FA_ChainToCycle,FALSE, FA_Numeric_Min,min, FA_Numeric_Max,max, FA_Numeric_Value,val, FA_Horizontal,TRUE, End
ENDPROC
