Back to Devexpress

TdxGanttControlTaskResizeEvent Type

vcl-dxganttcontrolviewchart-8b46b62a.md

latest2.1 KB
Original Source

TdxGanttControlTaskResizeEvent Type

Performs a set of actions during a task size change with the mouse.

Declaration

delphi
TdxGanttControlTaskResizeEvent = procedure(Sender: TObject; ATask: TdxGanttControlTask; ANewFinish: TDateTime; var AAccept: Boolean) of object;

Parameters

NameTypeDescription
SenderTObject

The Chart View that raised the event.

| | ATask | TdxGanttControlTask |

A task that a user resizes.

| | ANewFinish | TDateTime |

ATask‘s new finish date.

| | AAccept | Boolean |

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

|

Remarks

You can open the Features Demo and modify its code. Handle the OnTaskResize event and use the following code snippet that prevents users from decreasing a task duration to zero days:

delphi
procedure TFeaturesDemoMainForm.GanttControlViewChartTaskResize(Sender: TObject; ATask: TdxGanttControlTask; ANewFinish: TDateTime; var AAccept: Boolean);
begin
  AAccept := ANewFinish - ATask.Start > 0;
end;
cpp
void __fastcall TFeaturesDemoMainForm::GanttControlViewChartTaskResize(TObject *Sender, TdxGanttControlTask *ATask,
          TDateTime ANewFinish, bool &AAccept)
{
  AAccept = (ANewFinish - ATask.Start) > static_cast<TDateTime>(0);
}

See Also

TdxGanttControlTaskStartResizeEvent

TdxGanttControlTaskEndResizeEvent

dxGanttControlViewChart Unit