The TssResourceAllocationChart uses four classes to represent various components:
- TssResourceAllocationChart: represents the whole chart.
- TssResource: represents a single resource that can be allocated.
- TssResourceAllocation: represents a single allocation of a single resource.
- TssResourceAllocationChartAppearance: properties the control the appearance of the chart.
- Various types used by the chart.
|A reference to any TObject that you like. The AnyObject property is provided for the convenience of storing additional information for special needs in an application. If the OwnsAnyObject property is true, the object will be freed when the resource is destroyed.|
|Allocations||[indx: integer]: TssResourceAllocation|
|An array giving access to the allocations for the resource.|
|The default colour for allocations of this resource.|
|The number of allocations for this resource.|
|The rectangle used to display allocations for this resource.|
|The name of the resource.|
|Whether the object referenced by the AnyObject property is owned by this resource. If the object is owned, it is freed when the resource is destroyed.|
|The chart this resource belongs to.|
|The default display style for allocations of this resource.|
|Tag has no predefined meaning. The Tag property is provided for the convenience of storing additional integer value or pointer information for special needs in an application.|
|AddSlot||(StartAt, EndAt: TDateTime): TssResourceAllocation|
|Adds a new allocation slot between the times specified.|
|Starts buffering updates. One call to EndUpdate should be called for each call to BeginUpdate.|
|Deletes all allocations for this resource.|
|Stops buffering updates. One call to EndUpdate should be called for each call to BeginUpdate.|
|FindFreeSlot||(MinDateTime, MaxDateTime, Span: TDateTime; Increment: TDateTime = -1): TDateTime|
|Finds the first free slot with the specified span, between the two date/times.|
|FindSlotAt||(DateTime: TDateTime): TssResourceAllocation|
|Returns the allocation at a particular time, or nil if none.|
|FindSlotFromPoint||(point: TPoint): TssResourceAllocation|
|Finds the allocation displayed at the specified position. Returns nil if none.|
|IndexOf||(Slot: TssResourceAllocation): integer|
|Returns the index of a particular allocation, or -1 if the allocation is not found.|
|IsSlotFree||(StartAt, EndAt: TDateTime; IgnoreSlot: TssResourceAllocation = nil): boolean|
|Determines whether a particular allocation slot is free. Can optionally ignore an allocation when checking.|
|Sorts the allocations into increasing date/time order.|
To delete a TssResource, simply call its Free method. This will automatically delete it from the TssResourceAllocationChart.