Hi,
This is the call made when the Treeview, Alert dialog is made. Also the
tree view items that are made or called when adding to the tree.
Note: I can use up to 9 sub items for future wants for the program. Or 100 if
needed, or a power of 10 sub items.
Sub GetAlertMenu_Ini( dObj)
'Get Alert Settings.
Dim alerts
alerts = GetIniAlerts
'If there are alerts in the .ini file use them or use built in defaults.
If alerts <> "" Then TheUrlAlerts = alerts
Sleep 250
ResetTreeView dObj, myTreeName, "URL Alerts", 0
Set MyTreeRoot = dObj.Control( MyTreeName).Root
GetAllTreeLeaves MyTreeName, MyTreeRoot, MyLastTreeChild, dObj, Split(
TheUrlAlerts, vbCrLf)
Sleep 100
If myAlertDialog.Control( myTreeName).TopLevel.Item(1).Expanded Then
myAlertDialog.Control( myTreeName).TopLevel.Item(1).Expanded = False
Sleep 100
myAlertDialog.Control( myTreeName).TopLevel.Item(1).Selected = True
myAlertDialog.Control( myTreeName).TopLevel.Item(1).Children.Item(1).ScrollTo()
End Sub
Sub ResetTreeView( dObj, treeId, nodeName, nodeData)
'Reset programs Tree View level based on ID.
dObj.Control( treeId).Clear
Dim tvRoot
Set tvRoot = dObj.Control( treeId).NewItem
tvRoot.Text = nodeName
tvRoot.Data = nodeData
dObj.Control( treeId).TopLevel.Insert tvRoot, tviRoot
TreeCount = nodeData
End Sub
Sub GetAllTreeLeaves( treeName, lastNode, lastChild, dObj, dArray)
Dim urlArray
Dim tChild
For Each tChild In dArray
If tChild = "" Then Exit Sub
urlArray = Split( tChild, SplitChar)
GetSubNode treeName, lastNode, lastChild, dObj, urlArray, TreeCount
Next
End Sub
Sub GetSubNode( treeName, lastNode, tvNewChild, dObj, urlArray, tCount)
' Now create sub tree level with a name and data.
Dim i, tMax, tItemNum
Dim tvNewChildChildren
'Dim tSubLevel, tvNewChildChildrensChildren,
tvNewChildChildrensChildrensSibblings
tMax = UBound( urlArray) 'Link Name, URL, Search, Interval, and Heading search.
tCount = tCount + 10
GetChildNode treeName, lastNode, tvNewChild, dObj, urlArray(0), tCount
tItemNum = tCount
For i = 0 to tMax
tItemNum = tItemNum + 1
GetChildNode treeName, tvNewChild, tvNewChildChildren, dObj, urlArray(i),
tItemNum
'Below is if you had a third expansion level:
'GetChildNode treeName, tvNewChildChildren, tvNewChildChildrensChildren,
dObj, tChildName, tSubLevel
Next
End Sub
Sub GetChildNode( treeName, parentNode, tvINew, dObj, tvText, tvData)
Set tvINew = dObj.Control( treeName).NewItem()
tvText = Trim( tvText)
tvINew.Text = tvText '& tvData
tvINew.Data = tvData
If tvData Mod 10 = 5 Then
If LCase( tvText) = "true" Then tvINew.Checked = TvcChecked
If LCase( tvText) = "false" Then tvINew.Checked = TvcUnChecked
Else
tvINew.Checked = TvcNoCheck
End If
' Note below last node is parent and created is child.
parentNode.Children.Insert tvINew, tviLast
End Sub
---
This email is free from viruses and malware because avast! Antivirus protection
is active.
http://www.avast.com