[Back to
Using the object-oriented features of LotusScript
]
The EnhancedUIDoc class
Class EnhancedUIDoc
Private m_uidoc As NotesUIDocument
Private m_uiw As NotesUIWorkspace
Private m_origvalues As BetterList
Private m_doctype As String
Sub ProcessPostopen( Source As NotesUIDocument )
Dim doc As NotesDocument
Dim ltm As ListItem
Print ("EnhancedUIDoc - ProcessPostopen")
Set doc = m_uidoc.document
Forall i In doc.Items
Set ltm = New ListItem( i.Name, i.Values(0) )
Call m_origvalues.AddItem(i.Name, ltm)
End Forall
End Sub
Sub ProcessQuerysave(Source As Notesuidocument, Continue As Variant)
Dim doc As NotesDocument
Dim ltm As ListItem
Dim rval As Integer
Dim v As Variant
Print ("EnhancedUIDoc - ProcessQuerysave")
rval = continue
Set doc = m_uidoc.document
Forall i In doc.Items
Set v = m_origvalues.GetItem(i.Name)
If (Not Isnull(v) ) Then 'make sure there's an item to compare it to
Set ltm = v
If i.Values(0) <> ltm.value Then
Print "Item " & i.Name & " new value = " & i.Values(0)
rval = True
Else
Print "Item " & i.Name & " not changed."
End If
Else
Print "Item " & i.Name & " not found."
End If
End Forall
Continue = rval
End Sub
Sub new (uid As NotesUIDocument)
Print ("EnhancedUIDoc - sub new")
Set m_uiw = g_wks
Set m_origvalues = New BetterList
Set m_uidoc = uid
On Event Querysave From m_uidoc Call ProcessQuerysave
On Event Postopen From m_uidoc Call ProcessPostopen
End Sub
Sub Postopen(Source As Notesuidocument)
End Sub
Sub Querysave(Source As Notesuidocument, Continue As Variant)
End Sub
End Class