home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Viewer
- BackColor = &H00808080&
- Caption = "PFF Display"
- ClientHeight = 5760
- ClientLeft = 165
- ClientTop = 720
- ClientWidth = 9480
- ControlBox = 0 'False
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 6165
- Icon = PFFDISP.FRX:0000
- Left = 105
- LinkMode = 1 'Source
- LinkTopic = "Form2"
- MinButton = 0 'False
- ScaleHeight = 5760
- ScaleWidth = 9480
- Top = 375
- Width = 9600
- Begin TextBox Display
- BackColor = &H00C0C0C0&
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "Terminal"
- FontSize = 9
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 5325
- Left = 0
- MultiLine = -1 'True
- ScrollBars = 3 'Both
- TabIndex = 0
- Top = 450
- Width = 9495
- End
- Begin CommandButton PrintMe
- BackColor = &H00808080&
- Caption = "Print &Me"
- Height = 375
- Left = 1440
- TabIndex = 2
- Top = 45
- Width = 1215
- End
- Begin CommandButton Finished
- BackColor = &H00808080&
- Caption = "&Finished"
- Height = 375
- Left = 120
- TabIndex = 1
- Top = 45
- Width = 1215
- End
- ' This sub works well only with VGA displays. For EGA
- ' displays, you will want to modify the backcolor
- ' properties for the form and controls, and avoid this
- ' procedure.
- Sub BorderBox2 (Source As Control, Action As Integer)
- BLeft% = Source.Left - 10 ' Get coordinates
- BTop% = Source.Top - 10
- BWide% = Source.Width + 28
- BHigh% = Source.Height + 28
- ' Action TRUE means draw, FALSE means erase
- If Action Then
- ' Draw a recessed border around Source control
- Line (BLeft%, BTop%)-Step(BWide%, -2), 0, B
- Line -Step(-2, BHigh%), RGB(255, 255, 255), B
- Line -Step(-BWide%, 2), RGB(255, 255, 255), B
- Line -Step(2, -BHigh%), 0, B
- Else
- ' Erase border around Source control
- Line (BLeft%, BTop%)-Step(BWide%, 0), Backcolor
- Line -Step(0, BHigh%), Backcolor
- Line -Step(-BWide%, 0), Backcolor
- Line -Step(0, -BHigh%), Backcolor
- End If
- End Sub
- Sub Display_GotFocus ()
- Display.Text = ""
- ChDrive Selection.Drive1.Drive
- ChDir Selection.File1.Path
- MyFile$ = Selection.File1.FileName
- If MyFile$ <> "" Then
- Open MyFile$ For Input As #1 Len = 4096
- If LOF(1) > 32000 Then
- Msg$ = "You will only be able to view the first" + Chr$(13)
- Msg$ = Msg$ + "30K of the file"
- MsgBox Msg$, 48, "File Too Large"
- Do Until Len(Scratch$) >= 32000
- Line Input #1, NextLine$
- Scratch$ = Scratch$ + NextLine$ + Chr$(13) + Chr$(10)
- Loop
- Else
- Do Until EOF(1)
- Line Input #1, NextLine$
- Scratch$ = Scratch$ + NextLine$ + Chr$(13) + Chr$(10)
- Loop
- End If
- Close #1
- Display.Text = Scratch$
- Viewer.Caption = "Viewing " + MyFile$ + " - Size =" + Str$(Len(Scratch$))
- Else
- Beep
- Msg$ = "No File Specified"
- MsgBox Msg$, 48, "I Need a File!"
- Viewer.Hide
- End If
- End Sub
- Sub Display_KeyPress (KeyAscii As Integer)
- Beep
- KeyAscii = 0
- End Sub
- Sub Finished_Click ()
- Viewer.Hide
- Unload Viewer
- End Sub
- Sub Form_GotFocus ()
- Display.Text = ""
- Display_GotFocus
- End Sub
- Sub Form_Paint ()
- BorderBox2 Display, True
- End Sub
- Sub Form_Resize ()
- Display.Move 100, 446, Viewer.ScaleWidth - 200, Viewer.ScaleHeight - 546
- End Sub
- Sub PrintMe_Click ()
- Viewer.Caption = "Printing ..."
- Viewer.MousePointer = 11
- FormatFile MyFile$
- Viewer.MousePointer = 0
- Unload Viewer
- End Sub
-