home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Game Programming for Teens / VBGPFT.cdr / DirectX8 / dx8vbsdk.exe / samples / multimedia / vbsamples / directshow / editing / slideshowvb / sourceclip.ctl < prev    next >
Encoding:
Visual Basic user-defined control file  |  2000-09-22  |  46.6 KB  |  941 lines

  1. VERSION 5.00
  2. Begin VB.UserControl SourceClip 
  3.    BackColor       =   &H00FF0000&
  4.    BorderStyle     =   1  'Fixed Single
  5.    ClientHeight    =   2100
  6.    ClientLeft      =   0
  7.    ClientTop       =   0
  8.    ClientWidth     =   1860
  9.    EditAtDesignTime=   -1  'True
  10.    KeyPreview      =   -1  'True
  11.    LockControls    =   -1  'True
  12.    OLEDropMode     =   1  'Manual
  13.    ScaleHeight     =   2100
  14.    ScaleWidth      =   1860
  15.    ToolboxBitmap   =   "SourceClip.ctx":0000
  16.    Begin VB.Frame fraFixture 
  17.       BackColor       =   &H00000000&
  18.       BorderStyle     =   0  'None
  19.       Height          =   2115
  20.       Left            =   0
  21.       OLEDropMode     =   1  'Manual
  22.       TabIndex        =   0
  23.       Top             =   0
  24.       Width           =   1815
  25.       Begin VB.Label lblClipName 
  26.          Alignment       =   2  'Center
  27.          Appearance      =   0  'Flat
  28.          BackColor       =   &H80000005&
  29.          BackStyle       =   0  'Transparent
  30.          ForeColor       =   &H00FFFFFF&
  31.          Height          =   255
  32.          Left            =   0
  33.          OLEDropMode     =   1  'Manual
  34.          TabIndex        =   1
  35.          Top             =   1800
  36.          Width           =   1815
  37.       End
  38.       Begin VB.Image imgSourceClip 
  39.          Appearance      =   0  'Flat
  40.          BorderStyle     =   1  'Fixed Single
  41.          Height          =   1695
  42.          Left            =   0
  43.          OLEDropMode     =   1  'Manual
  44.          Picture         =   "SourceClip.ctx":0312
  45.          Stretch         =   -1  'True
  46.          Top             =   0
  47.          Width           =   1815
  48.       End
  49.    End
  50. End
  51. Attribute VB_Name = "SourceClip"
  52. Attribute VB_GlobalNameSpace = False
  53. Attribute VB_Creatable = True
  54. Attribute VB_PredeclaredId = False
  55. Attribute VB_Exposed = False
  56. '*******************************************************************************
  57. '*       This is a part of the Microsoft DXSDK Code Samples.
  58. '*       Copyright (C) 1999-2000 Microsoft Corporation.
  59. '*       All rights reserved.
  60. '*       This source code is only intended as a supplement to
  61. '*       Microsoft Development Tools and/or SDK documentation.
  62. '*       See these sources for detailed information regarding the
  63. '*       Microsoft samples programs.
  64. '*******************************************************************************
  65. Option Explicit
  66. Option Base 0
  67. Option Compare Text
  68.  
  69. Private m_bstrFilter As String
  70. Private m_nBorderStyle As Long
  71. Private m_nBorderColor As Long
  72. Private m_bstrMediaFile As String
  73. Private m_sngBorderSize As Single
  74. Private m_boolShowMediaInfo As Boolean
  75.  
  76. 'default application value(s)
  77. Private Const APP_SEPTUM_SIZE As Single = 60 'default septum size; in twips
  78. Private Const APP_DIVISIONAL_PERCENTAGE As Single = 0.75 'default divisional; in percent
  79.  
  80. 'default design-time property value(s)
  81. Private Const DEFAULT_BORDERSIZE As Single = 5 'default border size, in pixels
  82. Private Const DEFAULT_BORDERSTYLE As Long = 1 'default border style
  83. Private Const DEFAULT_BORDERCOLOR As Long = vbBlack 'default border color, vbBlack
  84. Private Const DEFAULT_SHOWMEDIAINFO As Boolean = True 'default show info pane
  85. Private Const DEFAULT_MEDIAFILE As String = vbNullString 'default media file path/name
  86. Private Const DEFAULT_FILTER As String = ".avi;.mov;.mpg;.mpeg;.bmp;.jpg;.jpeg;.gif" 'default supported video media files
  87.  
  88.  
  89. ' **************************************************************************************************************************************
  90. ' * PUBLIC INTERFACE- EVENTS
  91. ' *
  92. ' *
  93.            Public Event Import(bstrFileName As String, Cancel As Boolean)
  94. Attribute Import.VB_Description = "Occurs when media is imported into the control by a user.  Set 'Cancel' to true to inhibit the operation."
  95.  
  96.  
  97. ' **************************************************************************************************************************************
  98. ' * PUBLIC INTERFACE- CONTROL ENUMERATIONS
  99. ' *
  100. ' *
  101.             Public Enum SRCClipBorderStyleConstants
  102.             None = 0
  103.             FixedSingle = 1
  104.             End Enum
  105.  
  106.  
  107. ' **************************************************************************************************************************************
  108. ' * PUBLIC INTERFACE- CONTROL PROPERTIES
  109. ' *
  110. ' *
  111.  
  112.             ' ******************************************************************************************************************************
  113.             ' * procedure name: BorderColor
  114.             ' * procedure description:  Returns either the elected or default border color.
  115.             ' *
  116.             ' ******************************************************************************************************************************
  117.             Public Property Get BorderColor() As OLE_COLOR
  118. Attribute BorderColor.VB_Description = "Returns or assigns the controls border color."
  119. Attribute BorderColor.VB_ProcData.VB_Invoke_Property = ";Appearance"
  120.             On Local Error GoTo ErrLine
  121.             
  122.             'obtain from module-level
  123.             BorderColor = m_nBorderColor
  124.             Exit Property
  125.             
  126. ErrLine:
  127.             Err.Clear
  128.             Exit Property
  129.             End Property
  130.             
  131.             
  132.             ' ******************************************************************************************************************************
  133.             ' * procedure name: BorderColor
  134.             ' * procedure description:  Allows the client to assign a color to the controls border.
  135.             ' *
  136.             ' ******************************************************************************************************************************
  137.             Public Property Let BorderColor(RHS As OLE_COLOR)
  138.             On Local Error GoTo ErrLine
  139.             
  140.             'assign to module-level
  141.             m_nBorderColor = RHS
  142.             
  143.             'reset bordercolor
  144.             If UserControl.BackColor <> RHS Then
  145.                UserControl.BackColor = RHS
  146.             End If
  147.             Exit Property
  148.             
  149. ErrLine:
  150.             Err.Clear
  151.             Exit Property
  152.             End Property
  153.             
  154.             
  155.             ' ******************************************************************************************************************************
  156.             ' * procedure name: BorderStyle
  157.             ' * procedure description:  Returns the style of the border around the control. Arguments are  0 - None or 1- Fixed Single
  158.             ' *
  159.             ' ******************************************************************************************************************************
  160.             Public Property Get BorderStyle() As SRCClipBorderStyleConstants
  161. Attribute BorderStyle.VB_Description = "Returns or assigns the style of the border around the control. Arguments are  0 - None or 1- Fixed Single"
  162. Attribute BorderStyle.VB_ProcData.VB_Invoke_Property = ";Appearance"
  163.             On Local Error GoTo ErrLine
  164.             
  165.             'obtain from module-level
  166.             BorderStyle = m_nBorderStyle
  167.             Exit Property
  168.             
  169. ErrLine:
  170.             Err.Clear
  171.             Exit Property
  172.             End Property
  173.             
  174.             
  175.             ' ******************************************************************************************************************************
  176.             ' * procedure name: BorderStyle
  177.             ' * procedure description:  Assigns the style of the border around the control. Arguments are  0 - None or 1- Fixed Single
  178.             ' *
  179.             ' ******************************************************************************************************************************
  180.             Public Property Let BorderStyle(RHS As SRCClipBorderStyleConstants)
  181.             On Local Error GoTo ErrLine
  182.             
  183.             'assign to module-level
  184.             m_nBorderStyle = RHS
  185.             
  186.             'update borderstyle of the component
  187.             If RHS = None Then
  188.                Me.BorderSize = 0
  189.             End If
  190.             Exit Property
  191.             
  192. ErrLine:
  193.             Err.Clear
  194.             Exit Property
  195.             End Property
  196.             
  197.             
  198.             ' ******************************************************************************************************************************
  199.             ' * procedure name: BorderSize
  200.             ' * procedure description:  Returns the width of the controls border, in pixels.
  201.             ' *
  202.             ' ******************************************************************************************************************************
  203.             Public Property Get BorderSize() As Single
  204. Attribute BorderSize.VB_Description = "Returns or assigns the width of the controls border, in pixels."
  205. Attribute BorderSize.VB_ProcData.VB_Invoke_Property = ";Appearance"
  206.             On Local Error GoTo ErrLine
  207.             
  208.             'obtain from module-level
  209.             BorderSize = m_sngBorderSize
  210.             Exit Property
  211.             
  212. ErrLine:
  213.             Err.Clear
  214.             Exit Property
  215.             End Property
  216.             
  217.             
  218.             ' ******************************************************************************************************************************
  219.             ' * procedure name: BorderSize
  220.             ' * procedure description:  Assigns the width of the controls border, in pixels.
  221.             ' *
  222.             ' ******************************************************************************************************************************
  223.             Public Property Let BorderSize(RHS As Single)
  224.             On Local Error GoTo ErrLine
  225.             
  226.             'assign to module-level; convert to pixels
  227.             m_sngBorderSize = CLng((RHS))
  228.             
  229.             'if the bordersize is zero then reset the borderstyle to None
  230.             If RHS = 0 Then
  231.                Me.BorderStyle = None
  232.                Call UserControl_Resize
  233.             Else: Call UserControl_Resize
  234.             End If
  235.             Exit Property
  236.             
  237. ErrLine:
  238.             Err.Clear
  239.             Exit Property
  240.             End Property
  241.             
  242.             
  243.             ' ******************************************************************************************************************************
  244.             ' * procedure name: Filter
  245.             ' * procedure description:  Returns the semi colon delimited filter string for media MediaFile/export.
  246.             ' *                                       Similar to the common dialog filter property.  Valid Filter String Example:  ".avi;.mpg;.bmp"
  247.             ' ******************************************************************************************************************************
  248.             Public Property Get Filter() As String
  249. Attribute Filter.VB_Description = "Returns or assigns a semi colon delimited filter string for media MediaFile/export.  Similar to the common dialog filter property.  Valid Filter String Example:  "".avi;.mpg;.bmp"""
  250. Attribute Filter.VB_ProcData.VB_Invoke_Property = ";Misc"
  251.             On Local Error GoTo ErrLine
  252.             
  253.             'return the filter
  254.             Filter = m_bstrFilter
  255.             Exit Property
  256.             
  257. ErrLine:
  258.             Err.Clear
  259.             Exit Property
  260.             End Property
  261.             
  262.             
  263.             ' ******************************************************************************************************************************
  264.             ' * procedure name: Filter
  265.             ' * procedure description:  Assigns the semi colon delimited filter string for media MediaFile/export.
  266.             ' *                                       Similar to the common dialog filter property.  Valid Filter String Example:  ".avi;.mpg;.bmp"
  267.             ' ******************************************************************************************************************************
  268.             Public Property Let Filter(RHS As String)
  269.             On Local Error GoTo ErrLine
  270.             
  271.             'assign the filter
  272.             m_bstrFilter = RHS
  273.             Exit Property
  274.             
  275. ErrLine:
  276.             Err.Clear
  277.             Exit Property
  278.             End Property
  279.             
  280.             
  281.             ' ******************************************************************************************************************************
  282.             ' * procedure name: MediaFile
  283.             ' * procedure description:  Assigns the given media file to the control and maps it to the control for preview.
  284.             ' *
  285.             ' ******************************************************************************************************************************
  286.             Public Property Let MediaFile(RHS As String)
  287.             Dim nStreams As Long
  288.             Dim boolCancel As Boolean
  289.             Dim objMediaDet As MediaDet
  290.             On Local Error GoTo ErrLine
  291.             
  292.             'raiseevent
  293.             RaiseEvent Import(RHS, boolCancel)
  294.             If boolCancel = True Then Exit Property
  295.             
  296.             'assign to module-level
  297.             m_bstrMediaFile = RHS
  298.             
  299.             If HasVideoStream(RHS) Then
  300.                'the media has been verified as having at least (1) valid video stream
  301.                'so obtain a bitmap of the first frame of the first file dragged on to the usercontrol
  302.                'or any of it's contingent controls and proceed to write out the bitmap to a temporary
  303.                'file in the temp directory.  From the temp file we can load the poster frame into the control.
  304.                Set objMediaDet = New MediaDet
  305.                objMediaDet.FileName = RHS
  306.                Call objMediaDet.WriteBitmapBits(0, CLng(imgSourceClip.Width / Screen.TwipsPerPixelX), CLng(imgSourceClip.Height / Screen.TwipsPerPixelY), CStr(GetTempDirectory & App.EXEName & ".bmp"))
  307.                'map the bitmap back to the temporary surface
  308.                If ObjPtr(LoadPicture(GetTempDirectory & App.EXEName & ".bmp")) > 0 Then _
  309.                   Set imgSourceClip.Picture = LoadPicture(GetTempDirectory & App.EXEName & ".bmp")
  310.                   If InStrRev(RHS, "\") > 0 Then
  311.                      lblClipName.Caption = Trim(LCase(Mid(RHS, InStrRev(RHS, "\") + 1, Len(RHS))))
  312.                      lblClipName.ToolTipText = Trim(LCase(Mid(RHS, InStrRev(RHS, "\") + 1, Len(RHS))))
  313.                      imgSourceClip.ToolTipText = Trim(LCase(Mid(RHS, InStrRev(RHS, "\") + 1, Len(RHS))))
  314.                   Else
  315.                      lblClipName.Caption = vbNullString
  316.                      lblClipName.ToolTipText = vbNullString
  317.                      imgSourceClip.ToolTipText = vbNullString
  318.                   End If
  319.             Else
  320.                   imgSourceClip.Picture = LoadPicture(vbNullString) 'disregard the picture
  321.                   If InStrRev(RHS, "\") > 0 Then
  322.                      lblClipName.Caption = Trim(LCase(Mid(RHS, InStrRev(RHS, "\") + 1, Len(RHS))))
  323.                      lblClipName.ToolTipText = Trim(LCase(Mid(RHS, InStrRev(RHS, "\") + 1, Len(RHS))))
  324.                      imgSourceClip.ToolTipText = Trim(LCase(Mid(RHS, InStrRev(RHS, "\") + 1, Len(RHS))))
  325.                   Else
  326.                      lblClipName.Caption = vbNullString
  327.                      lblClipName.ToolTipText = vbNullString
  328.                      imgSourceClip.ToolTipText = vbNullString
  329.                   End If
  330.             End If
  331.             
  332.             'clean-up & dereference
  333.             If ObjPtr(objMediaDet) > 0 Then Set objMediaDet = Nothing
  334.             Exit Property
  335.             
  336. ErrLine:
  337.             Err.Clear
  338.             Exit Property
  339.             End Property
  340.             
  341.             
  342.             ' ******************************************************************************************************************************
  343.             ' * procedure name: MediaFile
  344.             ' * procedure description:  Returns the assigned media file for the control.
  345.             ' *
  346.             ' ******************************************************************************************************************************
  347.             Public Property Get MediaFile() As String
  348. Attribute MediaFile.VB_Description = "Returns or assigns the given media file to the control and maps it to the control for preview."
  349. Attribute MediaFile.VB_ProcData.VB_Invoke_Property = ";Misc"
  350.             On Local Error GoTo ErrLine
  351.             
  352.             'return the media file
  353.             MediaFile = m_bstrMediaFile
  354.             Exit Property
  355.             
  356. ErrLine:
  357.             Err.Clear
  358.             Exit Property
  359.             End Property
  360.             
  361.             
  362.             ' ******************************************************************************************************************************
  363.             ' * procedure name: BorderColor
  364.             ' * procedure description:  Returns a boolean indicating if the media info is displayed for the given clip.
  365.             ' *
  366.             ' ******************************************************************************************************************************
  367.             Public Property Get ShowMediaInfo() As OLE_CANCELBOOL
  368. Attribute ShowMediaInfo.VB_Description = "Returns or assigns a value indicating if the media info is displayed for the given clip."
  369. Attribute ShowMediaInfo.VB_ProcData.VB_Invoke_Property = ";Appearance"
  370.             On Local Error GoTo ErrLine
  371.             
  372.             'obtain from module-level
  373.             ShowMediaInfo = m_boolShowMediaInfo
  374.             Exit Property
  375.             
  376. ErrLine:
  377.             Err.Clear
  378.             Exit Property
  379.             End Property
  380.             
  381.             
  382.             ' ******************************************************************************************************************************
  383.             ' * procedure name: ShowMediaInfo
  384.             ' * procedure description:  Assigns a boolean indicating if the media info is displayed for the given clip.
  385.             ' *
  386.             ' ******************************************************************************************************************************
  387.             Public Property Let ShowMediaInfo(RHS As OLE_CANCELBOOL)
  388.             On Local Error GoTo ErrLine
  389.             
  390.             'assign to module-level
  391.             m_boolShowMediaInfo = RHS
  392.             
  393.             'resize component to reflect update
  394.             lblClipName.Visible = RHS
  395.             Call UserControl_Resize
  396.             Exit Property
  397.             
  398. ErrLine:
  399.             Err.Clear
  400.             Exit Property
  401.             End Property
  402.             
  403.  
  404. ' **************************************************************************************************************************************
  405. ' * PRIVATE INTERFACE- USER CONTROL EVENTS
  406. ' *
  407. ' *
  408.             ' ******************************************************************************************************************************
  409.             ' * procedure name: UserControl_AmbientChanged
  410.             ' * procedure description:  Occurs when an ambient value was changed by the container of a user control
  411.             ' *
  412.             ' ******************************************************************************************************************************
  413.             Private Sub UserControl_AmbientChanged(PropertyName As String)
  414.             On Local Error GoTo ErrLine
  415.             Exit Sub
  416.             
  417. ErrLine:
  418.             Err.Clear
  419.             Exit Sub
  420.             End Sub
  421.             
  422.             
  423.             ' ******************************************************************************************************************************
  424.             ' * procedure name: UserControl_AsyncReadComplete
  425.             ' * procedure description:  Occurs when all of the data is available as a result of the AsyncRead method.
  426.             ' *
  427.             ' ******************************************************************************************************************************
  428.             Private Sub UserControl_AsyncReadComplete(AsyncProp As AsyncProperty)
  429.             On Local Error GoTo ErrLine
  430.             Exit Sub
  431.             
  432. ErrLine:
  433.             Err.Clear
  434.             Exit Sub
  435.             End Sub
  436.             
  437.             
  438.             ' ******************************************************************************************************************************
  439.             ' * procedure name: UserControl_AsyncReadProgress
  440.             ' * procedure description:  Occurs when more data is available as a result of the AsyncReadProgress method.
  441.             ' *
  442.             ' ******************************************************************************************************************************
  443.             Private Sub UserControl_AsyncReadProgress(AsyncProp As AsyncProperty)
  444.             On Local Error GoTo ErrLine
  445.             Exit Sub
  446.             
  447. ErrLine:
  448.             Err.Clear
  449.             Exit Sub
  450.             End Sub
  451.  
  452.  
  453.             ' ******************************************************************************************************************************
  454.             ' * procedure name: UserControl_Click
  455.             ' * procedure description:   Occurs when the user presses and then releases a mouse button over an object.
  456.             ' *
  457.             ' ******************************************************************************************************************************
  458.             Private Sub UserControl_Click()
  459.             On Local Error GoTo ErrLine
  460.             Exit Sub
  461.             
  462. ErrLine:
  463.             Err.Clear
  464.             Exit Sub
  465.             End Sub
  466.             
  467.             
  468.             ' ******************************************************************************************************************************
  469.             ' * procedure name: UserControl_DragDrop
  470.             ' * procedure description:  Occurs when a drag-and-drop operation is completed.
  471.             ' *
  472.             ' ******************************************************************************************************************************
  473.             Private Sub UserControl_DragDrop(Source As Control, X As Single, Y As Single)
  474.             On Local Error GoTo ErrLine
  475.             Exit Sub
  476.             
  477. ErrLine:
  478.             Err.Clear
  479.             Exit Sub
  480.             End Sub
  481.             
  482.             
  483.             ' ******************************************************************************************************************************
  484.             ' * procedure name: UserControl_DragOver
  485.             ' * procedure description:   Occurs when a drag-and-drop operation is in progress.
  486.             ' *
  487.             ' ******************************************************************************************************************************
  488.             Private Sub UserControl_DragOver(Source As Control, X As Single, Y As Single, State As Integer)
  489.             On Local Error GoTo ErrLine
  490.             Exit Sub
  491.             
  492. ErrLine:
  493.             Err.Clear
  494.             Exit Sub
  495.             End Sub
  496.             
  497.             
  498.             ' ******************************************************************************************************************************
  499.             ' * procedure name: UserControl_GotFocus
  500.             ' * procedure description:  Occurs when an object receives the focus.
  501.             ' *
  502.             ' ******************************************************************************************************************************
  503.             Private Sub UserControl_GotFocus()
  504.             On Local Error GoTo ErrLine
  505.             Exit Sub
  506.             
  507. ErrLine:
  508.             Err.Clear
  509.             Exit Sub
  510.             End Sub
  511.             
  512.             
  513.             ' ******************************************************************************************************************************
  514.             ' * procedure name: UserControl_Hide
  515.             ' * procedure description:  Occurs when the control's Visible property changes to False.
  516.             ' *
  517.             ' ******************************************************************************************************************************
  518.             Private Sub UserControl_Hide()
  519.             On Local Error GoTo ErrLine
  520.             Exit Sub
  521.             
  522. ErrLine:
  523.             Err.Clear
  524.             Exit Sub
  525.             End Sub
  526.             
  527.             
  528.             ' ******************************************************************************************************************************
  529.             ' * procedure name: UserControl_Initialize
  530.             ' * procedure description:  Occurs when an application creates an instance of a Form, MDIForm, or class.
  531.             ' *
  532.             ' ******************************************************************************************************************************
  533.             Private Sub UserControl_Initialize()
  534.             On Local Error GoTo ErrLine
  535.             Exit Sub
  536.             
  537. ErrLine:
  538.             Err.Clear
  539.             Exit Sub
  540.             End Sub
  541.             
  542.             
  543.             
  544.             ' ******************************************************************************************************************************
  545.             ' * procedure name: UserControl_InitProperties
  546.             ' * procedure description:  Occurs the first time a user control or user document is created.
  547.             ' *
  548.             ' ******************************************************************************************************************************
  549.             Private Sub UserControl_InitProperties()
  550.             On Local Error GoTo ErrLine
  551.             
  552.             'set public property values for design time
  553.              If UserControl.Ambient.UserMode = False Then
  554.                Me.BorderColor = DEFAULT_BORDERCOLOR
  555.                Me.BorderSize = DEFAULT_BORDERSIZE
  556.                Me.BorderStyle = DEFAULT_BORDERSTYLE
  557.                Me.Filter = DEFAULT_FILTER
  558.                Me.MediaFile = DEFAULT_MEDIAFILE
  559.                Me.ShowMediaInfo = DEFAULT_SHOWMEDIAINFO
  560.             End If
  561.             Exit Sub
  562.             
  563. ErrLine:
  564.             Err.Clear
  565.             Exit Sub
  566.             End Sub
  567.             
  568.  
  569.             ' ******************************************************************************************************************************
  570.             ' * procedure name: UserControl_KeyDown
  571.             ' * procedure description:  Occurs when the user presses a key while an object has the focus.
  572.             ' *
  573.             ' ******************************************************************************************************************************
  574.             Private Sub UserControl_KeyDown(KeyCode As Integer, Shift As Integer)
  575.             On Local Error GoTo ErrLine
  576.             Exit Sub
  577.             
  578. ErrLine:
  579.             Err.Clear
  580.             Exit Sub
  581.             End Sub
  582.             
  583.             
  584.             ' ******************************************************************************************************************************
  585.             ' * procedure name: UserControl_LostFocus
  586.             ' * procedure description:  Occurs when an object loses the focus.
  587.             ' *
  588.             ' ******************************************************************************************************************************
  589.             Private Sub UserControl_LostFocus()
  590.             On Local Error GoTo ErrLine
  591.             Exit Sub
  592.             
  593. ErrLine:
  594.             Err.Clear
  595.             Exit Sub
  596.             End Sub
  597.             
  598.             
  599.             ' ******************************************************************************************************************************
  600.             ' * procedure name: UserControl_OLEDragDrop
  601.             ' * procedure description:  Occurs when data is dropped onto the control via an OLE drag/drop operation,
  602.             ' *                                       and OLEDropMode is set to manual.
  603.             ' ******************************************************************************************************************************
  604.             Private Sub UserControl_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
  605.             On Local Error GoTo ErrLine
  606.             Call AppOLEDragDrop(Data, Effect, Button, Shift, X, Y)
  607.             Exit Sub
  608.             
  609. ErrLine:
  610.             Err.Clear
  611.             Exit Sub
  612.             End Sub
  613.             
  614.             
  615.             ' ******************************************************************************************************************************
  616.             ' * procedure name: UserControl_OLEDragOver
  617.             ' * procedure description:  Occurs when the mouse is moved over the control during an OLE drag/drop operation,
  618.             ' *                                       if its OLEDropMode property is set to manual.
  619.             ' ******************************************************************************************************************************
  620.             Private Sub UserControl_OLEDragOver(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single, State As Integer)
  621.             On Local Error GoTo ErrLine
  622.             Call AppOLEDragOver(Data, Effect, Button, Shift, X, Y, State)
  623.             Exit Sub
  624.             
  625. ErrLine:
  626.             Err.Clear
  627.             Exit Sub
  628.             End Sub
  629.             
  630.             
  631.             ' ******************************************************************************************************************************
  632.             ' * procedure name: UserControl_Paint
  633.             ' * procedure description:  Occurs when any part of a form or PictureBox control is moved, enlarged, or exposed.
  634.             ' *
  635.             ' ******************************************************************************************************************************
  636.             Private Sub UserControl_Paint()
  637.             On Local Error GoTo ErrLine
  638.             Exit Sub
  639.             
  640. ErrLine:
  641.             Err.Clear
  642.             Exit Sub
  643.             End Sub
  644.             
  645.             
  646.             ' ******************************************************************************************************************************
  647.             ' * procedure name: UserControl_ReadProperties
  648.             ' * procedure description:  Occurs when a user control or user document is asked to read its data from a file.
  649.             ' *
  650.             ' ******************************************************************************************************************************
  651.             Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
  652.             On Local Error GoTo ErrLine
  653.             
  654.             'obtain design time value(s) from the property bag during run-time
  655.             Me.MediaFile = PropBag.ReadProperty("MediaFile", DEFAULT_MEDIAFILE)
  656.             Me.Filter = PropBag.ReadProperty("Filter", DEFAULT_FILTER)
  657.             Me.BorderColor = PropBag.ReadProperty("BorderColor", DEFAULT_BORDERCOLOR)
  658.             Me.BorderSize = PropBag.ReadProperty("BorderSize", DEFAULT_BORDERSIZE)
  659.             Me.ShowMediaInfo = PropBag.ReadProperty("ShowMediaInfo", DEFAULT_SHOWMEDIAINFO)
  660.             Me.BorderStyle = PropBag.ReadProperty("BorderStyle", DEFAULT_BORDERSTYLE)
  661.             Exit Sub
  662.             
  663. ErrLine:
  664.             Err.Clear
  665.             Exit Sub
  666.             End Sub
  667.  
  668.  
  669.  
  670.             ' ******************************************************************************************************************************
  671.             ' * procedure name: UserControl_Resize
  672.             ' * procedure description:  Occurs when a form is first displayed or the size of an object changes.
  673.             ' *
  674.             ' ******************************************************************************************************************************
  675.             Private Sub UserControl_Resize()
  676.             Dim sngBorderSize As Single
  677.             On Local Error GoTo ErrLine
  678.             
  679.             'assign from module-level
  680.             sngBorderSize = m_sngBorderSize * Screen.TwipsPerPixelX
  681.             
  682.             'fixture frame absolute position
  683.             If fraFixture.Top <> (UserControl.ScaleTop + sngBorderSize) Then fraFixture.Top = (UserControl.ScaleTop + sngBorderSize)
  684.             If fraFixture.Left <> (UserControl.ScaleLeft + sngBorderSize) Then fraFixture.Left = (UserControl.ScaleLeft + sngBorderSize)
  685.             If fraFixture.Width <> (UserControl.ScaleWidth - (sngBorderSize * 2)) Then fraFixture.Width = (UserControl.ScaleWidth - (sngBorderSize * 2))
  686.             If fraFixture.Height <> (UserControl.ScaleHeight - (sngBorderSize * 2)) Then fraFixture.Height = (UserControl.ScaleHeight - (sngBorderSize * 2))
  687.             
  688.             If lblClipName.Visible = False Then
  689.                'source clip picturebox relative position
  690.                If imgSourceClip.Top <> imgSourceClip.Parent.ScaleTop Then imgSourceClip.Top = imgSourceClip.Parent.ScaleTop
  691.                If imgSourceClip.Left <> imgSourceClip.Parent.ScaleLeft Then imgSourceClip.Left = imgSourceClip.Parent.ScaleLeft
  692.                If imgSourceClip.Width <> imgSourceClip.Parent.ScaleWidth Then imgSourceClip.Width = imgSourceClip.Parent.ScaleWidth
  693.                If imgSourceClip.Height <> imgSourceClip.Parent.ScaleHeight Then imgSourceClip.Height = imgSourceClip.Parent.ScaleHeight
  694.                
  695.             Else
  696.                'source clip picturebox relative position
  697.                If imgSourceClip.Top <> imgSourceClip.Parent.ScaleTop Then imgSourceClip.Top = imgSourceClip.Parent.ScaleTop
  698.                If imgSourceClip.Left <> imgSourceClip.Parent.ScaleLeft Then imgSourceClip.Left = imgSourceClip.Parent.ScaleLeft
  699.                If imgSourceClip.Width <> imgSourceClip.Parent.ScaleWidth Then imgSourceClip.Width = imgSourceClip.Parent.ScaleWidth
  700.                If imgSourceClip.Height <> (imgSourceClip.Parent.ScaleHeight * APP_DIVISIONAL_PERCENTAGE) Then imgSourceClip.Height = (imgSourceClip.Parent.ScaleHeight * APP_DIVISIONAL_PERCENTAGE)
  701.                
  702.                'source clip filename relative to source clip picturebox
  703.                If lblClipName.Top <> (imgSourceClip.Top + imgSourceClip.Height) + APP_SEPTUM_SIZE Then lblClipName.Top = (imgSourceClip.Top + imgSourceClip.Height) + APP_SEPTUM_SIZE
  704.                If lblClipName.Left <> lblClipName.Parent.ScaleLeft Then lblClipName.Left = lblClipName.Parent.ScaleLeft
  705.                If lblClipName.Width <> lblClipName.Parent.ScaleWidth Then lblClipName.Width = lblClipName.Parent.ScaleWidth
  706.                If lblClipName.Height <> lblClipName.Parent.ScaleHeight - (imgSourceClip.Height + APP_SEPTUM_SIZE) Then lblClipName.Height = lblClipName.Parent.ScaleHeight - (imgSourceClip.Height + APP_SEPTUM_SIZE)
  707.             End If
  708.             Exit Sub
  709.             
  710. ErrLine:
  711.             Err.Clear
  712.             Exit Sub
  713.             End Sub
  714.             
  715.             
  716.             ' ******************************************************************************************************************************
  717.             ' * procedure name: UserControl_Show
  718.             ' * procedure description:  Occurs when the control's Visible property changes to True.
  719.             ' *
  720.             ' ******************************************************************************************************************************
  721.             Private Sub UserControl_Show()
  722.             On Local Error GoTo ErrLine
  723.             Exit Sub
  724.             
  725. ErrLine:
  726.             Err.Clear
  727.             Exit Sub
  728.             End Sub
  729.             
  730.             
  731.             ' ******************************************************************************************************************************
  732.             ' * procedure name: UserControl_Terminate
  733.             ' * procedure description:  Occurs when all references to an instance of a Form, MDIForm, or class are removed from memory.
  734.             ' *
  735.             ' ******************************************************************************************************************************
  736.             Private Sub UserControl_Terminate()
  737.             On Local Error GoTo ErrLine
  738.             Exit Sub
  739.             
  740. ErrLine:
  741.             Err.Clear
  742.             Exit Sub
  743.             End Sub
  744.             
  745.             
  746.             ' ******************************************************************************************************************************
  747.             ' * procedure name: UserControl_WriteProperties
  748.             ' * procedure description:  Occurs when a user control or user document is asked to write its data to a file.
  749.             ' *
  750.             ' ******************************************************************************************************************************
  751.             Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
  752.             On Local Error GoTo ErrLine
  753.             
  754.             'persist design time value(s) to the property bag only after design-time
  755.             If Ambient.UserMode = False Then
  756.                Call PropBag.WriteProperty("Filter", Me.Filter, DEFAULT_FILTER)
  757.                Call PropBag.WriteProperty("MediaFile", Me.MediaFile, DEFAULT_MEDIAFILE)
  758.                Call PropBag.WriteProperty("BorderColor", Me.BorderColor, DEFAULT_BORDERCOLOR)
  759.                Call PropBag.WriteProperty("BorderSize", Me.BorderSize, DEFAULT_BORDERSIZE)
  760.                Call PropBag.WriteProperty("BorderStyle", Me.BorderStyle, DEFAULT_BORDERSTYLE)
  761.                Call PropBag.WriteProperty("ShowMediaInfo", Me.ShowMediaInfo, DEFAULT_SHOWMEDIAINFO)
  762.             End If
  763.             Exit Sub
  764.             
  765. ErrLine:
  766.             Err.Clear
  767.             Exit Sub
  768.             End Sub
  769.             
  770.             
  771.             
  772. ' **************************************************************************************************************************************
  773. ' * PRIVATE INTERFACE- CONTROL EVENTS
  774. ' *
  775. ' *
  776.             ' ******************************************************************************************************************************
  777.             ' * procedure name: imgSourceClip_OLEDragDrop
  778.             ' * procedure description:  Occurs when a user control or user document is asked to write its data to a file.
  779.             ' *
  780.             ' ******************************************************************************************************************************
  781.             Private Sub imgSourceClip_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
  782.             On Local Error GoTo ErrLine
  783.             Call AppOLEDragDrop(Data, Effect, Button, Shift, X, Y)
  784.             Exit Sub
  785.             
  786. ErrLine:
  787.             Err.Clear
  788.             Exit Sub
  789.             End Sub
  790.             
  791.             
  792.             ' ******************************************************************************************************************************
  793.             ' * procedure name: imgSourceClip_OLEDragOver
  794.             ' * procedure description:  Occurs when a user control or user document is asked to write its data to a file.
  795.             ' *
  796.             ' ******************************************************************************************************************************
  797.             Private Sub imgSourceClip_OLEDragOver(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single, State As Integer)
  798.             On Local Error GoTo ErrLine
  799.             Call AppOLEDragOver(Data, Effect, Button, Shift, X, Y, State)
  800.             Exit Sub
  801.             
  802. ErrLine:
  803.             Err.Clear
  804.             Exit Sub
  805.             End Sub
  806.             
  807.             
  808.             ' ******************************************************************************************************************************
  809.             ' * procedure name: lblClipName_OLEDragDrop
  810.             ' * procedure description:  Occurs when the mouse is moved over the control during an OLE drag/drop operation,
  811.             ' *                                       if its OLEDropMode property is set to manual.
  812.             ' ******************************************************************************************************************************
  813.             Private Sub lblClipName_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
  814.             On Local Error GoTo ErrLine
  815.             Call AppOLEDragDrop(Data, Effect, Button, Shift, X, Y)
  816.             Exit Sub
  817.             
  818. ErrLine:
  819.             Err.Clear
  820.             Exit Sub
  821.             End Sub
  822.             
  823.             
  824.             ' ******************************************************************************************************************************
  825.             ' * procedure name: lblClipName_OLEDragOver
  826.             ' * procedure description:  Occurs when the mouse is moved over the control during an OLE drag/drop operation,
  827.             ' *                                       if its OLEDropMode property is set to manual.
  828.             ' ******************************************************************************************************************************
  829.             Private Sub lblClipName_OLEDragOver(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single, State As Integer)
  830.             On Local Error GoTo ErrLine
  831.             Call AppOLEDragOver(Data, Effect, Button, Shift, X, Y, State)
  832.             Exit Sub
  833.             
  834. ErrLine:
  835.             Err.Clear
  836.             Exit Sub
  837.             End Sub
  838.             
  839.             
  840.             ' ******************************************************************************************************************************
  841.             ' * procedure name: fraFixture_OLEDragDrop
  842.             ' * procedure description:  Occurs when the mouse is moved over the control during an OLE drag/drop operation,
  843.             ' *                                       if its OLEDropMode property is set to manual.
  844.             ' ******************************************************************************************************************************
  845.             Private Sub fraFixture_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
  846.             On Local Error GoTo ErrLine
  847.             Call AppOLEDragDrop(Data, Effect, Button, Shift, X, Y)
  848.             Exit Sub
  849.             
  850. ErrLine:
  851.             Err.Clear
  852.             Exit Sub
  853.             End Sub
  854.             
  855.             
  856.             ' ******************************************************************************************************************************
  857.             ' * procedure name: fraFixture_OLEDragOver
  858.             ' * procedure description:  Occurs when the mouse is moved over the control during an OLE drag/drop operation,
  859.             ' *                                       if its OLEDropMode property is set to manual.
  860.             ' ******************************************************************************************************************************
  861.             Private Sub fraFixture_OLEDragOver(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single, State As Integer)
  862.             On Local Error GoTo ErrLine
  863.             Call AppOLEDragOver(Data, Effect, Button, Shift, X, Y, State)
  864.             Exit Sub
  865.             
  866. ErrLine:
  867.             Err.Clear
  868.             Exit Sub
  869.             End Sub
  870.             
  871.  
  872.  
  873. ' **************************************************************************************************************************************
  874. ' * PRIVATE INTERFACE- PROCEDURES
  875. ' *
  876. ' *
  877.             ' ******************************************************************************************************************************
  878.             ' * procedure name: AppOLEDragDrop
  879.             ' * procedure description:  Occurs when the mouse is moved over the control during an OLE drag/drop operation,
  880.             ' *                                       if its OLEDropMode property is set to manual.
  881.             ' ******************************************************************************************************************************
  882.             Private Sub AppOLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
  883.             On Local Error GoTo ErrLine
  884.             
  885.             'load the media clip
  886.             Me.MediaFile = Data.Files(1)
  887.             Exit Sub
  888.             
  889. ErrLine:
  890.             Err.Clear
  891.             Exit Sub
  892.             End Sub
  893.             
  894.             
  895.             ' ******************************************************************************************************************************
  896.             ' * procedure name: AppOLEDragOver
  897.             ' * procedure description:  Occurs when the mouse is moved over the control during an OLE drag/drop operation,
  898.             ' *                                       if its OLEDropMode property is set to manual.
  899.             ' ******************************************************************************************************************************
  900.             Private Sub AppOLEDragOver(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single, State As Integer)
  901.             Dim nCount As Long
  902.             Dim nCount2 As Long
  903.             Dim varSupport() As String
  904.             Dim bstrSupport As String
  905.             Dim bstrFileName As String
  906.             On Local Error GoTo ErrLine
  907.             
  908.             'set default(s)
  909.             Effect = vbDropEffectNone
  910.             If Me.Filter = vbNullString Then
  911.                bstrSupport = DEFAULT_FILTER
  912.             Else: bstrSupport = m_bstrFilter
  913.             End If
  914.             'split the supported files into an array, if this fails the effect will be vbDropEffectNone
  915.             varSupport = Split(bstrSupport, ";")
  916.             
  917.             For nCount = 1 To Data.Files.Count
  918.                 For nCount2 = LBound(varSupport) To UBound(varSupport)
  919.                      If LCase(varSupport(nCount2)) <> vbNullString Then
  920.                         If InStr(LCase(Data.Files(nCount)), LCase(varSupport(nCount2))) > 0 Then
  921.                            'match located, supported media file dropped..
  922.                            Effect = vbDropEffectCopy
  923.                            bstrFileName = Data.Files(nCount)
  924.                            Data.Files.Clear: Data.Files.Add bstrFileName
  925.                            Exit Sub
  926.                         End If
  927.                      End If
  928.                 Next
  929.             Next
  930.             'reset effect
  931.             Effect = vbDropEffectNone
  932.             Exit Sub
  933.             
  934. ErrLine:
  935.  
  936.             Err.Clear
  937.             'reset effect
  938.             Effect = vbDropEffectNone
  939.             Exit Sub
  940.             End Sub
  941.