HTBasic Help
×
Menu
Index

Example: Bar Widget

 
10     ! **********************************************************
20     ! Example: BAR Widget
30     !
40     ! This program creates a BAR widget with three ranges.
50     ! As the bar height progesses from the LOW range through
60     ! the middle range to the HIGH range, the bar color changes
70     ! from green to yellow to red. When the bar is in the LOW
80     ! or the HIGH range, the program beeps throughout the range.
90     !
100   ! **********************************************************
110   !
120   INTEGER N,M
130   ASSIGN @Bar TO WIDGET "BAR"
140   CONTROL @Bar;SET ("TITLE":" Example: BAR Widget")
150   CONTROL @Bar;SET ("X":100,"Y":20,"WIDTH":225,"HEIGHT":200)
160   CONTROL @Bar;SET ("ALARM RANGES":"LOW,HIGH","ALARM TYPE":"BEEP")
170   CONTROL @Bar;SET ("LOW LIMIT":20,"HIGH LIMIT":80)
180   CONTROL @Bar;SET ("SYSTEM MENU":"Quit")
190   ON EVENT @Bar,"SYSTEM MENU" GOTO Finis
200   !
210   FOR M=1 TO 3
220     FOR N=1 TO 100
230       WAIT .05
240       CONTROL @Bar;SET ("VALUE":N)
250     NEXT N
260     WAIT 1
270   NEXT M
280   !
290 Finis:   !
300   ASSIGN @Bar TO *                                ! Delete BAR widget
310   END