How to add an allocation when the user right-clicks on the chart.

Use something like this.

procedure TForm1.RACRightClick(Sender: TObject);
  resource: TssResource;
  slot: TssResourceAllocation;
  pt: TPoint;
  StartAt, EndAt: TDateTime;
  // convert the mouse position to local co-ordinates
  pt := RAC.ScreenToClient(Mouse.CursorPos);
  // find the nearest resource
  resource := RAC.FindResourceFromY(pt.y);
  if Assigned(resource) then begin
    // find the date/time equivalent to where the user clicked
    StartAt := RAC.XToDateTime(pt.x);
    // make the allocation 2 hours long by default,
    // centered on the click
    StartAt := StartAt - EncodeTime(1,0,0,0);
    EndAt := StartAt + EncodeTime(1,0,0,0);
    // if this slot is available then add a new allocation
    if resource.IsSlotFree(StartAt, EndAt) then
      slot := resource.AddSlot(StartAt, EndAt)
What People Say

... The conclusion cannot be an other one than to state that if you are looking for a planning component you have to get the RAC. For your future planning business it is simply a must.
H. de Boer, Staaf Automatisering (see the full case study)
More …

No malware No spam
McAfee Site Report
Web of Trust