![]() ![]() ![]() ![]() Gravitybox Schedule Primer
Page 157
1998-2004 Gravitybox Software LLC
The TaskList has a checked column. This corresponds to the tasks PercentComplete
property. It may have a value of 0 to 100. If the value is equal to 100, the checkbox is
marked to indicate that the task is complete. If the user clicks the check box, the
PercentComplete property value is automatically set to 100, not matter its previous
value. As the user pressed the up, down, left, and right keys the selected row and
column will change. In Figure 16.4, the second row is selected. In it the second column
is selected as well. The user may press the <F2> at any time to edit the selected cell.
Cells may have different property types as well. The valid values for cell types are date,
time, text, and noedit. The date and time will verify that the user only enters valid dates
and times. The text value is a catchall. Any value is a valid string. The noedit value is
used when you do not wish to allow the user to edit the cell.
Loading the TaskList is a bit complicated. Because it is a general-purpose control, there
are no predefined columns. Before you may load any data, you will need to load the
columns. The control has a columns collection and may be loaded as follows.
Call TaskList1.Columns.Clear
Call TaskList1.Columns.Add("Date", ctDate)
Call TaskList1.Columns.Add("Start Time", ctTime)
Call TaskList1.Columns.Add("Subject", ctText)
Call TaskList1.Columns.Add("Notes", ctText)
This code will clear any columns that exist. It will then add four columns with their
appropriate types. After this addition there will be four columns displayed on the
TaskList. We may then start to add data items.
The first thing you will notice when adding data items is that you do not specify any
data! There is a reason for this. Since there are no predefined columns there can be no
properties associated with these non-existent columns. You must append a data object
to the collection and then set its sub-items. Since there are 4 columns, we each Task
will have a TaskItems collection with 4 items in it.
Dim oTask As CTaskEl
Set oTask = TaskList1.Tasks.Add
oTask.TaskItems(1).Text = "12/31/2002"
oTask.TaskItems(2).Text = "11:00 AM"
oTask.TaskItems(3).Text = "My Subject"
oTask.TaskItems(4).Text = "Some Notes"
Set oTask = Nothing
We can use this object hierarchy to load and save. The OrgranizeAPI has a Tasks
collection. This may be loaded as the notes and contacts collection objects were
previously.
|