home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / CODIGO_1 / 3CTRLS / BROWSER.FRM (.txt) next >
Encoding:
Visual Basic Form  |  1994-05-17  |  13.4 KB  |  403 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "Code Browser using VideoSoft VSAWK"
  4.    ClientHeight    =   5640
  5.    ClientLeft      =   345
  6.    ClientTop       =   750
  7.    ClientWidth     =   7545
  8.    Height          =   6105
  9.    Left            =   255
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   5640
  12.    ScaleWidth      =   7545
  13.    Top             =   375
  14.    Width           =   7725
  15.    Begin VideoSoftElastic Tooltip 
  16.       BackColor       =   &H0080FFFF&
  17.       BevelInner      =   0  'None
  18.       BevelOuterWidth =   0
  19.       BorderWidth     =   4
  20.       ChildSpacing    =   0
  21.       FloodColor      =   &H0080FFFF&
  22.       FloodDirection  =   1  'Right
  23.       FloodPercent    =   100
  24.       FontBold        =   -1  'True
  25.       FontItalic      =   0   'False
  26.       FontName        =   "Arial"
  27.       FontSize        =   8.25
  28.       FontStrikethru  =   0   'False
  29.       FontUnderline   =   0   'False
  30.       Height          =   315
  31.       IntBkg          =   &H0080FFFF&
  32.       Left            =   3870
  33.       TabIndex        =   12
  34.       Top             =   5220
  35.       Visible         =   0   'False
  36.       Width           =   1785
  37.    End
  38.    Begin VideoSoftAwk VSAwk3 
  39.       FS              =   " ,    "
  40.       Left            =   2025
  41.       Top             =   4500
  42.    End
  43.    Begin VideoSoftAwk VSAwk2 
  44.       FS              =   " ,    "
  45.       Left            =   1530
  46.       Top             =   4500
  47.    End
  48.    Begin VideoSoftAwk VSAwk1 
  49.       FS              =   " ,    "
  50.       Left            =   990
  51.       Top             =   4500
  52.    End
  53.    Begin CommonDialog CMDialog 
  54.       Left            =   450
  55.       Top             =   4455
  56.    End
  57.    Begin VideoSoftElastic VSElastic1 
  58.       Align           =   5  'Fill Container
  59.       AutoSizeChildren=   4  'Uneven Vertical
  60.       BackColor       =   &H0000FF00&
  61.       BorderWidth     =   -1
  62.       Height          =   4350
  63.       Index           =   5
  64.       IntBkg          =   &H0000FF00&
  65.       Left            =   0
  66.       Splitter        =   1  'Yes (with uneven spacing)
  67.       TabIndex        =   5
  68.       Top             =   795
  69.       Width           =   7545
  70.       Begin VideoSoftElastic VSElastic1 
  71.          AutoSizeChildren=   4  'Uneven Vertical
  72.          BackColor       =   &H00C0C0C0&
  73.          BorderWidth     =   0
  74.          Height          =   1620
  75.          Index           =   1
  76.          IntBkg          =   &H00C0C0C0&
  77.          Left            =   -15
  78.          Splitter        =   1  'Yes (with uneven spacing)
  79.          TabIndex        =   9
  80.          Top             =   2745
  81.          Width           =   7575
  82.          Begin ListBox List1 
  83.             FontBold        =   0   'False
  84.             FontItalic      =   0   'False
  85.             FontName        =   "Courier New"
  86.             FontSize        =   9
  87.             FontStrikethru  =   0   'False
  88.             FontUnderline   =   0   'False
  89.             Height          =   255
  90.             Left            =   3150
  91.             Sorted          =   -1  'True
  92.             TabIndex        =   10
  93.             Top             =   120
  94.             Visible         =   0   'False
  95.             Width           =   1545
  96.          End
  97.          Begin ListBox List2 
  98.             BackColor       =   &H00FFFFFF&
  99.             FontBold        =   0   'False
  100.             FontItalic      =   0   'False
  101.             FontName        =   "Courier New"
  102.             FontSize        =   9
  103.             FontStrikethru  =   0   'False
  104.             FontUnderline   =   0   'False
  105.             Height          =   1605
  106.             Left            =   0
  107.             Sorted          =   -1  'True
  108.             TabIndex        =   11
  109.             Top             =   0
  110.             Width           =   7575
  111.          End
  112.       End
  113.       Begin VideoSoftElastic VSElastic1 
  114.          AutoSizeChildren=   4  'Uneven Vertical
  115.          BackColor       =   &H00C0C0C0&
  116.          BevelInner      =   7  'Shadow
  117.          BevelInnerWidth =   4
  118.          BevelOuter      =   1  'Raised
  119.          BevelOuterWidth =   1
  120.          BorderWidth     =   18
  121.          ChildSpacing    =   -1
  122.          Height          =   2670
  123.          Index           =   4
  124.          IntBkg          =   &H00C0C0C0&
  125.          Left            =   -15
  126.          ShadowColor     =   &H00404040&
  127.          TabIndex        =   6
  128.          Top             =   -15
  129.          Width           =   7575
  130.          Begin TextBox Text1 
  131.             BackColor       =   &H00000080&
  132.             FontBold        =   -1  'True
  133.             FontItalic      =   0   'False
  134.             FontName        =   "Courier New"
  135.             FontSize        =   9.75
  136.             FontStrikethru  =   0   'False
  137.             FontUnderline   =   0   'False
  138.             ForeColor       =   &H0000FFFF&
  139.             Height          =   1680
  140.             Left            =   270
  141.             MultiLine       =   -1  'True
  142.             ScrollBars      =   3  'Both
  143.             TabIndex        =   7
  144.             Top             =   720
  145.             Width           =   7035
  146.          End
  147.          Begin VideoSoftElastic VSElastic1 
  148.             BackColor       =   &H00000000&
  149.             BevelInnerWidth =   0
  150.             BevelOuterWidth =   0
  151.             Caption         =   "Visual Basic Code"
  152.             CaptionPos      =   4  'Center Center
  153.             FontBold        =   -1  'True
  154.             FontItalic      =   0   'False
  155.             FontName        =   "Arial"
  156.             FontSize        =   13.5
  157.             FontStrikethru  =   0   'False
  158.             FontUnderline   =   0   'False
  159.             ForeColor       =   &H0000FFFF&
  160.             Height          =   465
  161.             Index           =   3
  162.             Left            =   270
  163.             TabIndex        =   8
  164.             Top             =   270
  165.             Width           =   7035
  166.          End
  167.       End
  168.    End
  169.    Begin VideoSoftElastic VSElastic3 
  170.       Align           =   2  'Align Bottom
  171.       BackColor       =   &H00C0C0C0&
  172.       BevelOuter      =   1  'Raised
  173.       BevelOuterWidth =   1
  174.       CaptionPos      =   4  'Center Center
  175.       FloodColor      =   &H0080FFFF&
  176.       FloodDirection  =   1  'Right
  177.       FontBold        =   -1  'True
  178.       FontItalic      =   0   'False
  179.       FontName        =   "System"
  180.       FontSize        =   9.75
  181.       FontStrikethru  =   0   'False
  182.       FontUnderline   =   0   'False
  183.       Height          =   495
  184.       IntBkg          =   &H00C0C0C0&
  185.       Left            =   0
  186.       TabIndex        =   4
  187.       Top             =   5145
  188.       Width           =   7545
  189.    End
  190.    Begin VideoSoftElastic VSElastic1 
  191.       Align           =   1  'Align Top
  192.       AutoSizeChildren=   1  'Even Horizontal
  193.       BackColor       =   &H00C0C0C0&
  194.       BevelInner      =   0  'None
  195.       BevelInnerWidth =   2
  196.       BevelOuter      =   6  'Groove
  197.       BorderWidth     =   12
  198.       Height          =   795
  199.       Index           =   0
  200.       IntBkg          =   &H00C0C0C0&
  201.       Left            =   0
  202.       TabIndex        =   3
  203.       Top             =   0
  204.       Width           =   7545
  205.       Begin CommandButton Command1 
  206.          BackColor       =   &H00C0C0C0&
  207.          Caption         =   "&Open.."
  208.          Default         =   -1  'True
  209.          FontBold        =   -1  'True
  210.          FontItalic      =   0   'False
  211.          FontName        =   "System"
  212.          FontSize        =   9.75
  213.          FontStrikethru  =   0   'False
  214.          FontUnderline   =   0   'False
  215.          Height          =   435
  216.          Index           =   0
  217.          Left            =   180
  218.          TabIndex        =   0
  219.          Tag             =   "Open VB file"
  220.          Top             =   180
  221.          Width           =   2340
  222.       End
  223.       Begin CommandButton Command1 
  224.          BackColor       =   &H00C0C0C0&
  225.          Caption         =   "&Print..."
  226.          FontBold        =   -1  'True
  227.          FontItalic      =   0   'False
  228.          FontName        =   "System"
  229.          FontSize        =   9.75
  230.          FontStrikethru  =   0   'False
  231.          FontUnderline   =   0   'False
  232.          Height          =   435
  233.          Index           =   2
  234.          Left            =   5040
  235.          TabIndex        =   2
  236.          Tag             =   "Print selected code"
  237.          Top             =   180
  238.          Width           =   2325
  239.       End
  240.       Begin CommandButton Command1 
  241.          BackColor       =   &H00C0C0C0&
  242.          Caption         =   "&Copy"
  243.          FontBold        =   -1  'True
  244.          FontItalic      =   0   'False
  245.          FontName        =   "System"
  246.          FontSize        =   9.75
  247.          FontStrikethru  =   0   'False
  248.          FontUnderline   =   0   'False
  249.          Height          =   435
  250.          Index           =   1
  251.          Left            =   2610
  252.          TabIndex        =   1
  253.          Tag             =   "Copy to Clipboard"
  254.          Top             =   180
  255.          Width           =   2340
  256.       End
  257.    End
  258. Option Explicit
  259. Dim subtext$
  260. Dim OldTip
  261. ' Example using nested VideoSoft VSAWK
  262. ' Projects need to be saved as TEXT be parsed by VSAWK.
  263. ' Once the project is loaded, just click on the desired
  264. ' subroutine name on list2 and the code will be place on
  265. ' the text box.
  266. ' VSElastic is used to automatically resize the form and
  267. ' for flooding status when parsing the file.
  268. ' CMDialog is used to open the file.
  269. Sub Command1_Click (Index%)
  270.   Select Case Index
  271.     Case 0 'Open Button
  272.       ' get file name
  273.       cmdialog.DialogTitle = "Open VB Project"
  274.       cmdialog.Filename = ""
  275.       cmdialog.DefaultExt = "MAK"
  276.       cmdialog.Filter = "VB Projects (*.mak)|*.MAK|All Files (*.*)|*.*"
  277.       cmdialog.Flags = &H1800&
  278.       cmdialog.Action = 1
  279.       If cmdialog.Filename = "" Then Exit Sub
  280.       ' read project
  281.       text1 = ""
  282.       vsawk1.FileName = cmdialog.Filename
  283.       vsawk1.Tag = Left(cmdialog.Filename, Len(cmdialog.Filename) - Len(cmdialog.Filetitle))
  284.       vsawk1.Action = 0
  285.       vselastic3.FloodPercent = 0
  286.       vselastic3 = "Ready"
  287.     Case 1 ' Clipboard
  288.       If text1 = "" Then MsgBox "Sorry, no code selected.", 16: Exit Sub
  289.       clipboard.SetText text1, 1
  290.       vselastic3 = "Code copied to clipboard"
  291.     Case 2 'Print
  292.       MsgBox "Print routine not implemented", 64
  293.   End Select
  294. End Sub
  295. Sub Command1_MouseMove (Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
  296.   If OldTip = Index Then Exit Sub
  297.   ToolTip.Caption = Command1(Index).Tag
  298.   ToolTip.Width = TextWidth(Command1(Index).Tag)
  299.   ToolTip.Move Command1(Index).Left + Command1(Index).Height * .75, Command1(Index).Top + Command1(Index).Height * 1.1
  300.   ToolTip.Visible = True
  301.   OldTip = Index
  302. End Sub
  303. Sub List2_DblClick ()
  304.   vsawk3 = list2
  305.   vsawk3.FileName = vsawk3.F(3)
  306.   vsawk3.Tag = Val(vsawk3.F(4))
  307.   vsawk3.Action = 0
  308. End Sub
  309. Sub VSAwk1_Begin ()
  310.   mousepointer = 11
  311.   list1.Clear
  312. End Sub
  313. Sub VSAwk1_End ()
  314.   Dim i%
  315.   list2.Clear
  316.   For i = 0 To list1.ListCount - 1
  317.     list1.ListIndex = i
  318.     vsawk2.FileName = list1.List(i)
  319.     vselastic3 = vsawk2.FileName
  320.     vsawk2.Action = 0
  321.     list2.Refresh
  322.   Next
  323. End Sub
  324. Sub VSAwk1_Scan ()
  325.   'add .FRM files to List1
  326.   If InStr(vsawk1, "=") > 0 Or InStr(vsawk1, "VBX") > 0 Then Exit Sub
  327.   If InStr(vsawk1, "\") > 0 Then
  328.     list1.AddItem vsawk1
  329.   Else
  330.     list1.AddItem vsawk1.Tag + vsawk1
  331.   End If
  332. End Sub
  333. Sub VSAwk2_End ()
  334.   mousepointer = 0
  335. End Sub
  336. Sub VSAwk2_Scan ()
  337.   Static insub%, a$, lp%
  338.   If vsawk2.PercentDone <> lp Then
  339.     lp = vsawk2.PercentDone
  340.     vselastic3.FloodPercent = lp
  341.     DoEvents
  342.   End If
  343.   '=====================================================
  344.   'Search for subroutines/Functions/Variable definitions
  345.   '=====================================================
  346.   If vsawk2.F(1) = "Sub" Then
  347.     insub = True
  348.     a = vsawk2.F(2) + Chr(9) + "(sub)" + Chr(9) + vsawk2.FileName + Chr(9) + Format(vsawk2.CurrPos)
  349.     list2.AddItem a
  350.     Exit Sub
  351.   End If
  352.   If vsawk2.F(1) = "Function" Then
  353.     insub = True
  354.     a = vsawk2.F(2) + Chr(9) + "(fun)" + Chr(9) + vsawk2.FileName + Chr(9) + Format(vsawk2.CurrPos)
  355.     list2.AddItem a
  356.     Exit Sub
  357.   End If
  358.   If vsawk2.F(1) = "Global" And vsawk2.F(2) <> "Const" Then
  359.     a = vsawk2.F(2) + Chr(9) + "(gvar)" + Chr(9) + vsawk2.FileName + Chr(9) + Format(vsawk2.CurrPos)
  360.     list2.AddItem a
  361.     Exit Sub
  362.   End If
  363.   If vsawk2.F(1) = "Dim" And Not insub Then
  364.     a = vsawk2.F(2) + Chr(9) + "(fvar)" + Chr(9) + vsawk2.FileName + Chr(9) + Format(vsawk2.CurrPos)
  365.     list2.AddItem a
  366.     Exit Sub
  367.   End If
  368.   If vsawk2.F(1) = "End" And (vsawk2.F(2) = "Sub" Or vsawk2.F(2) = "Function") Then
  369.     insub = False
  370.     Exit Sub
  371.   End If
  372. End Sub
  373. Sub VSAwk3_Begin ()
  374.   mousepointer = 11
  375.   vsawk3.CurrPos = Val(vsawk3.Tag)
  376.   subtext = ""
  377. End Sub
  378. Sub VSAwk3_End ()
  379.   text1 = subtext
  380.   mousepointer = 0
  381. End Sub
  382. Sub VSAwk3_Scan ()
  383.   ' accumulate text
  384.   If subtext = "" Then
  385.     subtext = vsawk3
  386.   Else
  387.     subtext = subtext + Chr(13) + Chr(10) + vsawk3
  388.   End If
  389.   ' stop if only a var
  390.   If vsawk3.RN = 0 Then
  391.     If vsawk3.F(1) <> "Sub" And vsawk3.F(1) <> "Function" Then vsawk3.Action = 2
  392.   End If
  393.   ' stop at end of functions and subs
  394.   If vsawk3.F(1) = "End" Then
  395.     If vsawk3.F(2) = "Sub" Then vsawk3.Action = 2
  396.     If vsawk3.F(2) = "Function" Then vsawk3.Action = 2
  397.   End If
  398. End Sub
  399. Sub VSElastic1_MouseMove (Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
  400.   OldTip = -1
  401.   ToolTip.Visible = False
  402. End Sub
  403.