Skip to main content

TdxGanttControlTaskStartCreateEvent Type

Performs a set of actions before a user drags and drops the mouse to create a task.

Declaration

TdxGanttControlTaskStartCreateEvent = procedure(Sender: TObject; AID: Integer; AStart: TDateTime; var AAllow: Boolean) of object;

Parameters

Name Type Description
Sender TObject

The Chart View that raised the event.

AID Integer

The task’s unique identifier.

AStart TDateTime

The task’s start date.

AAllow Boolean

If True, a user can drag the mouse pointer in the chart (while holding the left mouse button) to create a task. If False, the operation is prohibited.

Remarks

You can open the Features Demo and modify its code. Handle the OnTaskStartCreate event and use the following code snippet to restrict users from creating tasks that occur before the project’s start date:

procedure TFeaturesDemoMainForm.GanttControlViewChartTaskStartCreate(Sender: TObject;
  AID: Integer; AStart: TDateTime; var AAllow: Boolean);
begin
  AAllow := AStart > GanttControl.DataModel.RealProjectStart;
end;
See Also