home *** CD-ROM | disk | FTP | other *** search
/ HTBasic 9.3 / HTBasic 9.3.iso / 93win / data1.cab / Basic_Plus_Examples / METRSLDR < prev    next >
Encoding:
Text File  |  2005-03-02  |  1.4 KB  |  38 lines

  1. 10    ! *******************************************************
  2. 20    ! Example: METER/SLIDER Widgets
  3. 30    !
  4. 40    ! This program generates a METER and a SLIDER widget.
  5. 50    ! As you change the value of the SLIDER widget by moving
  6. 60    ! the slider bar, the changed value is displayed on the
  7. 70    ! METER widget.
  8. 80    !
  9. 90    ! *******************************************************
  10. 100   !
  11. 110       ASSIGN @Meter TO WIDGET "METER"
  12. 120       CONTROL @Meter;SET ("X":10,"Y":50,"TITLE":" METER","BACKGROUND":1)
  13. 130       CONTROL @Meter;SET ("HEIGHT":225)
  14. 140       CONTROL @Meter;SET ("SYSTEM MENU":"Quit")
  15. 150   !
  16. 160       ASSIGN @Slider TO WIDGET "SLIDER"
  17. 170       CONTROL @Slider;SET ("X":250,"Y":50,"WIDTH":150,"TITLE":" SLIDER")
  18. 180       CONTROL @Slider;SET ("BACKGROUND":9)
  19. 190       CONTROL @Slider;SET ("SYSTEM MENU":"Quit")
  20. 200   !
  21. 210       ON EVENT @Meter,"SYSTEM MENU" GOTO Finis
  22. 220       ON EVENT @Slider,"SYSTEM MENU" GOTO Finis
  23. 230       ON EVENT @Slider,"CHANGED" GOSUB Event_handler
  24. 240   !
  25. 250       LOOP
  26. 260           WAIT FOR EVENT
  27. 270       END LOOP
  28. 280   !
  29. 290  Event_handler:!
  30. 300       STATUS @Slider;RETURN ("VALUE":Value)
  31. 310       CONTROL @Meter;SET ("VALUE":Value)
  32. 320       RETURN
  33. 330   !
  34. 340  Finis:!
  35. 350       ASSIGN @Meter TO *! Delete METER widget
  36. 360       ASSIGN @Slider TO *! Delete SLIDER widget
  37. 370       END
  38.