Example: Meter/Slider Widgets
|
20 ! Example: METER/SLIDER Widgets
30 !
40 ! This program generates a METER and a SLIDER widget.
50 ! As you change the value of the SLIDER widget by moving
60 ! the slider bar, the changed value is displayed on the
70 ! METER widget.
80 !
90 ! *******************************************************
100 !
110 ASSIGN @Meter TO WIDGET "METER"
120 CONTROL @Meter;SET ("X":10,"Y":50,"TITLE":" METER","BACKGROUND":1)
130 CONTROL @Meter;SET ("HEIGHT":225)
140 CONTROL @Meter;SET ("SYSTEM MENU":"Quit")
150 !
160 ASSIGN @Slider TO WIDGET "SLIDER"
170 CONTROL @Slider;SET ("X":250,"Y":50,"WIDTH":150,"TITLE":" SLIDER")
180 CONTROL @Slider;SET ("BACKGROUND":9)
190 CONTROL @Slider;SET ("SYSTEM MENU":"Quit")
200 !
210 ON EVENT @Meter,"SYSTEM MENU" GOTO Finis
220 ON EVENT @Slider,"SYSTEM MENU" GOTO Finis
230 ON EVENT @Slider,"CHANGED" GOSUB Event_handler
240 !
250 LOOP
260 WAIT FOR EVENT
270 END LOOP
280 !
290 Event_handler: !
300 STATUS @Slider;RETURN ("VALUE":Value)
310 CONTROL @Meter;SET ("VALUE":Value)
320 RETURN
330 !
340 Finis: !
350 ASSIGN @Meter TO * ! Delete METER widget
360 ASSIGN @Slider TO * ! Delete SLIDER widget
370 END