![]() ![]() ![]() ![]() Gravitybox Schedule Primer
Page 153
1998-2004 Gravitybox Software LLC
Notes
We will start by adding notes, since this is the simplest thing to do. A note object is
exactly what it sounds like, apiece of text. The notes form is an MDI child and loads the
notes from the API when the form loads.
Private Sub Form_Load()
Dim oNote As CNoteEl
frmMDI.mnuNote.Visible = True
Call frmMDI.SetStatus(oNotes.Count & " Items")
Call oNotes.Load(ThisUser)
For Each oNote In oNotes
Call lvwNote.ListItems.Add(, oNote.UniqueKey, _
oNote.Text, "Note")
Next
End Sub
The code above uses the object ThisUser to load the oNotes object. It then loops
through the collection of notes and inserts each into the notes ListView. When the user
selects a displayed note on the screen by double-clicking or pressing <Enter>, a note
property window will appear that allows the user to modify the note text. After the user
modifies the text, he may press the windows close button. In the QueryUnload event
the text boxs value will be used to set the note objects text value. This will ensure that
the next time the notes collection is saved this value will be committed to file.
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As
Integer)
Note.Text = txtNote.Text
End Sub
This is essentially the entire functionality of the notes portion.
Contacts
The next part of the program is to manage contacts. This is only a little more
complicated than the notes. A note has one field, Text that defines an object. A contact
object has many fields. A contact is defined a set of information that describes a person.
|