home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Tool Box
/
SIMS_2.iso
/
vb_code1
/
3ctrls
/
browser.frm
next >
Wrap
Text File
|
1994-05-17
|
14KB
|
449 lines
VERSION 2.00
Begin Form Form1
Caption = "Code Browser using VideoSoft VSAWK"
ClientHeight = 5640
ClientLeft = 345
ClientTop = 750
ClientWidth = 7545
Height = 6105
Left = 255
LinkTopic = "Form1"
ScaleHeight = 5640
ScaleWidth = 7545
Top = 375
Width = 7725
Begin VideoSoftElastic Tooltip
BackColor = &H0080FFFF&
BevelInner = 0 'None
BevelOuterWidth = 0
BorderWidth = 4
ChildSpacing = 0
FloodColor = &H0080FFFF&
FloodDirection = 1 'Right
FloodPercent = 100
FontBold = -1 'True
FontItalic = 0 'False
FontName = "Arial"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
IntBkg = &H0080FFFF&
Left = 3870
TabIndex = 12
Top = 5220
Visible = 0 'False
Width = 1785
End
Begin VideoSoftAwk VSAwk3
FS = " , "
Left = 2025
Top = 4500
End
Begin VideoSoftAwk VSAwk2
FS = " , "
Left = 1530
Top = 4500
End
Begin VideoSoftAwk VSAwk1
FS = " , "
Left = 990
Top = 4500
End
Begin CommonDialog CMDialog
Left = 450
Top = 4455
End
Begin VideoSoftElastic VSElastic1
Align = 5 'Fill Container
AutoSizeChildren= 4 'Uneven Vertical
BackColor = &H0000FF00&
BorderWidth = -1
Height = 4350
Index = 5
IntBkg = &H0000FF00&
Left = 0
Splitter = 1 'Yes (with uneven spacing)
TabIndex = 5
Top = 795
Width = 7545
Begin VideoSoftElastic VSElastic1
AutoSizeChildren= 4 'Uneven Vertical
BackColor = &H00C0C0C0&
BorderWidth = 0
Height = 1620
Index = 1
IntBkg = &H00C0C0C0&
Left = -15
Splitter = 1 'Yes (with uneven spacing)
TabIndex = 9
Top = 2745
Width = 7575
Begin ListBox List1
FontBold = 0 'False
FontItalic = 0 'False
FontName = "Courier New"
FontSize = 9
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 255
Left = 3150
Sorted = -1 'True
TabIndex = 10
Top = 120
Visible = 0 'False
Width = 1545
End
Begin ListBox List2
BackColor = &H00FFFFFF&
FontBold = 0 'False
FontItalic = 0 'False
FontName = "Courier New"
FontSize = 9
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 1605
Left = 0
Sorted = -1 'True
TabIndex = 11
Top = 0
Width = 7575
End
End
Begin VideoSoftElastic VSElastic1
AutoSizeChildren= 4 'Uneven Vertical
BackColor = &H00C0C0C0&
BevelInner = 7 'Shadow
BevelInnerWidth = 4
BevelOuter = 1 'Raised
BevelOuterWidth = 1
BorderWidth = 18
ChildSpacing = -1
Height = 2670
Index = 4
IntBkg = &H00C0C0C0&
Left = -15
ShadowColor = &H00404040&
TabIndex = 6
Top = -15
Width = 7575
Begin TextBox Text1
BackColor = &H00000080&
FontBold = -1 'True
FontItalic = 0 'False
FontName = "Courier New"
FontSize = 9.75
FontStrikethru = 0 'False
FontUnderline = 0 'False
ForeColor = &H0000FFFF&
Height = 1680
Left = 270
MultiLine = -1 'True
ScrollBars = 3 'Both
TabIndex = 7
Top = 720
Width = 7035
End
Begin VideoSoftElastic VSElastic1
BackColor = &H00000000&
BevelInnerWidth = 0
BevelOuterWidth = 0
Caption = "Visual Basic Code"
CaptionPos = 4 'Center Center
FontBold = -1 'True
FontItalic = 0 'False
FontName = "Arial"
FontSize = 13.5
FontStrikethru = 0 'False
FontUnderline = 0 'False
ForeColor = &H0000FFFF&
Height = 465
Index = 3
Left = 270
TabIndex = 8
Top = 270
Width = 7035
End
End
End
Begin VideoSoftElastic VSElastic3
Align = 2 'Align Bottom
BackColor = &H00C0C0C0&
BevelOuter = 1 'Raised
BevelOuterWidth = 1
CaptionPos = 4 'Center Center
FloodColor = &H0080FFFF&
FloodDirection = 1 'Right
FontBold = -1 'True
FontItalic = 0 'False
FontName = "System"
FontSize = 9.75
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 495
IntBkg = &H00C0C0C0&
Left = 0
TabIndex = 4
Top = 5145
Width = 7545
End
Begin VideoSoftElastic VSElastic1
Align = 1 'Align Top
AutoSizeChildren= 1 'Even Horizontal
BackColor = &H00C0C0C0&
BevelInner = 0 'None
BevelInnerWidth = 2
BevelOuter = 6 'Groove
BorderWidth = 12
Height = 795
Index = 0
IntBkg = &H00C0C0C0&
Left = 0
TabIndex = 3
Top = 0
Width = 7545
Begin CommandButton Command1
BackColor = &H00C0C0C0&
Caption = "&Open.."
Default = -1 'True
FontBold = -1 'True
FontItalic = 0 'False
FontName = "System"
FontSize = 9.75
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 435
Index = 0
Left = 180
TabIndex = 0
Tag = "Open VB file"
Top = 180
Width = 2340
End
Begin CommandButton Command1
BackColor = &H00C0C0C0&
Caption = "&Print..."
FontBold = -1 'True
FontItalic = 0 'False
FontName = "System"
FontSize = 9.75
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 435
Index = 2
Left = 5040
TabIndex = 2
Tag = "Print selected code"
Top = 180
Width = 2325
End
Begin CommandButton Command1
BackColor = &H00C0C0C0&
Caption = "&Copy"
FontBold = -1 'True
FontItalic = 0 'False
FontName = "System"
FontSize = 9.75
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 435
Index = 1
Left = 2610
TabIndex = 1
Tag = "Copy to Clipboard"
Top = 180
Width = 2340
End
End
End
Option Explicit
Dim subtext$
Dim OldTip
' Example using nested VideoSoft VSAWK
' Projects need to be saved as TEXT be parsed by VSAWK.
' Once the project is loaded, just click on the desired
' subroutine name on list2 and the code will be place on
' the text box.
' VSElastic is used to automatically resize the form and
' for flooding status when parsing the file.
' CMDialog is used to open the file.
Sub Command1_Click (Index%)
Select Case Index
Case 0 'Open Button
' get file name
cmdialog.DialogTitle = "Open VB Project"
cmdialog.Filename = ""
cmdialog.DefaultExt = "MAK"
cmdialog.Filter = "VB Projects (*.mak)|*.MAK|All Files (*.*)|*.*"
cmdialog.Flags = &H1800&
cmdialog.Action = 1
If cmdialog.Filename = "" Then Exit Sub
' read project
text1 = ""
vsawk1.FileName = cmdialog.Filename
vsawk1.Tag = Left(cmdialog.Filename, Len(cmdialog.Filename) - Len(cmdialog.Filetitle))
vsawk1.Action = 0
vselastic3.FloodPercent = 0
vselastic3 = "Ready"
Case 1 ' Clipboard
If text1 = "" Then MsgBox "Sorry, no code selected.", 16: Exit Sub
clipboard.SetText text1, 1
vselastic3 = "Code copied to clipboard"
Case 2 'Print
MsgBox "Print routine not implemented", 64
End Select
End Sub
Sub Command1_MouseMove (Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
If OldTip = Index Then Exit Sub
ToolTip.Caption = Command1(Index).Tag
ToolTip.Width = TextWidth(Command1(Index).Tag)
ToolTip.Move Command1(Index).Left + Command1(Index).Height * .75, Command1(Index).Top + Command1(Index).Height * 1.1
ToolTip.Visible = True
OldTip = Index
End Sub
Sub List2_DblClick ()
vsawk3 = list2
vsawk3.FileName = vsawk3.F(3)
vsawk3.Tag = Val(vsawk3.F(4))
vsawk3.Action = 0
End Sub
Sub VSAwk1_Begin ()
mousepointer = 11
list1.Clear
End Sub
Sub VSAwk1_End ()
Dim i%
list2.Clear
For i = 0 To list1.ListCount - 1
list1.ListIndex = i
vsawk2.FileName = list1.List(i)
vselastic3 = vsawk2.FileName
vsawk2.Action = 0
list2.Refresh
Next
End Sub
Sub VSAwk1_Scan ()
'add .FRM files to List1
If InStr(vsawk1, "=") > 0 Or InStr(vsawk1, "VBX") > 0 Then Exit Sub
If InStr(vsawk1, "\") > 0 Then
list1.AddItem vsawk1
Else
list1.AddItem vsawk1.Tag + vsawk1
End If
End Sub
Sub VSAwk2_End ()
mousepointer = 0
End Sub
Sub VSAwk2_Scan ()
Static insub%, a$, lp%
If vsawk2.PercentDone <> lp Then
lp = vsawk2.PercentDone
vselastic3.FloodPercent = lp
DoEvents
End If
'=====================================================
'Search for subroutines/Functions/Variable definitions
'=====================================================
If vsawk2.F(1) = "Sub" Then
insub = True
a = vsawk2.F(2) + Chr(9) + "(sub)" + Chr(9) + vsawk2.FileName + Chr(9) + Format(vsawk2.CurrPos)
list2.AddItem a
Exit Sub
End If
If vsawk2.F(1) = "Function" Then
insub = True
a = vsawk2.F(2) + Chr(9) + "(fun)" + Chr(9) + vsawk2.FileName + Chr(9) + Format(vsawk2.CurrPos)
list2.AddItem a
Exit Sub
End If
If vsawk2.F(1) = "Global" And vsawk2.F(2) <> "Const" Then
a = vsawk2.F(2) + Chr(9) + "(gvar)" + Chr(9) + vsawk2.FileName + Chr(9) + Format(vsawk2.CurrPos)
list2.AddItem a
Exit Sub
End If
If vsawk2.F(1) = "Dim" And Not insub Then
a = vsawk2.F(2) + Chr(9) + "(fvar)" + Chr(9) + vsawk2.FileName + Chr(9) + Format(vsawk2.CurrPos)
list2.AddItem a
Exit Sub
End If
If vsawk2.F(1) = "End" And (vsawk2.F(2) = "Sub" Or vsawk2.F(2) = "Function") Then
insub = False
Exit Sub
End If
End Sub
Sub VSAwk3_Begin ()
mousepointer = 11
vsawk3.CurrPos = Val(vsawk3.Tag)
subtext = ""
End Sub
Sub VSAwk3_End ()
text1 = subtext
mousepointer = 0
End Sub
Sub VSAwk3_Scan ()
' accumulate text
If subtext = "" Then
subtext = vsawk3
Else
subtext = subtext + Chr(13) + Chr(10) + vsawk3
End If
' stop if only a var
If vsawk3.RN = 0 Then
If vsawk3.F(1) <> "Sub" And vsawk3.F(1) <> "Function" Then vsawk3.Action = 2
End If
' stop at end of functions and subs
If vsawk3.F(1) = "End" Then
If vsawk3.F(2) = "Sub" Then vsawk3.Action = 2
If vsawk3.F(2) = "Function" Then vsawk3.Action = 2
End If
End Sub
Sub VSElastic1_MouseMove (Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
OldTip = -1
ToolTip.Visible = False
End Sub