![]() ![]() ![]() ![]() Gravitybox Schedule Primer
Page 112
1998-2004 Gravitybox Software LLC
be displayed, with an appointment. If a schedule has more than one category type, the
Categories collection of the schedule will not provide enough functionality. Categories
may be added to the ScheduleItems Categories collection. These would be category
names. These categories would be assigned to an appointment using the Categories
collection of each ScheduleItem.
This allows for as many categories as needed. A color-coded bar will not be displayed
on each appointment for these categories. There could potentially be many of them and
there is no room on an appointment for an arbitrary number of bars. The bars however
will show up on the left margin of the schedule. This is accomplished by using the
AllowOtherCategories property. Set this property to true and all of the user-defined
categories will be displayed in the left margin of the schedule.
The following code adds two custom categories. The first is a Shoe category and it
has three items in it. The second is a Music category. It also has three items in it.
Dim oCategory As CCategoryCol
'Add a category
Set oCategory =
Schedule1.ScheduleItems.Categories.Add("Shoes")
'Add its items
Call oCategory.Add("Nike", vbBlue)
Call oCategory.Add("Doc Martin", vbYellow)
Call oCategory.Add("Addidas", vbRed)
'Add a category
Set oCategory =
Schedule1.ScheduleItems.Categories.Add("Music")
'Add its items
Call oCategory.Add("Classical", vbBlue)
Call oCategory.Add("Rock", vbYellow)
Call oCategory.Add("New Age", vbRed)
Set oCategory = Nothing
This would setup the category information. Now some values may be assigned to the
ScheduleItems.
'Set the category values for the Appointment 1
Schedule1.ScheduleItems(1).Categories(1).Name = "Nike"
Schedule1.ScheduleItems(1).Categories(2).Name = "New Age"
'Set the category values for the Appointment 2
Schedule1.ScheduleItems(1).Categories(1).Name = "Addidas"
Schedule1.ScheduleItems(1).Categories(2).Name = "Rock"
|