![]() ![]() ![]() ![]() Gravitybox Schedule Primer
Page 125
1998-2004 Gravitybox Software LLC
Set oTask = TaskList1.Tasks.Add
oTask.TaskItems(1).Text = "My Subject"
oTask.TaskItems(2).Text = "12/31/2002"
oTask.TaskItems(3).Text = "11:00 AM"
oTask.TaskItems(4).Text = "60"
Set oTask = Nothing
As you can see, we did not add any TaskItems, we just edited the existing ones. In fact
you cannot add any of these objects since the collection has not add method. The
control is also drag-drop enabled and may accept appointments from the Schedule
control. This process if not automatic. When a ScheduleItem is dropped on the TaskList,
the TaskLists DragDropScheduleItem event is raised. Code may be placed here that
will add the dropped item to the TaskList. This is necessary because the TaskList does
not have any predefined columns. The developer adds all columns and there is no
guarantee that there will be a Date, Time, or Room column present when the
appointment is dropped. In addition the dropped appointment does not know which of its
properties map to which column. For instance in Germany, the ScheduleItems Room
property will not map to a Room column since the developer will not use the English
word Room. For these reasons the developer must add code to map the
appointments properties to the appropriate columns.
Private Sub TaskList1_DragDropScheduleItem(ByVal ScheduleItem
As Scheduler.CScheduleEl)
Dim oTask As CTaskEl
Set oTask = TaskList1.Tasks.Add
oTask.TaskItems(1).Text = ScheduleItem.Subject
oTask.TaskItems(2).Text = ScheduleItem.StartDate
oTask.TaskItems(3).Text = ScheduleItem.StartTime
oTask.TaskItems(4).Text = ScheduleItem.Length
Set oTask = Nothing
End Sub
This code is executed when a ScheduleItem is dropped on a TaskList. This TaskList
has four columns that we added earlier. Therefore each Task will already have 4
TaskItems present. The code maps column 1 to the Subject property, column 2 to
StartDate, column 3 to StartTime, and column 4 to the Length property. After this event,
the control will append a Task with the appointments information.
Table 13.3
TaskList Control Properties
AddText
The text that is displayed in the add portion of the
control when it does not have focus. This should be
an instruction on what is the defined area.
|