![]() ![]() ![]() ![]() Gravitybox Schedule Primer
Page 44
1998-2004 Gravitybox Software LLC
event is raised to inform that the delete operation was completed successfully. The
event will have the appointments old index in the ScheduleItems collections as a
parameter. Do not try to reference this appointment at this point. It has been removed. If
this index exists, it is the appointment that was next in sequence in the ScheduleItems
collection.
Resizing
You may set the size of an appointment in code but this is
rather prohibitive in the real world. When a schedule is
displayed, the user may be allowed to resize an
appointment. He may do this by moving the mouse over the borders of the appointment
then clicking and dragging the desired length. If resizing is allowed, the mouse pointer
will turn to an arrow, either North-South or East-West, depending on which is
appropriate. The pointer will change when the mouse is over the border of the
appointment, not in its interior. Keep in mind that the schedules AllowResize property
must be true for any resizing to be done at all.
There AllowItemResizing property selectively allows resizing of all non-read-only
appointments. The possible values of the property are as follows: ircNone,
ircBottomRight, ircTopLeft, or ircAll. The value will determine how much functionality is
allowed. If this property is set to ircNone, no user resizing will be allowed. If it is set to
ircBottomRight, the appointments length may be modified. Depending on the
Viewmode property, dragging the right or bottom appointment edge may modify the
length. If the value is ircTopLeft, only StartTime is editable. Again, depending on the
Viewmode, the StartTime may be modified, by dragging the top or left appointment
edge. Lastly, by using the ircAll value, the StartTime and Length of the appointment
may be modified. Essentially this says that both edges of the appointment may be
resized. This property affects all appointments.
Length modification only
Schedule1.AllowItemResizing = ircBottomRight
There is additional functionality for an appointment that may
be used. Every appointment has two properties that control
resizing: MinLength and MaxLength. When the user creates
an appointment these values are set to their default value of (1). This indicates that the
appointment has no restrictions on its size. You have the option of setting these values
to restrict the user from breaking any business rules that have been defined in your
application. If the MinLength is non-zero, the user may not resize the appointment
smaller than this value. Conversely, if the MaxLength is non-zero, the user may not
resize the appointment larger than this value.
'No smaller than 30 minutes
Schedule1.ScheduleItems(3).MinLength = 30
'No larger than 2 hours
Quick Tip
To resize an appointment, drag one
of its resizable edges to the newly
desired position.
Quick Tip
Bound an appointments size by
using its MinLength and MaxLength
properties.
|