Back to Devexpress

TdxGanttControlChartViewGetLinkColorEvent Type

vcl-dxganttcontrolviewchart-ede214ef.md

latest2.9 KB
Original Source

TdxGanttControlChartViewGetLinkColorEvent Type

The color-related procedural type for task dependencies in the Chart View.

Declaration

delphi
TdxGanttControlChartViewGetLinkColorEvent = procedure(Sender: TdxGanttControlChartView; ALink: TdxGanttControlTaskPredecessorLink; var AColor: TColor) of object;

Parameters

NameTypeDescription
SenderTdxGanttControlChartView

The Chart View that raised the event.

| | ALink | TdxGanttControlTaskPredecessorLink |

The dependency whose color is about to be changed.

| | AColor | TColor |

A system palette color.

|

Remarks

A dependency is filled with the same color as its predecessor task. The following code example makes the dependency between the first and second tasks yellow (clYellow):

delphi
procedure TMyForm.FormCreate(Sender: TObject);
begin
  // Loads a chart from the specified XML file
  dxGanttControl1.LoadFromFile('C:\Users\Public\Documents\DevExpress VCL Demos\MegaDemos\Product Demos\ExpressGanttControl\Data\SoftwareDevelopment.xml');
end;

procedure TMyForm.dxGanttControl1ViewChartGetLinkColor(
begin
  // Checks if the dependency links the first and second tasks
  if (ALink.PredecessorUID = 2) and (ALink.Task.UID = 3) then
    // Fills the dependency with the yellow color
    AColor := clYellow;
end;
cpp
void __fastcall TMyForm::FormCreate(TObject *Sender)
{ // Loads a chart from the specified XML file
  dxGanttControl1->LoadFromFile("C:/Users/Public/Documents/DevExpress VCL Demos/MegaDemos/Product Demos/ExpressGanttControl/Data/SoftwareDevelopment.xml");
}
//---------------------------------------------------------------------------
void __fastcall TMyForm::dxGanttControl1ViewChartGetLinkColor(TdxGanttControlChartView *Sender,
          TdxGanttControlTaskPredecessorLink *ALink, TColor &AColor)
{
  // Checks if the dependency links the first and second tasks
  if (ALink->PredecessorUID == 2 && ALink->Task->UID == 3)
  {
    // Fills the dependency with the yellow color   
    AColor = clYellow;
  }
}

See Also

OnGetLinkColor

OnGetTaskColor

TdxGanttControlTimelineView.OnGetTaskColor

dxGanttControlViewChart Unit