home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / mac / SiteBldr / AMOVIE / SDK / _SETUP / COMMON.Z / selpin.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-02-16  |  4.4 KB  |  156 lines

  1. VERSION 4.00
  2. Begin VB.Form SelectPin 
  3.    Caption         =   "Select Pin"
  4.    ClientHeight    =   2160
  5.    ClientLeft      =   2655
  6.    ClientTop       =   1830
  7.    ClientWidth     =   4740
  8.    Height          =   2625
  9.    Left            =   2565
  10.    LinkTopic       =   "Form2"
  11.    ScaleHeight     =   2160
  12.    ScaleWidth      =   4740
  13.    Top             =   1455
  14.    Width           =   4920
  15.    Begin VB.CommandButton Cancel 
  16.       Cancel          =   -1  'True
  17.       Caption         =   "Cancel"
  18.       Height          =   375
  19.       Left            =   3480
  20.       TabIndex        =   7
  21.       Top             =   1560
  22.       Width           =   975
  23.    End
  24.    Begin VB.CommandButton OK 
  25.       Caption         =   "OK"
  26.       Default         =   -1  'True
  27.       Height          =   375
  28.       Left            =   3480
  29.       TabIndex        =   6
  30.       Top             =   1080
  31.       Width           =   975
  32.    End
  33.    Begin VB.ComboBox Filters 
  34.       Height          =   315
  35.       Left            =   600
  36.       Style           =   2  'Dropdown List
  37.       TabIndex        =   1
  38.       Top             =   120
  39.       Width           =   2415
  40.    End
  41.    Begin VB.ComboBox Pins 
  42.       Height          =   315
  43.       Left            =   600
  44.       Style           =   2  'Dropdown List
  45.       TabIndex        =   0
  46.       Top             =   1080
  47.       Width           =   2415
  48.    End
  49.    Begin VB.Label VendorInfoLabel 
  50.       Caption         =   "Vendor Info:"
  51.       Height          =   255
  52.       Left            =   120
  53.       TabIndex        =   5
  54.       Top             =   720
  55.       Width           =   975
  56.    End
  57.    Begin VB.Label VendorInfo 
  58.       Height          =   255
  59.       Left            =   1200
  60.       TabIndex        =   4
  61.       Top             =   720
  62.       Visible         =   0   'False
  63.       Width           =   2775
  64.    End
  65.    Begin VB.Label Label1 
  66.       Caption         =   "Filters"
  67.       Height          =   255
  68.       Left            =   120
  69.       TabIndex        =   3
  70.       Top             =   120
  71.       Width           =   495
  72.    End
  73.    Begin VB.Label Label2 
  74.       Caption         =   "Pins"
  75.       Height          =   375
  76.       Left            =   120
  77.       TabIndex        =   2
  78.       Top             =   1080
  79.       Width           =   495
  80.    End
  81. Attribute VB_Name = "SelectPin"
  82. Attribute VB_Creatable = False
  83. Attribute VB_Exposed = False
  84. Public OtherDir As Long
  85. Public SelFilter As IFilterInfo
  86. Public SelPin As IPinInfo
  87. Public Graph As IMediaControl
  88. Public bOK As Boolean
  89. Private Sub Cancel_Click()
  90.     bOK = False
  91.     Hide
  92. End Sub
  93. Private Sub Filters_Click()
  94.     Dim pfilter As IFilterInfo
  95.     For Each pfilter In Graph.FilterCollection
  96.         If pfilter.Name = Filters.Text Then
  97.             Set SelFilter = pfilter
  98.             VendorInfo.Caption = pfilter.VendorInfo
  99.             Pins.Clear
  100.             Dim pin As IPinInfo
  101.             For Each pin In pfilter.Pins
  102.                 Dim pinOther As IPinInfo
  103.                 On Error Resume Next
  104.                 Set pinOther = pin.ConnectedTo
  105.                 If Err.Number <> 0 Then
  106.                     If pin.Direction <> OtherDir Then
  107.                         Pins.AddItem pin.Name
  108.                     End If
  109.                 End If
  110.             Next pin
  111.         End If
  112.     Next pfilter
  113.     Pins.ListIndex = 0
  114. End Sub
  115. Private Sub Form_Load()
  116.     RefreshFilters
  117. End Sub
  118. Public Sub RefreshFilters()
  119.     Filters.Clear
  120.     Dim filter As IFilterInfo
  121.     For Each filter In Graph.FilterCollection
  122.         Dim pin As IPinInfo
  123.         Dim pinOther As IPinInfo
  124.         For Each pin In filter.Pins
  125.             On Error Resume Next
  126.             Set pinOther = pin.ConnectedTo
  127.             If Err.Number <> 0 Then
  128.                 If pin.Direction <> OtherDir Then
  129.                     Filters.AddItem filter.Name
  130.                     Exit For
  131.                 End If
  132.             End If
  133.         Next pin
  134.     Next filter
  135.     Filters.ListIndex = 0
  136. End Sub
  137. Private Sub OK_Click()
  138.     Dim pin As IPinInfo
  139.     For Each pin In SelFilter.Pins
  140.         If pin.Name = Pins.Text Then
  141.             Set SelPin = pin
  142.             bOK = True
  143.             Exit For
  144.         End If
  145.     Next pin
  146.     Hide
  147. End Sub
  148. Private Sub Pins_Click()
  149.   Dim pPin As IPinInfo
  150.   For Each pPin In SelFilter.Pins
  151.     If pPin.Name = Pins.Text Then
  152.       Set SelPin = pPin
  153.     End If
  154.   Next pPin
  155. End Sub
  156.