home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Power Pack / Visual_Basic4_Power_Pack.bin / vb4files / vbmaxlcd / demo.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-11-20  |  11.7 KB  |  376 lines

  1. VERSION 4.00
  2. Begin VB.Form frmDemo 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "VBMax Liquid Crystal Display Demo"
  5.    ClientHeight    =   3270
  6.    ClientLeft      =   60
  7.    ClientTop       =   345
  8.    ClientWidth     =   7815
  9.    Height          =   3675
  10.    Icon            =   "Demo.frx":0000
  11.    Left            =   0
  12.    LinkTopic       =   "Form1"
  13.    LockControls    =   -1  'True
  14.    MaxButton       =   0   'False
  15.    ScaleHeight     =   218
  16.    ScaleMode       =   3  'Pixel
  17.    ScaleWidth      =   521
  18.    Top             =   0
  19.    Width           =   7935
  20.    Begin VB.PictureBox picDate 
  21.       Height          =   210
  22.       Left            =   1050
  23.       ScaleHeight     =   150
  24.       ScaleWidth      =   915
  25.       TabIndex        =   26
  26.       Top             =   3000
  27.       Width           =   975
  28.    End
  29.    Begin VB.PictureBox picTime 
  30.       Height          =   210
  31.       Left            =   3240
  32.       ScaleHeight     =   150
  33.       ScaleWidth      =   795
  34.       TabIndex        =   25
  35.       Top             =   3000
  36.       Width           =   855
  37.    End
  38.    Begin VB.Timer Timer1 
  39.       Interval        =   500
  40.       Left            =   4380
  41.       Top             =   600
  42.    End
  43.    Begin VB.CommandButton cmdName 
  44.       Caption         =   "E&xit"
  45.       Height          =   315
  46.       Index           =   9
  47.       Left            =   6240
  48.       TabIndex        =   24
  49.       Top             =   2880
  50.       Width           =   1335
  51.    End
  52.    Begin VB.CommandButton cmdName 
  53.       Cancel          =   -1  'True
  54.       Caption         =   "&About"
  55.       Height          =   315
  56.       Index           =   8
  57.       Left            =   4860
  58.       TabIndex        =   23
  59.       Top             =   2880
  60.       Width           =   1335
  61.    End
  62.    Begin VB.Frame Frame5 
  63.       Caption         =   "More Examples"
  64.       Height          =   1815
  65.       Left            =   4740
  66.       TabIndex        =   14
  67.       Top             =   900
  68.       Width           =   2955
  69.       Begin VB.CommandButton cmdName 
  70.          Caption         =   "Alarm"
  71.          Height          =   315
  72.          Index           =   4
  73.          Left            =   120
  74.          TabIndex        =   21
  75.          Top             =   1380
  76.          Width           =   1335
  77.       End
  78.       Begin VB.CommandButton cmdName 
  79.          Caption         =   "Calculator"
  80.          Height          =   315
  81.          Index           =   0
  82.          Left            =   120
  83.          TabIndex        =   15
  84.          Top             =   300
  85.          Width           =   1335
  86.       End
  87.       Begin VB.CommandButton cmdName 
  88.          Caption         =   "Countdown"
  89.          Height          =   315
  90.          Index           =   1
  91.          Left            =   120
  92.          TabIndex        =   17
  93.          Top             =   660
  94.          Width           =   1335
  95.       End
  96.       Begin VB.CommandButton cmdName 
  97.          Caption         =   "Stopwatch"
  98.          Height          =   315
  99.          Index           =   2
  100.          Left            =   120
  101.          TabIndex        =   19
  102.          Top             =   1020
  103.          Width           =   1335
  104.       End
  105.       Begin VB.CommandButton cmdName 
  106.          Caption         =   "24 Hour Clock"
  107.          Height          =   315
  108.          Index           =   3
  109.          Left            =   1500
  110.          TabIndex        =   18
  111.          Top             =   660
  112.          Width           =   1335
  113.       End
  114.       Begin VB.CommandButton cmdName 
  115.          Caption         =   "Dialer"
  116.          Height          =   315
  117.          Index           =   5
  118.          Left            =   1500
  119.          TabIndex        =   20
  120.          Top             =   1020
  121.          Width           =   1335
  122.       End
  123.       Begin VB.CommandButton cmdName 
  124.          Caption         =   "12 Hour Clock"
  125.          Height          =   315
  126.          Index           =   6
  127.          Left            =   1500
  128.          TabIndex        =   16
  129.          Top             =   300
  130.          Width           =   1335
  131.       End
  132.       Begin VB.CommandButton cmdName 
  133.          Caption         =   "LCD Array"
  134.          Height          =   315
  135.          Index           =   7
  136.          Left            =   1500
  137.          TabIndex        =   22
  138.          Top             =   1380
  139.          Width           =   1335
  140.       End
  141.    End
  142.    Begin VB.Frame Frame1 
  143.       Caption         =   "LCD Attributes"
  144.       Height          =   1995
  145.       Left            =   120
  146.       TabIndex        =   1
  147.       Top             =   900
  148.       Width           =   4455
  149.       Begin VB.Frame Frame4 
  150.          Caption         =   "Colors"
  151.          Height          =   1290
  152.          Left            =   2820
  153.          TabIndex        =   10
  154.          Top             =   240
  155.          Width           =   1455
  156.          Begin VB.CommandButton Command7 
  157.             Caption         =   "BackColor"
  158.             Height          =   315
  159.             Left            =   180
  160.             TabIndex        =   12
  161.             Top             =   780
  162.             Width           =   1095
  163.          End
  164.          Begin VB.CommandButton Command6 
  165.             Caption         =   "ForeColor"
  166.             Height          =   315
  167.             Left            =   180
  168.             TabIndex        =   11
  169.             Top             =   360
  170.             Width           =   1095
  171.          End
  172.       End
  173.       Begin VB.Frame Frame2 
  174.          Caption         =   "Size"
  175.          Height          =   1260
  176.          Left            =   180
  177.          TabIndex        =   2
  178.          Top             =   240
  179.          Width           =   915
  180.          Begin VB.VScrollBar VScroll1 
  181.             Height          =   795
  182.             Left            =   420
  183.             Max             =   15
  184.             Min             =   -15
  185.             TabIndex        =   5
  186.             Top             =   305
  187.             Width           =   255
  188.          End
  189.          Begin VB.Label Label1 
  190.             AutoSize        =   -1  'True
  191.             BackStyle       =   0  'Transparent
  192.             Caption         =   "-"
  193.             BeginProperty Font 
  194.                name            =   "MS Sans Serif"
  195.                charset         =   0
  196.                weight          =   700
  197.                size            =   12
  198.                underline       =   0   'False
  199.                italic          =   0   'False
  200.                strikethrough   =   0   'False
  201.             EndProperty
  202.             Height          =   300
  203.             Left            =   180
  204.             TabIndex        =   3
  205.             Top             =   270
  206.             Width           =   105
  207.          End
  208.          Begin VB.Label Label2 
  209.             AutoSize        =   -1  'True
  210.             BackStyle       =   0  'Transparent
  211.             Caption         =   "+"
  212.             BeginProperty Font 
  213.                name            =   "MS Sans Serif"
  214.                charset         =   0
  215.                weight          =   700
  216.                size            =   12
  217.                underline       =   0   'False
  218.                italic          =   0   'False
  219.                strikethrough   =   0   'False
  220.             EndProperty
  221.             Height          =   300
  222.             Left            =   180
  223.             TabIndex        =   4
  224.             Top             =   840
  225.             Width           =   165
  226.          End
  227.       End
  228.       Begin VB.CheckBox Check1 
  229.          Caption         =   "Show unlit segments"
  230.          Height          =   300
  231.          Left            =   240
  232.          TabIndex        =   13
  233.          Top             =   1620
  234.          Value           =   1  'Checked
  235.          Width           =   1875
  236.       End
  237.       Begin VB.Frame Frame3 
  238.          Caption         =   "Alignment"
  239.          Height          =   1290
  240.          Left            =   1320
  241.          TabIndex        =   6
  242.          Top             =   240
  243.          Width           =   1275
  244.          Begin VB.OptionButton optAlign 
  245.             Caption         =   "Left"
  246.             Height          =   255
  247.             Index           =   0
  248.             Left            =   180
  249.             TabIndex        =   7
  250.             Top             =   300
  251.             Width           =   735
  252.          End
  253.          Begin VB.OptionButton optAlign 
  254.             Caption         =   "Right"
  255.             Height          =   255
  256.             Index           =   1
  257.             Left            =   180
  258.             TabIndex        =   8
  259.             Top             =   600
  260.             Value           =   -1  'True
  261.             Width           =   735
  262.          End
  263.          Begin VB.OptionButton optAlign 
  264.             Caption         =   "Center"
  265.             Height          =   255
  266.             Index           =   2
  267.             Left            =   180
  268.             TabIndex        =   9
  269.             Top             =   900
  270.             Width           =   915
  271.          End
  272.       End
  273.    End
  274.    Begin VB.PictureBox picLCD 
  275.       Height          =   435
  276.       Left            =   120
  277.       ScaleHeight     =   375
  278.       ScaleWidth      =   7515
  279.       TabIndex        =   0
  280.       Top             =   120
  281.       Width           =   7575
  282.    End
  283.    Begin VB.Label Label4 
  284.       AutoSize        =   -1  'True
  285.       Caption         =   "Time:"
  286.       Height          =   195
  287.       Left            =   2760
  288.       TabIndex        =   28
  289.       Top             =   3000
  290.       Width           =   390
  291.    End
  292.    Begin VB.Label Label3 
  293.       AutoSize        =   -1  'True
  294.       Caption         =   "Date:"
  295.       Height          =   195
  296.       Left            =   600
  297.       TabIndex        =   27
  298.       Top             =   3000
  299.       Width           =   390
  300.    End
  301. Attribute VB_Name = "frmDemo"
  302. Attribute VB_Creatable = False
  303. Attribute VB_Exposed = False
  304. Option Explicit
  305. Dim moLCD        As New clsLCD
  306. Dim moTime       As New clsLCD
  307. Dim moDate       As New clsLCD
  308. Dim mnOrigHeight As Integer
  309. Private Sub Form_Load()
  310.     With moDate
  311.         .Alignment = gnCENTER
  312.         .ForeColor = vbGreen
  313.         .AutoSize = gnAUTOSIZE_LCD_TO_CONTAINER
  314.         Set .Container = picDate
  315.         .Caption = Format$(Now, "mm-dd-yy")
  316.     End With
  317.     With moTime
  318.         .BlinkColon = True
  319.         .Alignment = gnCENTER
  320.         .ForeColor = vbGreen
  321.         .AutoSize = gnAUTOSIZE_LCD_TO_CONTAINER
  322.         Set .Container = picTime
  323.     End With
  324.     With moLCD
  325.         .ShowUnlitSegments = True
  326.         .AutoSize = gnAUTOSIZE_LCD_TO_CONTAINER
  327.         Set .Container = picLCD
  328.         .Caption = "-123,456,789,012,345.678"
  329.     End With
  330.     mnOrigHeight = picLCD.Height
  331. End Sub
  332. Private Sub Form_Unload(Cancel As Integer)
  333.     Set moDate = Nothing
  334.     Set moTime = Nothing
  335.     Set moLCD = Nothing
  336.     Set frmDemo = Nothing
  337.     End
  338. End Sub
  339. Private Sub cmdName_Click(Index As Integer)
  340.     Select Case Index
  341.         Case 0: Calculator.Show
  342.         Case 1: CountDown.Show
  343.         Case 2: Stopwatch.Show
  344.         Case 3: Clock24.Show
  345.         Case 4: AlarmForm.Show
  346.         Case 5: Dialer.Show
  347.         Case 6: Clock12.Show
  348.         Case 7: LCDArray.Show
  349.         Case 8: moLCD.About
  350.         Case 9: Unload Me
  351.     End Select
  352. End Sub
  353. Private Sub Command6_Click()
  354.     moLCD.SelectForeColor
  355. End Sub
  356. Private Sub Command7_Click()
  357.     moLCD.SelectBackColor
  358. End Sub
  359. Private Sub optAlign_Click(Index As Integer)
  360.     Select Case Index
  361.         Case 0: moLCD.Alignment = gnALIGN_LEFT
  362.         Case 1: moLCD.Alignment = gnALIGN_RIGHT
  363.         Case 2: moLCD.Alignment = gnCENTER
  364.     End Select
  365. End Sub
  366. Private Sub VScroll1_Change()
  367.     picLCD.Height = mnOrigHeight + VScroll1.Value
  368.     moLCD.Redisplay
  369. End Sub
  370. Private Sub Check1_Click()
  371.     moLCD.ShowUnlitSegments = Not moLCD.ShowUnlitSegments
  372. End Sub
  373. Private Sub Timer1_Timer()
  374.     moTime.Caption = Format$(Now, "h:mm A/P")
  375. End Sub
  376.