home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form PatternForm
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- ClientHeight = 3465
- ClientLeft = 1050
- ClientTop = 1620
- ClientWidth = 5700
- ClipControls = 0 'False
- ControlBox = 0 'False
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 3870
- Left = 990
- LinkTopic = "Form2"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 231
- ScaleMode = 3 'Pixel
- ScaleWidth = 380
- Top = 1275
- Visible = 0 'False
- Width = 5820
- WindowState = 2 'Maximized
- Begin Timer Timer1
- Interval = 500
- Left = 232
- Top = 200
- End
- Begin Label PatternLabel
- Alignment = 2 'Center
- AutoSize = -1 'True
- BackColor = &H00FFFFFF&
- BorderStyle = 1 'Fixed Single
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 12
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FF0000&
- Height = 330
- Left = 2700
- TabIndex = 0
- Top = 1080
- Visible = 0 'False
- Width = 135
- End
- Option Explicit
- DefInt A-Z
- Sub Form_Activate ()
- FirstConvTest = False
- ' Label visible only during Focus test
- If WhichPattern <> FOCUS Then PatternLabel.Visible = False
- ' Display the appropriate pattern
- ' (No need to draw pattern if same as last time.)
- If WhichPattern <> OldPattern Then
- Select Case WhichPattern
- Case FOCUS
- OldPattern = WhichPattern
- FocusPattern
- Case GEOMETRY
- OldPattern = WhichPattern
- GeometryPattern
- Case CONVTEST
- OldPattern = WhichPattern
- FirstConvTest = True
- HConvPattern
- Case CONVADJUST
- OldPattern = WhichPattern
- DrawGrid 6, 8
- Case COLORTRACKING
- OldPattern = WhichPattern
- ColorTrackingPattern
- Case PURITY
- OldPattern = WhichPattern
- PurityPattern
- End Select
- End If
- End Sub
- Sub Form_Click ()
- If FirstConvTest = True Then
- ' Clicking on HConvPattern when it has been
- ' displayed only once brings up VConvPattern
- ' instead of returning you to the main window.
- VConvPattern
- Else
- ' Hide pattern form; return to main window.
- PatternForm.Visible = False
- End If
- End Sub
- Sub Form_KeyDown (KeyCode As Integer, Shift As Integer)
- 'Keystroke handler for keys that KeyPress can't handle
- Dim OldFontSize As Single
- Dim OldFontName$
- ShiftState = Shift
- ' Process the following keystrokes:
- Select Case KeyCode
-
- Case KEY_F1 'F1 brings up help screen
- HelpForm.Show
-
- Case KEY_UP 'Up-arrow
- ' Handle differently for different patterns
- Select Case WhichPattern
- Case FOCUS
- 'increase size of font
- If PatternForm.FontSize < 16 Then
- OldFontSize = PatternForm.FontSize
- FocusFontSize = OldFontSize
- OldFontName$ = PatternForm.FontName
- Do 'try increasing size in small increments
- FocusFontSize = FocusFontSize + .25
- PatternForm.FontSize = FocusFontSize
- PatternForm.FontName = FocusFont$
- PatternForm.FontSize = FocusFontSize
- 'Form's font size won't change until it is a valid size
- If PatternForm.FontSize <> OldFontSize Then
- If UCase$(OldFontName$) = "MS SERIF" Then
- 'MS Serif skips this True Type size
- PatternForm.FontSize = 7.5
- End If
- Exit Do
- End If
- If FocusFontSize > 16.5 Then
- 'Don't let it get too large
- PatternForm.FontSize = OldFontSize
- Exit Do
- End If
- Loop
- If PatternForm.FontSize <> OldFontSize Then FocusPattern
- End If
- Case GEOMETRY
- 'increase size of grid squares (decrease number)
- NumCols = NumCols - 4
- If NumCols < 4 Then NumCols = 4
- GeometryPattern
- Case CONVTEST
- 'increase flashing interval
- If TimeInterval < 1001 Then
- TimeInterval = TimeInterval * 2
- PatternForm.Timer1.Interval = TimeInterval
- End If
- Case COLORTRACKING
- 'increase number of gray squares
- If NumberOfGrays < 129 Then
- NumberOfGrays = NumberOfGrays * 2
- ColorTrackingPattern
- End If
- End Select
-
- Case KEY_DOWN 'Down-arrow
- ' Handle differently for different patterns
- Select Case WhichPattern
- Case FOCUS
- 'decrease size of font
- If PatternForm.FontSize > 4 Then
- OldFontSize = PatternForm.FontSize
- FocusFontSize = OldFontSize
- Do
- FocusFontSize = FocusFontSize - .25
- PatternForm.FontSize = FocusFontSize
- PatternForm.FontName = FocusFont$
- PatternForm.FontSize = FocusFontSize
- If PatternForm.FontSize <> OldFontSize Then Exit Do
- If FocusFontSize < 3.5 Then
- PatternForm.FontSize = OldFontSize
- FocusFontSize = OldFontSize
- Exit Do
- End If
- Loop
- If PatternForm.FontSize <> OldFontSize Then FocusPattern
- End If
- Case GEOMETRY
- 'decrease size of grid squares (increase number)
- NumCols = NumCols + 4
- If NumCols > 80 Then NumCols = 80
- GeometryPattern
- Case CONVTEST
- 'decrease flashing interval
- If TimeInterval > 100 Then
- TimeInterval = TimeInterval / 2
- PatternForm.Timer1.Interval = TimeInterval
- End If
- Case COLORTRACKING
- 'increase number of gray squares
- If NumberOfGrays > 5 Then
- NumberOfGrays = NumberOfGrays / 2
- ColorTrackingPattern
- End If
- End Select
- End Select
- End Sub
- Sub Form_KeyPress (KeyAscii As Integer)
- 'Handles some keystrokes. See KeyDown for other keystrokes.
- Dim OldFontSize As Single
- Dim OldFontName$
- 'Process the following keystrokes:
- Select Case KeyAscii
-
- Case 27, 81, 113 'ESC or Q or q key returns to menu
- WhichPattern = 0
- PatternForm.Hide
- MainForm.Show
-
- Case 72, 104 ' h or H changes to H. conv. pattern
- If WhichPattern = CONVTEST Then
- If ConvOrient <> HORIZONTAL Then HConvPattern
- End If
-
- Case 86, 118 ' v or V changes to V. conv. pattern
- If WhichPattern = CONVTEST Then
- If ConvOrient <> VERTICAL Then VConvPattern
- End If
-
- Case 47, 63 ' / or ? brings up help screen
- HelpForm.Show
-
- Case 43, 61 ' + or =
- 'handle differently for different patterns
- Select Case WhichPattern
- Case FOCUS
- 'increase size of font
- If PatternForm.FontSize < 16 Then
- OldFontSize = PatternForm.FontSize
- FocusFontSize = OldFontSize
- OldFontName$ = PatternForm.FontName
- Do 'try increasing size in small increments
- FocusFontSize = FocusFontSize + .25
- PatternForm.FontSize = FocusFontSize
- PatternForm.FontName = FocusFont$
- PatternForm.FontSize = FocusFontSize
- 'Form's font size won't change until it is a valid size
- If PatternForm.FontSize <> OldFontSize Then
- If UCase$(OldFontName$) = "MS SERIF" Then
- 'MS Serif skips this True Type size
- PatternForm.FontSize = 7.5
- End If
- Exit Do
- End If
- If FocusFontSize > 16.5 Then
- 'Don't let it get too large
- PatternForm.FontSize = OldFontSize
- Exit Do
- End If
- Loop
- If PatternForm.FontSize <> OldFontSize Then FocusPattern
- End If
- Case GEOMETRY
- 'increase size of grid squares (decrease number)
- NumCols = NumCols - 4
- If NumCols < 4 Then NumCols = 4
- GeometryPattern
- Case CONVTEST
- 'increase flashing interval
- If TimeInterval < 1001 Then
- TimeInterval = TimeInterval * 2
- PatternForm.Timer1.Interval = TimeInterval
- End If
- Case COLORTRACKING
- 'increase number of gray rectangles
- If NumberOfGrays < 129 Then
- NumberOfGrays = NumberOfGrays * 2
- ColorTrackingPattern
- End If
- End Select
-
- Case 45, 95 ' - or _
- 'handle differently for different patterns
- Select Case WhichPattern
- Case FOCUS
- 'decrease size of font
- If PatternForm.FontSize > 4 Then
- OldFontSize = PatternForm.FontSize
- FocusFontSize = OldFontSize
- Do 'try decreasing size in small increments
- FocusFontSize = FocusFontSize - .25
- PatternForm.FontSize = FocusFontSize
- PatternForm.FontName = FocusFont$
- PatternForm.FontSize = FocusFontSize
- 'Form's font size won't change until it is a valid size
- If PatternForm.FontSize <> OldFontSize Then Exit Do
- If FocusFontSize < 3.5 Then
- 'Don't let it get too small.
- PatternForm.FontSize = OldFontSize
- FocusFontSize = OldFontSize
- Exit Do
- End If
- Loop
- If PatternForm.FontSize <> OldFontSize Then FocusPattern
- End If
- Case GEOMETRY
- 'decrease size of grid squares (increase number)
- NumCols = NumCols + 4
- If NumCols > 80 Then NumCols = 80
- GeometryPattern
- Case CONVTEST
- 'decrease flashing interval
- If TimeInterval > 100 Then
- TimeInterval = TimeInterval / 2
- PatternForm.Timer1.Interval = TimeInterval
- End If
- Case COLORTRACKING
- 'increase number of gray squares
- If NumberOfGrays > 5 Then
- NumberOfGrays = NumberOfGrays / 2
- ColorTrackingPattern
- End If
- End Select
- End Select
- End Sub
- Sub Form_Load ()
- PatternForm.FontName = FocusFont$
- PatternForm.FontSize = FocusFontSize
- End Sub
- Sub Timer1_Timer ()
- 'Switch convergence test pattern colors after a
- 'specified period of time (Timer1.Interval)
- If WhichPattern = CONVTEST Then
- 'change colors of lines
- If ConvOrient = HORIZONTAL Then
- HConvPattern
- ElseIf ConvOrient = VERTICAL Then
- VConvPattern
- Else
- ConvOrient = HORIZONTAL
- HConvPattern
- End If
- End If
- End Sub
-