home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_tools / ledvb101 / ledtest.frm < prev    next >
Text File  |  1994-11-12  |  9KB  |  332 lines

  1. VERSION 2.00
  2. Begin Form ledtest 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "LED Examples"
  5.    ClientHeight    =   4575
  6.    ClientLeft      =   1290
  7.    ClientTop       =   2100
  8.    ClientWidth     =   7155
  9.    Height          =   4950
  10.    Left            =   1245
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   4575
  13.    ScaleWidth      =   7155
  14.    Top             =   1770
  15.    Width           =   7245
  16.    Begin LED LED4 
  17.       AutoSize        =   -1  'True
  18.       BackColor       =   &H00C0C0C0&
  19.       BevelInner      =   0  ' 0 - None
  20.       BevelOuter      =   1  ' 1 - Raised
  21.       BevelWidth      =   2
  22.       BorderHorizontal=   2
  23.       BorderVertical  =   0
  24.       BorderWidth     =   0
  25.       Direction       =   0  ' 0 - Forward
  26.       Height          =   480
  27.       LEDHeight       =   28
  28.       LEDIndex        =   0
  29.       LEDSep          =   2
  30.       LEDStyle        =   2  ' 2 - Bitmap
  31.       LEDWidth        =   25
  32.       Left            =   240
  33.       Mode            =   0  ' 0 - Value
  34.       MouseControl    =   -1  'True
  35.       NumLEDs         =   15
  36.       OffPictureGreen =   LEDTEST.FRX:0000
  37.       OffPictureRed   =   LEDTEST.FRX:01CA
  38.       OffPictureYellow=   LEDTEST.FRX:0394
  39.       OnPictureGreen  =   LEDTEST.FRX:055E
  40.       OnPictureRed    =   LEDTEST.FRX:0728
  41.       OnPictureYellow =   LEDTEST.FRX:08F2
  42.       Orientation     =   0  ' 0 - Horizontal
  43.       TabIndex        =   15
  44.       Top             =   3930
  45.       Value           =   0
  46.       Width           =   6165
  47.    End
  48.    Begin LED LED3 
  49.       AutoSize        =   -1  'True
  50.       BackColor       =   &H00C0C0C0&
  51.       BevelInner      =   0  ' 0 - None
  52.       BevelOuter      =   2  ' 2 - Inset
  53.       BevelWidth      =   2
  54.       BorderHorizontal=   0
  55.       BorderVertical  =   2
  56.       BorderWidth     =   2
  57.       Direction       =   0  ' 0 - Forward
  58.       Height          =   600
  59.       LEDHeight       =   28
  60.       LEDIndex        =   0
  61.       LEDSep          =   0
  62.       LEDStyle        =   2  ' 2 - Bitmap
  63.       LEDWidth        =   25
  64.       Left            =   240
  65.       Mode            =   0  ' 0 - Value
  66.       MouseControl    =   0   'False
  67.       NumLEDs         =   15
  68.       OffPictureGreen =   LEDTEST.FRX:0ABC
  69.       OffPictureRed   =   LEDTEST.FRX:0C86
  70.       OffPictureYellow=   LEDTEST.FRX:0E50
  71.       OnPictureGreen  =   LEDTEST.FRX:101A
  72.       OnPictureRed    =   LEDTEST.FRX:11E4
  73.       OnPictureYellow =   LEDTEST.FRX:13AE
  74.       Orientation     =   0  ' 0 - Horizontal
  75.       TabIndex        =   14
  76.       Top             =   1140
  77.       Value           =   0
  78.       Width           =   5745
  79.    End
  80.    Begin LED LED1 
  81.       AutoSize        =   0   'False
  82.       BackColor       =   &H00C0C0C0&
  83.       BackgroundPicture=   LEDTEST.FRX:1578
  84.       BevelInner      =   0  ' 0 - None
  85.       BevelOuter      =   1  ' 1 - Raised
  86.       BevelWidth      =   2
  87.       BorderHorizontal=   20
  88.       BorderVertical  =   1
  89.       BorderWidth     =   4
  90.       Direction       =   1  ' 1 - Backward
  91.       Height          =   3315
  92.       LEDHeight       =   11
  93.       LEDIndex        =   0
  94.       LEDSep          =   0
  95.       LEDStyle        =   0  ' 0 - Rectangular
  96.       LEDWidth        =   11
  97.       Left            =   6060
  98.       Mode            =   0  ' 0 - Value
  99.       MouseControl    =   0   'False
  100.       NumLEDs         =   15
  101.       Orientation     =   1  ' 1 - Vertical
  102.       TabIndex        =   13
  103.       Top             =   270
  104.       Value           =   0
  105.       Width           =   915
  106.    End
  107.    Begin Frame Frame3 
  108.       Caption         =   "Direction"
  109.       Height          =   1155
  110.       Left            =   4110
  111.       TabIndex        =   10
  112.       Top             =   2430
  113.       Width           =   1815
  114.       Begin OptionButton Option3 
  115.          Caption         =   "Backward"
  116.          Height          =   255
  117.          Index           =   1
  118.          Left            =   300
  119.          TabIndex        =   12
  120.          Top             =   630
  121.          Width           =   1245
  122.       End
  123.       Begin OptionButton Option3 
  124.          Caption         =   "Forward"
  125.          Height          =   255
  126.          Index           =   0
  127.          Left            =   300
  128.          TabIndex        =   11
  129.          Top             =   360
  130.          Width           =   1245
  131.       End
  132.    End
  133.    Begin Frame Frame2 
  134.       Caption         =   "Mode"
  135.       Height          =   1035
  136.       Left            =   2310
  137.       TabIndex        =   6
  138.       Top             =   2460
  139.       Width           =   1695
  140.       Begin OptionButton Option2 
  141.          Caption         =   "Bitwise"
  142.          Height          =   195
  143.          Index           =   1
  144.          Left            =   360
  145.          TabIndex        =   8
  146.          Top             =   570
  147.          Width           =   1125
  148.       End
  149.       Begin OptionButton Option2 
  150.          Caption         =   "Value"
  151.          Height          =   195
  152.          Index           =   0
  153.          Left            =   360
  154.          TabIndex        =   7
  155.          Top             =   330
  156.          Width           =   1065
  157.       End
  158.    End
  159.    Begin Frame Frame1 
  160.       Caption         =   "LEDStyle"
  161.       Height          =   1365
  162.       Left            =   270
  163.       TabIndex        =   2
  164.       Top             =   2430
  165.       Width           =   1965
  166.       Begin OptionButton Option1 
  167.          Caption         =   "Bitmap"
  168.          Height          =   225
  169.          Index           =   2
  170.          Left            =   180
  171.          TabIndex        =   5
  172.          Top             =   810
  173.          Width           =   1665
  174.       End
  175.       Begin OptionButton Option1 
  176.          Caption         =   "Circular"
  177.          Height          =   225
  178.          Index           =   1
  179.          Left            =   180
  180.          TabIndex        =   4
  181.          Top             =   570
  182.          Width           =   1665
  183.       End
  184.       Begin OptionButton Option1 
  185.          Caption         =   "Rectangle"
  186.          Height          =   225
  187.          Index           =   0
  188.          Left            =   180
  189.          TabIndex        =   3
  190.          Top             =   330
  191.          Width           =   1665
  192.       End
  193.    End
  194.    Begin HScrollBar HScroll1 
  195.       Height          =   255
  196.       Left            =   570
  197.       Max             =   15
  198.       TabIndex        =   1
  199.       Top             =   1950
  200.       Width           =   5325
  201.    End
  202.    Begin LED LED2 
  203.       AutoSize        =   -1  'True
  204.       BackColor       =   &H00C0C0C0&
  205.       BevelInner      =   0  ' 0 - None
  206.       BevelOuter      =   2  ' 2 - Inset
  207.       BevelWidth      =   3
  208.       BorderHorizontal=   10
  209.       BorderVertical  =   2
  210.       BorderWidth     =   2
  211.       Direction       =   0  ' 0 - Forward
  212.       Height          =   510
  213.       LEDHeight       =   20
  214.       LEDIndex        =   0
  215.       LEDSep          =   2
  216.       LEDStyle        =   1  ' 1 - Circular
  217.       LEDWidth        =   20
  218.       Left            =   450
  219.       Mode            =   0  ' 0 - Value
  220.       MouseControl    =   0   'False
  221.       NumLEDs         =   15
  222.       Orientation     =   0  ' 0 - Horizontal
  223.       TabIndex        =   0
  224.       Top             =   510
  225.       Value           =   0
  226.       Width           =   5370
  227.    End
  228.    Begin Label Label1 
  229.       Caption         =   "Label1"
  230.       Height          =   165
  231.       Left            =   2490
  232.       TabIndex        =   9
  233.       Top             =   210
  234.       Width           =   1485
  235.    End
  236. End
  237.  
  238. Sub Form_Load ()
  239.  
  240.     For i = 0 To 8
  241.         led1.LEDIndex = i
  242.         led1.LEDColor = 2
  243.         led2.LEDIndex = i
  244.         led2.LEDColor = 2
  245.         led3.LEDIndex = i
  246.         led3.LEDColor = 2
  247.         led4.LEDIndex = i
  248.         led4.LEDColor = 2
  249.     Next
  250.  
  251.     For i = 9 To 12
  252.         led1.LEDIndex = i
  253.         led1.LEDColor = 1
  254.         led2.LEDIndex = i
  255.         led2.LEDColor = 1
  256.         led3.LEDIndex = i
  257.         led3.LEDColor = 1
  258.         led4.LEDIndex = i
  259.         led4.LEDColor = 1
  260.     Next
  261.  
  262.     For i = 13 To 15
  263.         led1.LEDIndex = i
  264.         led1.LEDColor = 0
  265.         led2.LEDIndex = i
  266.         led2.LEDColor = 0
  267.         led3.LEDIndex = i
  268.         led3.LEDColor = 0
  269.         led4.LEDIndex = i
  270.         led4.LEDColor = 0
  271.     Next
  272.  
  273.  
  274. End Sub
  275.  
  276. Sub HScroll1_Change ()
  277.  
  278.     led1.Value = Hscroll1
  279.     led2.Value = Hscroll1
  280.     led3.Value = Hscroll1
  281.     led4.Value = Hscroll1
  282.  
  283.     label1 = led2.Value
  284.  
  285.  
  286. End Sub
  287.  
  288. Sub HScroll1_Scroll ()
  289.  
  290.     led1.Value = Hscroll1
  291.     led2.Value = Hscroll1
  292.     led3.Value = Hscroll1
  293.     led4.Value = Hscroll1
  294.  
  295.     label1 = led2.Value
  296.  
  297. End Sub
  298.  
  299. Sub LED4_Click ()
  300.  
  301.     If led4.Value <= Hscroll1.Max Then
  302.         Hscroll1 = led4.Value
  303.     Else
  304.         label1 = led4.Value
  305.     End If
  306.  
  307. End Sub
  308.  
  309. Sub Option1_Click (index As Integer)
  310.  
  311.     led4.LEDStyle = index
  312.  
  313. End Sub
  314.  
  315. Sub Option2_Click (index As Integer)
  316.  
  317.     led4.Mode = index
  318.     If index = 1 Then
  319.         j = led4.NumLEDs - 1
  320.         If j > 31 Then j = 31
  321.  
  322.     End If
  323.  
  324. End Sub
  325.  
  326. Sub Option3_Click (index As Integer)
  327.  
  328.     led4.Direction = index
  329.  
  330. End Sub
  331.  
  332.