--- /dev/null
+VERSION 1.0 CLASS\r
+BEGIN\r
+ MultiUse = -1 'True\r
+ Persistable = 0 'NotPersistable\r
+ DataBindingBehavior = 0 'vbNone\r
+ DataSourceBehavior = 0 'vbNone\r
+ MTSTransactionMode = 0 'NotAnMTSObject\r
+END\r
+Attribute VB_Name = "LayoutPropertyInfoSet"\r
+Attribute VB_GlobalNameSpace = False\r
+Attribute VB_Creatable = True\r
+Attribute VB_PredeclaredId = False\r
+Attribute VB_Exposed = False\r
+Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"\r
+Attribute VB_Ext_KEY = "Collection" ,"LayoutPropertyInfo"\r
+Attribute VB_Ext_KEY = "Member0" ,"LayoutPropertyInfo"\r
+Attribute VB_Ext_KEY = "Top_Level" ,"Yes"\r
+'local variable to hold collection\r
+Private mCol As Collection\r
+\r
+Public Function Add(PName As String, DefaultValue As String, Scope As Integer, Engine As Integer, Optional sKey As String) As LayoutPropertyInfo\r
+ 'create a new object\r
+ Dim objNewMember As LayoutPropertyInfo\r
+ Set objNewMember = New LayoutPropertyInfo\r
+\r
+ 'set the properties passed into the method\r
+ objNewMember.PName = PName\r
+ objNewMember.DefaultValue = DefaultValue\r
+ objNewMember.Scope = Scope\r
+ objNewMember.Engine = Engine\r
+ If Len(sKey) = 0 Then\r
+ mCol.Add objNewMember\r
+ Else\r
+ mCol.Add objNewMember, sKey\r
+ End If\r
+\r
+ 'return the object created\r
+ Set Add = objNewMember\r
+ Set objNewMember = Nothing\r
+End Function\r
+\r
+Public Property Get Item(vntIndexKey As Variant) As LayoutPropertyInfo\r
+Attribute Item.VB_UserMemId = 0\r
+ Set Item = mCol(vntIndexKey)\r
+End Property\r
+\r
+Public Property Get Count() As Long\r
+ Count = mCol.Count\r
+End Property\r
+\r
+Public Sub Remove(vntIndexKey As Variant)\r
+ mCol.Remove vntIndexKey\r
+End Sub\r
+\r
+Public Property Get NewEnum() As IUnknown\r
+Attribute NewEnum.VB_UserMemId = -4\r
+Attribute NewEnum.VB_MemberFlags = "40"\r
+ Set NewEnum = mCol.[_NewEnum]\r
+End Property\r
+\r
+Private Sub Class_Initialize()\r
+ Set mCol = New Collection\r
+End Sub\r
+\r
+Private Sub Class_Terminate()\r
+ Set mCol = Nothing\r
+End Sub\r
+\r
--- /dev/null
+VERSION 1.0 CLASS\r
+BEGIN\r
+ MultiUse = -1 'True\r
+ Persistable = 0 'NotPersistable\r
+ DataBindingBehavior = 0 'vbNone\r
+ DataSourceBehavior = 0 'vbNone\r
+ MTSTransactionMode = 0 'NotAnMTSObject\r
+END\r
+Attribute VB_Name = "LayoutPropertySet"\r
+Attribute VB_GlobalNameSpace = False\r
+Attribute VB_Creatable = True\r
+Attribute VB_PredeclaredId = False\r
+Attribute VB_Exposed = False\r
+Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"\r
+Attribute VB_Ext_KEY = "Collection" ,"LayoutProperty"\r
+Attribute VB_Ext_KEY = "Member0" ,"LayoutProperty"\r
+Attribute VB_Ext_KEY = "Top_Level" ,"Yes"\r
+'local variable to hold collection\r
+Private mCol As Collection\r
+\r
+'\r
+' Avoids duplicates. If only an update is done than is returns 'Nothing'; otherwise\r
+' returns the newly created LayoutProperty instance\r
+'\r
+Public Function Add(Scope As String, Value As String, PName As String) As LayoutProperty\r
+ \r
+ Dim objNewMember As LayoutProperty\r
+ \r
+ Set objNewMember = Item(PName, Scope)\r
+ If Not objNewMember Is Nothing Then\r
+ objNewMember.Value = Value\r
+ Set objNewMember = Nothing\r
+ Else\r
+ Set objNewMember = New LayoutProperty\r
+ \r
+ 'set the properties passed into the method\r
+ objNewMember.Scope = Scope\r
+ objNewMember.Value = Value\r
+ objNewMember.PName = PName\r
+\r
+ mCol.Add objNewMember, objNewMember.Id\r
+ End If\r
+ \r
+ 'return the object\r
+ Set Add = objNewMember\r
+ Set objNewMember = Nothing\r
+ \r
+End Function\r
+\r
+Public Property Get ItemByPos(Pos As Integer) As LayoutProperty\r
+ Set ItemByPos = mCol.Item(Pos)\r
+End Property\r
+\r
+Public Property Get Item(thePName As String, theScope As String) As LayoutProperty\r
+Attribute Item.VB_UserMemId = 0\r
+ Dim p As LayoutProperty\r
+ Dim i As Integer\r
+ \r
+ i = Pos(thePName, theScope)\r
+ If i = 0 Then\r
+ Set Item = Nothing\r
+ Else\r
+ Set Item = mCol(i)\r
+ End If\r
+ \r
+End Property\r
+'finds the position of a given property, returns 0 if not found\r
+Public Function Pos(thePName As String, theScope As String) As Integer\r
+ Dim i As Integer\r
+ Dim p As LayoutProperty\r
+ \r
+ For i = 1 To mCol.Count\r
+ Set p = mCol(i)\r
+ If p.PName = thePName And p.Scope = theScope Then\r
+ Pos = i\r
+ Exit Function\r
+ End If\r
+ Next i\r
+ \r
+ Pos = 0\r
+End Function\r
+\r
+Public Property Get Count() As Long\r
+ 'used when retrieving the number of elements in the\r
+ 'collection. Syntax: Debug.Print x.Count\r
+ Count = mCol.Count\r
+End Property\r
+\r
+Public Function Remove(PName As String, Scope As String) As LayoutProperty\r
+ Set Remove = Item(PName, Scope)\r
+ If Not Remove Is Nothing Then\r
+ mCol.Remove Remove.Id\r
+ End If\r
+End Function\r
+\r
+Public Function RemoveByPos(Pos As Integer) As LayoutProperty\r
+ Set RemoveByPos = mCol.Item(Pos)\r
+ If Not RemoveByPos Is Nothing Then\r
+ mCol.Remove RemoveByPos.Id\r
+ End If\r
+End Function\r
+\r
+Public Property Get NewEnum() As IUnknown\r
+Attribute NewEnum.VB_UserMemId = -4\r
+Attribute NewEnum.VB_MemberFlags = "40"\r
+ 'this property allows you to enumerate\r
+ 'this collection with the For...Each syntax\r
+ Set NewEnum = mCol.[_NewEnum]\r
+End Property\r
+\r
+\r
+Private Sub Class_Initialize()\r
+ 'creates the collection when this class is created\r
+ Set mCol = New Collection\r
+End Sub\r
+\r
+\r
+Private Sub Class_Terminate()\r
+ 'destroys collection when this class is terminated\r
+ Set mCol = Nothing\r
+End Sub\r
+\r
+Public Function ToString() As String\r
+ Dim p As LayoutProperty\r
+ For Each p In mCol\r
+ ToString = ToString & " " & p.ToString\r
+ Next p\r
+End Function\r
+\r
+Public Sub Clear()\r
+ While mCol.Count <> 0\r
+ mCol.Remove 1\r
+ Wend\r
+End Sub\r
+\r