![]() ![]() ![]() ![]() Gravitybox Schedule Primer
Page 162
1998-2004 Gravitybox Software LLC
Dim F As frmAppointmentDue
Set F = New frmAppointmentDue
Set F.ScreenAppt = oScheduleItem
Set F.Appointment = Appointments.GetObject( _
oScheduleItem.UniqueKey, osTag)
Call F.Show
Set F = Nothing
End Sub
You may be wondering what happens if you remove an appointment that has its
property box displayed. Since they are non-modal this is a very real situation. In the
schedules AfterDelete event, a search is performed to determine if an appointment
property box exists for the removed appointment. Since every appointment has a
unique identifier, a routine may be constructed that loops and searches for the
UniqueKey property. If found, the window is unloaded.
Private Sub UnloadAppointmentDialog(ByVal sUniqueKey As String)
Dim oForm As Form
For Each oForm In Forms
If StrComp(oForm.Name, "frmApptProperties", vbTextCompare)
= 0 Then
If StrComp(oForm.ScreenAppt.UniqueKey, sUniqueKey, _
vbTextCompare) = 0 Then
Unload oForm
End If
End If
Next
End Sub
This concludes the example. Of course the creation of a full-fledged program is more
complicated than what I have described. I do not find it necessary to fill volumes with
source code that you are neither going to read. All of the code is available on-line and in
digital format so that you may actually compile and use it. There are many supporting
routines and an API that are used in the GbOrganize example. In its current incarnation
there are about 8500 lines of code. This is not much considering that all of the
functionality that it provides. Since the entire source is provided for the example, you
may feel free to extend it and add any useful functionality that you may dream-up.
|