Back to Devexpress

TdxGanttControlTaskLinkEvent Type

vcl-dxganttcontrolviewchart-1b660bb1.md

latest2.3 KB
Original Source

TdxGanttControlTaskLinkEvent Type

Performs a set of actions during a task dependency create operation (with the mouse) in the chart.

Declaration

delphi
TdxGanttControlTaskLinkEvent = procedure(Sender: TObject; ATask: TdxGanttControlTask; ALinkedTask: TdxGanttControlTask; var AAccept: Boolean) of object;

Parameters

NameTypeDescription
SenderTObject

The Chart View that raised the event.

| | ATask | TdxGanttControlTask |

The predecessor task for ALinkedTask.

| | ALinkedTask | TdxGanttControlTask |

The ATask‘s successor task.

| | AAccept | Boolean |

Specifies if the event handler accepts or declines a dependency create operation in response to a mouse drag-and-drop action.

|

Remarks

You can open the Features Demo and modify its code. Handle the OnTaskLink event and use the following code snippet to allow a user to link a task with any task except for a summary task:

delphi
procedure TFeaturesDemoMainForm.GanttControlViewChartTaskLink(Sender: TObject; ATask,
  ALinkedTask: TdxGanttControlTask; var AAccept: Boolean);
begin
  AAccept := not ALinkedTask.Summary;
end;
cpp
void __fastcall TFeaturesDemoMainForm::GanttControlViewChartTaskLink(TObject *Sender,
          TdxGanttControlTask *ATask, TdxGanttControlTask *ALinkedTask, bool &AAccept)
{
  AAccept = !(ALinkedTask->Summary);
}

See Also

TdxGanttControlTaskStartLinkEvent

TdxGanttControlTaskEndLinkEvent

dxGanttControlViewChart Unit