home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 October / INTERNET108.ISO / pc / software / windows / building / xmlspy / xmlspyentcomplete5.exe / Data1.cab / _7A484D9592744F4AB24DB60C8EB46F39 (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2002-08-29  |  5.5 KB  |  186 lines

  1. VERSION 5.00
  2. Begin VB.Form DlgWalkPrj 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Show Project Tree"
  5.    ClientHeight    =   4125
  6.    ClientLeft      =   2760
  7.    ClientTop       =   3750
  8.    ClientWidth     =   7920
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   4125
  13.    ScaleWidth      =   7920
  14.    ShowInTaskbar   =   0   'False
  15.    Begin VB.CommandButton BtnRemove 
  16.       Caption         =   "Remove item"
  17.       Height          =   375
  18.       Left            =   6600
  19.       TabIndex        =   6
  20.       Top             =   1920
  21.       Width           =   1215
  22.    End
  23.    Begin VB.CommandButton BtnOpen 
  24.       Caption         =   "Open item"
  25.       Height          =   375
  26.       Left            =   6600
  27.       TabIndex        =   5
  28.       Top             =   1440
  29.       Width           =   1215
  30.    End
  31.    Begin VB.CommandButton BtnStepUp 
  32.       Caption         =   "Step up"
  33.       Height          =   375
  34.       Left            =   6600
  35.       TabIndex        =   4
  36.       Top             =   840
  37.       Width           =   1215
  38.    End
  39.    Begin VB.CommandButton BtnStepDown 
  40.       Caption         =   "Step down"
  41.       Height          =   375
  42.       Left            =   6600
  43.       TabIndex        =   3
  44.       Top             =   360
  45.       Width           =   1215
  46.    End
  47.    Begin VB.ListBox ListItems 
  48.       BeginProperty Font 
  49.          Name            =   "Courier New"
  50.          Size            =   9
  51.          Charset         =   0
  52.          Weight          =   400
  53.          Underline       =   0   'False
  54.          Italic          =   0   'False
  55.          Strikethrough   =   0   'False
  56.       EndProperty
  57.       Height          =   3660
  58.       Left            =   120
  59.       TabIndex        =   1
  60.       Top             =   360
  61.       Width           =   6255
  62.    End
  63.    Begin VB.CommandButton CancelButton 
  64.       Caption         =   "Close"
  65.       Height          =   375
  66.       Left            =   6600
  67.       TabIndex        =   0
  68.       Top             =   3600
  69.       Width           =   1215
  70.    End
  71.    Begin VB.Line Line1 
  72.       X1              =   6600
  73.       X2              =   7800
  74.       Y1              =   1320
  75.       Y2              =   1320
  76.    End
  77.    Begin VB.Label Label1 
  78.       Caption         =   "Items of current project level:"
  79.       Height          =   255
  80.       Left            =   120
  81.       TabIndex        =   2
  82.       Top             =   120
  83.       Width           =   4095
  84.    End
  85. Attribute VB_Name = "DlgWalkPrj"
  86. Attribute VB_GlobalNameSpace = False
  87. Attribute VB_Creatable = False
  88. Attribute VB_PredeclaredId = True
  89. Attribute VB_Exposed = False
  90. Public objPrj As SpyProject
  91. Private objPrjItems As SpyProjectItems
  92. Option Explicit
  93. Private Sub BtnOpen_Click()
  94.     On Error Resume Next
  95.     If ListItems.ListIndex >= 0 Then
  96.         objPrjItems.Item(ListItems.ListIndex + 1).Open
  97.         CheckForError
  98.     End If
  99. End Sub
  100. Private Sub BtnRemove_Click()
  101.     On Error Resume Next
  102.     If ListItems.ListIndex >= 0 Then
  103.         objPrjItems.RemoveItem objPrjItems.Item(ListItems.ListIndex + 1)
  104.         CheckForError
  105.         SetListItems
  106.     End If
  107. End Sub
  108. Private Sub BtnStepDown_Click()
  109.     If ListItems.ListIndex >= 0 Then
  110.         Dim objTmpItem As SpyProjectItem
  111.         Set objTmpItem = objPrjItems.Item(ListItems.ListIndex + 1)
  112.         
  113.         If objTmpItem.ItemType = spyFolderItem Then
  114.             Set objPrjItems = objTmpItem.ChildItems
  115.             SetListItems
  116.         End If
  117.     End If
  118. End Sub
  119. Private Sub BtnStepUp_Click()
  120.     On Error Resume Next
  121.     If ListItems.ListCount > 0 Then
  122.         Dim objTmpItem As SpyProjectItem
  123.         Set objTmpItem = objPrjItems.Item(0).ParentItem
  124.         
  125.         If Not (objTmpItem Is Nothing) Then
  126.             Set objPrjItems = objTmpItem.ChildItems
  127.             SetListItems
  128.             Set objTmpItem = Nothing
  129.         End If
  130.     End If
  131. End Sub
  132. Private Sub CancelButton_Click()
  133.     Hide
  134. End Sub
  135. Private Sub SetListItems()
  136.     ListItems.Clear
  137.     If Not (objPrjItems Is Nothing) Then
  138.         Dim objPrjItem As SpyProjectItem
  139.         
  140.         For Each objPrjItem In objPrjItems
  141.             Dim strLine As String
  142.             strLine = objPrjItem.Name & String(48 - Len(objPrjItem.Name), " ")
  143.             Select Case objPrjItem.ItemType
  144.                 Case spyFolderItem
  145.                     strLine = strLine & " Folder"
  146.                 Case spyFileItem
  147.                     strLine = strLine & " File"
  148.                 Case spyUnknownItem
  149.                     strLine = strLine & " Unknown"
  150.                 Case spyURLItem
  151.                     strLine = strLine & " URL"
  152.             End Select
  153.             
  154.             ListItems.AddItem strLine
  155.         Next
  156.     End If
  157.     EnDisBtns
  158. End Sub
  159. Private Sub EnDisBtns()
  160.     If ListItems.ListIndex < 0 Then
  161.         BtnStepDown.Enabled = False
  162.         BtnOpen.Enabled = False
  163.         BtnRemove.Enabled = False
  164.     Else
  165.         BtnStepDown.Enabled = True
  166.         BtnOpen.Enabled = True
  167.         BtnRemove.Enabled = True
  168.     End If
  169.     BtnStepUp.Enabled = False
  170.     If ListItems.ListCount > 0 Then
  171.         On Error Resume Next
  172.         If Not (objPrjItems.Item(0).ParentItem Is Nothing) Then
  173.             BtnStepUp.Enabled = True
  174.         End If
  175.     End If
  176. End Sub
  177. Private Sub Form_Activate()
  178.     If Not (objPrj Is Nothing) Then
  179.         Set objPrjItems = objPrj.RootItems
  180.     End If
  181.     SetListItems
  182. End Sub
  183. Private Sub ListItems_Click()
  184.     EnDisBtns
  185. End Sub
  186.