![]() ![]() ![]() ![]() Gravitybox Schedule Primer
Page 43
1998-2004 Gravitybox Software LLC
If you wish to build your own property screen, you will probably need to cancel the
default property screen. The following code illustrates the actions that should be
performed if a custom property box is to be used. In the BeforeEdit event, the Cancel
parameter must be set to true. This will cancel the default edit. A custom property box
may then be shown from this event. The following code displays an example of how to
display a custom property box. The form frmProperty is a customized screen that has
been built to display an appointments properties as deemed fit.
Private Sub Schedule1_AfterEdit(ByVal Index As Long)
Cancel = True
Load frmProperty
frmProperty.ScheduleIndex = Index
frmProperty.Show vbModal
End Sub
It is also possible to modify the ScheduleItems DisplayText property without using a
property box. If the schedules AllowInPlaceEdit property is true, the user may make the
display portion of an appointment editable by single clicking the mouse on an
appointment. This will start an edit sequence whereby the user may edit the text
displayed on the appointment. The BeforeEditText event will be raised before the text
area becomes editable. This event has a Boolean Cancel parameter and the
ScheduleItems index. A successful edit is achieved when the user clicks off of the
appointment or it loses focus. If the <ESCAPE> key is pressed, the edit is canceled and
the property value is not modified. Upon a successful edit, the AfterEditText event is
raised to confirm that the edit was successful.
Deleting
The user may remove an appointment from a schedule (and
from the ScheduleItems collection) by moving the mouse
over the appointment and pressing the <DELETE> key.
This assumes the schedule property AllowDelete is true. The user will be prompted to
remove the appointment. The default remove text may be overridden. The verbiage or
even the language may be changed, if need be. There is a prompt text parameter sent
in to the BeforeDelete event. If the default text is to be changed, set this string to the
desired text here.
Private Sub Schedule1_BeforeDelete(ByVal Index As Long, _
sPrompt As String, Cancel As Boolean)
sPrompt = "Are you sure that you wish to remove & _
the selected appointment?"
End Sub
Before deleting an appointment the BeforeDelete event is raised and will allow for the
cancellation of the operation. Upon completion of the delete operation, the AfterDelete
Quick Tip
To remove an appointment, move the
mouse over the appointment and
pres the <DELETE> key.
|