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

Gravitybox Schedule Primer
Page 124 
1998-2004 Gravitybox Software LLC
collection is returned as a parameter to the event. If the index is zero, the “Unassigned”
row was clicked, which is not a real provider. Other parameters to the event are “Button”
and “Shift”, which allow you to know the mouse button clicked and whether the <ALT>,
<CTRL>, or <SHIFT> key was pressed at the time of the click.
TaskList Control
The TaskList control may be used to list a number of tasks
for the user. The columns are configurable. Any number of
columns may be added with any of the following types:
Date, Text, Time, and NoEdit. These are self-explanatory except for the NoEdit. This
setting will display the text but will not allow the user to modify its contents. The top
portion of the control may be used to add new tasks to the list. This may be toggled
on/off depending on the application’s specific needs. Each Task may be checked or
unchecked in the second column. The checked tasks have their PercentComplete
property set to 100%. When unchecked, this property may be any whole number from 0
to 99. This allows users to assign completion percents to each task if desired. 
 
Figure 13.4
 
The TaskList control starts with no columns. Any needed
columns must be added manually. This allows the control to
be totally configured by the developer’s desires. The
following code will clear any columns that are already present and add four new
columns. Each column has its own data type.
Call TaskList1.Columns.Clear 
Call TaskList1.Columns.Add("Subject", ctText, , True)
Call TaskList1.Columns.Add("Date", ctDate, , True)
Call TaskList1.Columns.Add("Time", ctTime, , True)
Call TaskList1.Columns.Add("Length", ctText, , True)
 
  When columns as added or removed, each Task of the TaskItems collection is
modified to have the same number of elements as the Columns collection. This ensures
that each Task will have the same number of TaskItems as columns are present. The
TaskItems collection is used to set the value that is to be displayed in the appropriate
column of the control. The code below adds a new Task. Since there exists 4 columns
on the control now, there are exactly 4 TaskItems for each Task object. So we set the
appropriate values for each TaskItem. 
Quick Tip
Add MS-Outlook type tasks to an
application with the Tasks control
Quick Tip
You must add columns first before
you can add task items.
http://www.purepage.com