home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmPickFilter
- BorderStyle = 3 'Fixed Dialog
- Caption = "Filter Definition"
- ClientHeight = 3195
- ClientLeft = 2760
- ClientTop = 3750
- ClientWidth = 6075
- Icon = "frmPickFilter.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3195
- ScaleWidth = 6075
- ShowInTaskbar = 0 'False
- Begin VB.TextBox txtFilter
- Height = 375
- Left = 3960
- TabIndex = 4
- Top = 1440
- Width = 1095
- End
- Begin VB.ListBox lstFilters
- Height = 2010
- Left = 240
- TabIndex = 3
- Top = 600
- Width = 1815
- End
- Begin VB.CommandButton cmdDelete
- Caption = "Delete"
- Height = 375
- Left = 2160
- TabIndex = 2
- Top = 2280
- Width = 735
- End
- Begin VB.CommandButton cmdAdd
- Caption = "Add"
- Height = 375
- Left = 4200
- TabIndex = 1
- Top = 2160
- Width = 735
- End
- Begin VB.CommandButton OKButton
- Caption = "OK"
- Height = 375
- Left = 4680
- TabIndex = 0
- Top = 120
- Width = 1215
- End
- Attribute VB_Name = "frmPickFilter"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Public mSite As Site
- Private Sub cmdAdd_Click()
- Dim strItem As String
- Dim i As Integer
- If Len(txtFilter.Text) = 0 Then Exit Sub
- strItem = txtFilter.Text
- For i = 1 To mSite.FilterCount
- If mSite.FilterEntry(i) = strItem Then
- MsgBox "Filter already included."
- Exit Sub
- End If
- Next
- lstFilters.AddItem strItem
- mSite.FilterCount = mSite.FilterCount + 1
- mSite.FilterEntry(mSite.FilterCount) = strItem
- txtFilter.Text = ""
- End Sub
- Private Sub cmdDelete_Click()
- Dim strItem As String
- Dim i As Integer
- If mSite.FilterCount <= 1 Then
- MsgBox "You must have at least one file filter."
- Exit Sub
- End If
- strItem = lstFilters.List(lstFilters.ListIndex)
- For i = 1 To mSite.FilterCount
- If mSite.FilterEntry(i) = strItem Then
- mSite.RemoveFilter i
- Exit For
- End If
- Next
- lstFilters.RemoveItem (lstFilters.ListIndex)
- If lstFilters.ListCount > 0 Then
- lstFilters.ListIndex = 0
- lstFilters.Selected(lstFilters.ListIndex) = True
- End If
- End Sub
- Private Sub Form_Activate()
- If lstFilters.ListCount > 0 Then
- lstFilters.ListIndex = 0
- lstFilters.Selected(lstFilters.ListIndex) = True
- End If
- End Sub
- Private Sub OKButton_Click()
- Unload Me
- End Sub
-