Navigation bar
  Home Print document Start Previous page
 43 of 234 
Next page End  

Gravitybox Schedule Primer
Page 41 
1998-2004 Gravitybox Software LLC
The AfterAdd event is raised after an item has been added to the ScheduleItems
collection. The event will have the new appointment’s index as its parameter. You may
display your custom dialog box by using this event if it is more appropriate. Make sure
that the AllowAddDialog property to false. This will ensure that the default dialog is not
displayed at all. The AfterAdd event has the index of the newly added ScheduleItem. So
you may create a custom property box and use it to modify the properties of the object
specified by the index parameter. The BeforeEdit and AfterEdit events will be raised as
well, if the default property box is used. The reason the edit events are called is that
after the Add, the operation is a normal edit. So the default behavior for adding an
appointment is BeforeAdd, AfterAdd, BeforeEdit, and AfterEdit.
Moving
A move is defined as changing the StartTime, Date, or Room property of a
ScheduleItem, by dragging it, with the mouse. After an appointment is created, the user
may move the appointment to any other part of the schedule (except NoDrop zones),
with the mouse. This assumes the schedule property AllowMove is set to true, since no
user-initiated moves may occur if this property is false. Also the appointment’s
ReadOnly property may not be true, since moving it would change its position. This
section does not refer to the action taken when using the property box or setting an
appointment’s properties in code. These actions are considered edits. When using a
property box, the events BeforeEdit and AfterEdit are raised. The following refers to the
event sequence when dragging an appointment, with the mouse.
During a move, there are a number of events that come into play. The first event that is
raised is the BeforeDrag event. This occurs to inform you that the user is dragging an
appointment. A Cancel parameter is provided so that the operation may be canceled if
necessary. There is also a drop operation parameter that will inform you as to whether
the operation is a copy or a move. The DragOverScheduleItem event is raised every
time the mouse moves while dragging an appointment. The DragDropScheduleItem
event is finally raised to inform that something was dropped on the schedule (perhaps
not even an appointment).
The next event in sequence is the BeforeMove event. This
event is raised so that any code that needs to be executed,
before a move, is performed. An interesting parameter in
the BeforeMove event is DoPrompt. This is a Boolean value that determines whether
the user will be prompted for a move confirmation. The default value is true, but this
property may be set to false and the appointment will be moved, with no questions
asked. Also the schedule property ConflictWarn allows for the determination of whether
the user is to be prompted about conflicts. When moving an appointment, there is the
possibility that a conflict may occur. If a conflict does occur because of this move and
ConflictWarn is true, the user is prompted by a confirmation dialog to ensure that a
conflict is indeed wanted at this position. If ConflictWarn is false then the appointment
will be moved and a conflict will occur, with no warning to the user.
Quick Tip
To turn off the move prompt, set the
“DoPrompt” parameter in the
BeforeMove event to False.
http://www.purepage.com