home *** CD-ROM | disk | FTP | other *** search
/ CICA 1995 May / cica_0595_4.zip / cica_0595_4 / UTIL / WSPRTERM / FCURSORB.FRM < prev    next >
Text File  |  1994-05-01  |  5KB  |  180 lines

  1. VERSION 2.00
  2. Begin Form FCursorBlink 
  3.    Caption         =   "Cursor Blink Setup"
  4.    ClientHeight    =   1920
  5.    ClientLeft      =   3285
  6.    ClientTop       =   2115
  7.    ClientWidth     =   2865
  8.    ClipControls    =   0   'False
  9.    ControlBox      =   0   'False
  10.    Height          =   2385
  11.    Left            =   3195
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   1920
  16.    ScaleWidth      =   2865
  17.    Top             =   1740
  18.    Width           =   3045
  19.    Begin Timer Timer1 
  20.       Enabled         =   0   'False
  21.       Left            =   90
  22.       Top             =   855
  23.    End
  24.    Begin CommandButton CmdCancel 
  25.       Cancel          =   -1  'True
  26.       Caption         =   "&Cancel"
  27.       Height          =   330
  28.       Left            =   1845
  29.       TabIndex        =   1
  30.       Top             =   720
  31.       Width           =   780
  32.    End
  33.    Begin CommandButton CmdOK 
  34.       Caption         =   "&Ok"
  35.       Default         =   -1  'True
  36.       Height          =   330
  37.       Left            =   1845
  38.       TabIndex        =   0
  39.       Top             =   225
  40.       Width           =   780
  41.    End
  42.    Begin VScrollBar VScroll1 
  43.       Height          =   1050
  44.       LargeChange     =   200
  45.       Left            =   1170
  46.       Max             =   1100
  47.       Min             =   100
  48.       SmallChange     =   100
  49.       TabIndex        =   2
  50.       Top             =   135
  51.       Value           =   500
  52.       Width           =   240
  53.    End
  54.    Begin PictureBox CursorBox 
  55.       FontTransparent =   0   'False
  56.       Height          =   285
  57.       Left            =   450
  58.       ScaleHeight     =   255
  59.       ScaleWidth      =   120
  60.       TabIndex        =   3
  61.       TabStop         =   0   'False
  62.       Top             =   495
  63.       Width           =   150
  64.    End
  65.    Begin Label BlinksPerSecond 
  66.       BackStyle       =   0  'Transparent
  67.       Caption         =   "0"
  68.       Height          =   240
  69.       Left            =   1845
  70.       TabIndex        =   6
  71.       Top             =   1440
  72.       Width           =   780
  73.    End
  74.    Begin Label LBlinkAmount 
  75.       AutoSize        =   -1  'True
  76.       BackStyle       =   0  'Transparent
  77.       Caption         =   "Blinks per second:"
  78.       Height          =   195
  79.       Left            =   135
  80.       TabIndex        =   5
  81.       Top             =   1440
  82.       Width           =   1590
  83.    End
  84.    Begin Label Label1 
  85.       AutoSize        =   -1  'True
  86.       BackStyle       =   0  'Transparent
  87.       Caption         =   "Sample:"
  88.       Height          =   195
  89.       Left            =   180
  90.       TabIndex        =   4
  91.       Top             =   225
  92.       Width           =   690
  93.    End
  94. End
  95. Option Explicit
  96.  
  97. Sub CmdCancel_Click ()
  98.  
  99.     Unload FCursorBlink
  100.  
  101. End Sub
  102.  
  103. Sub CmdOK_Click ()
  104.     Dim rv%
  105.  
  106.     FMain.cursorBlinkTimer.Interval = Timer1.Interval
  107.     rv = WritePrivateProfileString(Key_Pref, Appl_CursorBlink, Str$(FMain.cursorBlinkTimer.Interval \ 100), DefaultINI)
  108.     
  109.     Unload FCursorBlink
  110.  
  111. End Sub
  112.  
  113. Sub displaySample ()
  114.     Static blinkOn As Integer
  115.  
  116.     CursorBox.CurrentX = CursorBox.Width / 2
  117.     CursorBox.CurrentY = CursorBox.Height / 2
  118.  
  119.     If blinkOn Then
  120.         CursorBox.BackColor = WHITE
  121.         CursorBox.ForeColor = BLACK
  122.         CursorBox.Print " ";
  123.     Else
  124.         CursorBox.BackColor = BLACK
  125.         CursorBox.ForeColor = WHITE
  126.         CursorBox.Print " ";
  127.     End If
  128.     blinkOn = Not blinkOn
  129.  
  130. End Sub
  131.  
  132. Sub Form_Activate ()
  133.  
  134.     Timer1.Interval = FMain.cursorBlinkTimer.Interval
  135.     Timer1.Enabled = True
  136.     If Timer1.Interval = 0 Then
  137.         BlinksPerSecond.Caption = "0.000"
  138.         VScroll1.Value = VScroll1.Max
  139.     Else
  140.         If Timer1.Interval < VScroll1.Min Then
  141.             VScroll1.Value = VScroll1.Min
  142.         Else
  143.             VScroll1.Value = Timer1.Interval
  144.         End If
  145.         BlinksPerSecond.Caption = Format((VScroll1.Max - VScroll1.SmallChange) / VScroll1.Value, "##.000")
  146.     End If
  147.  
  148. End Sub
  149.  
  150. Sub Form_Load ()
  151.  
  152.     CenterForm FCursorBlink
  153.     
  154. End Sub
  155.  
  156. Sub Timer1_Timer ()
  157.  
  158.     displaySample
  159.  
  160. End Sub
  161.  
  162. Sub VScroll1_Change ()
  163.  
  164.     If VScroll1.Value = VScroll1.Max Then
  165.         Timer1.Interval = 0
  166.         BlinksPerSecond.Caption = "0.000"
  167.     Else
  168.         Timer1.Interval = VScroll1.Value
  169.         BlinksPerSecond.Caption = Format((VScroll1.Max - VScroll1.SmallChange) / VScroll1.Value, "##.000")
  170.     End If
  171.  
  172. End Sub
  173.  
  174. Sub VScroll1_GotFocus ()
  175.  
  176.     CmdOk.SetFocus
  177.  
  178. End Sub
  179.  
  180.