Back to Devexpress

TdxGanttControlTaskPercentCompleteChangeEvent Type

vcl-dxganttcontrolviewchart-7d2c368c.md

latest2.3 KB
Original Source

TdxGanttControlTaskPercentCompleteChangeEvent Type

Performs a set of actions during a task‘s progress change with the mouse.

Declaration

delphi
TdxGanttControlTaskPercentCompleteChangeEvent = procedure(Sender: TObject; ATask: TdxGanttControlTask; ANewValue: Integer; var AAccept: Boolean) of object;

Parameters

NameTypeDescription
SenderTObject

The Chart View that raised the event.

| | ATask | TdxGanttControlTask |

The task whose progress a user is changing.

| | ANewValue | Integer |

The new value for ATask progress.

| | AAccept | Boolean |

Specifies if the event handler accepts or declines the task progress change.

|

Remarks

You can open the Features Demo and modify its code. Handle the OnPercentCompleteChange event and use the following code snippet that restricts users from decreasing the task progress percentage:

delphi
procedure TFeaturesDemoMainForm.GanttControlViewChartChangePercentComplete(Sender: TObject; ATask: TdxGanttControlTask; ANewValue: Integer; var AAccept: Boolean);
begin
  AAccept := ATask.PercentComplete < ANewValue;
end;
cpp
void __fastcall TFeaturesDemoMainForm::GanttControlViewChartPercentCompleteChange(TObject *Sender,
          TdxGanttControlTask *ATask, int ANewValue, bool &AAccept)
{
  AAccept = ATask->PercentComplete < ANewValue;
}

See Also

TdxGanttControlTaskPercentCompleteStartChangeEvent

TdxGanttControlTaskPercentCompleteEndChangeEvent

dxGanttControlViewChart Unit