DeveloperReference 3
DeveloperReference 3
04/07/2017
Version 1.2
Inhalt
Component Overview ..................................................................................................................................... 4
Abstract ....................................................................................................................................................... 4
Code-compatibility with the previous version ............................................................................................ 4
Supported Delphi versions .......................................................................................................................... 4
Installation ....................................................................................................................................................... 4
Automatic Installation (recommended) ...................................................................................................... 4
Manual Installation ...................................................................................................................................... 4
Quick Start ....................................................................................................................................................... 5
Gantt Chart ...................................................................................................................................................... 7
Overview...................................................................................................................................................... 7
Rows (TGanttRow) ....................................................................................................................................... 8
Accessing Rows ........................................................................................................................................ 8
Properties ................................................................................................................................................ 9
Methods / Functions.............................................................................................................................. 10
Adding / removing rows ........................................................................................................................ 12
Hierarchical structuring of rows ............................................................................................................ 13
Columns (TGanttColumn) .......................................................................................................................... 13
Predefined column types ....................................................................................................................... 14
User defined column types .................................................................................................................... 14
Adding, deleting columns at runtime .................................................................................................... 14
Properties .............................................................................................................................................. 16
Column type editors .............................................................................................................................. 18
IndicatorColumn (TGanttIndicatorColumn)............................................................................................... 23
Properties .............................................................................................................................................. 23
Time scales (TGanttTimeScales) ................................................................................................................ 24
Accessing time scales............................................................................................................................. 25
Properties .............................................................................................................................................. 25
DateLines (TGanttDateLines) ..................................................................................................................... 27
Accessing date lines ............................................................................................................................... 27
Properties .............................................................................................................................................. 27
Bars (TGanttBar) ........................................................................................................................................ 28
Accessing bar objects............................................................................................................................. 29
Adding, Deleting bars............................................................................................................................. 30
Task bars (TGanttTaskBar) ......................................................................................................................... 31
Gantt Control Component Developer Reference 2
Weise Software GmbH
Properties .............................................................................................................................................. 31
Progress bars (TGanttProgressBar) ........................................................................................................... 36
Properties .............................................................................................................................................. 36
Milestone bars (TGanttMileStoneBar) ...................................................................................................... 38
Properties .............................................................................................................................................. 38
Image bars (TGanttImageBar) ................................................................................................................... 40
Properties .............................................................................................................................................. 40
Text bars (TGanttTextBar) ......................................................................................................................... 42
Properties .............................................................................................................................................. 42
Shadowbars (TGanttShadowTaskBar, TGanttShadowProgressBar) .......................................................... 44
Properties .............................................................................................................................................. 44
SummaryBar (TGanttSummaryBar) .......................................................................................................... 46
Properties .............................................................................................................................................. 46
Selection (TGanttSelection) ....................................................................................................................... 48
Options Selection (TGanttOptionsSelection) ......................................................................................... 51
Undo (TGanttUndoRedoStack) .................................................................................................................. 51
GanttChartView (TGanttChartView) .......................................................................................................... 52
OptionsBehaviour (TGanttOptionsBehaviour) .......................................................................................... 54
OptionsSchedule (TGanttOptionsSchedule) .............................................................................................. 55
OptionsView (TGanttOptionsView) ........................................................................................................... 56
Calendar (TGanttCalendar) ........................................................................................................................ 57
DayExceptions (TDayException) ................................................................................................................ 59
Properties and Methods ........................................................................................................................ 59
WeekException (TWeekException) ........................................................................................................... 59
Properties and Methods ........................................................................................................................ 59
MonthExceptions (TMonthException) ...................................................................................................... 60
Properties and Methods ........................................................................................................................ 60
YearException (TYearException)................................................................................................................ 61
Properties and Methods ........................................................................................................................ 61
RecurringException (TRecurringException) ............................................................................................... 62
Properties and Methods ........................................................................................................................ 63
DateCategorie(TDateCategory) ................................................................................................................. 64
Properties and Methods ........................................................................................................................ 64
Calendar (TGanttCalendar) ........................................................................................................................ 65
Properties and Methods ........................................................................................................................ 65
RowCalendarRepository:TGanttCalendarRepository ................................................................................ 67
Gantt Control Component Developer Reference 3
Weise Software GmbH
Component Overview
Abstract
The GanttChart is an interactive non database aware front-end VCL component for Delphi that visualises tasks in a
gantt chart. The component may be used to schedule a number of resources and tasks and can be used in several
project scenarios such as project management, task management, production scheduling or employee scheduling.
The component includes a pert chart view, a print preview component and some minor visual editor components
for different data types.
The component does not provide an isolated non visual DataSource component (WGSDataSource) anymore – its
functionality is included in the internal DataController object. Furthermore, the component provides access to a
single row object now and does not implement two different row object types for the tree and the table.
The component supports the VCL framework and may be used for the 32bit or 64bit Windows platform.
Installation
Manual Installation
Please make sure that the component is not already installed in your Delphi environment and remove it before you
manually install it.
Gantt Control Component Developer Reference 5
Weise Software GmbH
1. Open the run-time package according to your Delphi Version and compile it.
2. Open the design-time package according to your Delphi Version compile it and install it.
3. Add the /lib and /source subdirectories to your Delphi library search path. In the Tools Menu |Options |
Environment Options | Library | Library Path add the /lib and /source paths.
Quick Start
In this chapter we will show the very basic steps to create a small sample application that demonstrate the usage
of the component.
In Delphi, please create a new VCL project and place a TGanttChart component in your form. You will find
the TGanttChart component in the Gantt Suite 3 section of the Tool-palette.
Select the newly placed TGanttChart component and select alClient for the Align property that you will find
in the object inspector (F11).
Compile and run (F9) the application
After you have accomplished the steps you should see a basic application that contains the gantt chart component.
The component does already have a column named ‘Nr’ and a single time scale that displays the days of the week.
However as there are no rows yet, the end user will not be able to do something useful.
In the next step we will add some more rows, some columns and some time scales.
Select your form and go to the events section in the object inspector. Now double-click in the OnCreate event
of the form. A new empty event handler will be created. Add the following line of code in the event handler
in order to create 10 rows.
2. begin
3. GanttChart1.DataController.RowCount := 10;
4. end;
Now please press F12 in order to switch back from the code view into the designer-view. Select the
GanttChart component by left clicking on it. In order to create some more columns, please click the button
(…) shown at the columns property.
Gantt Control Component Developer Reference 6
Weise Software GmbH
After closing the GanttChart.Columns enumerator window, please compile and run (F9) your application
again.
When everything is done correctly in the sample applications, the gantt chart has two more columns and ten new
rows. The user is now able to edit cell values and drag in new bars in the right section of the gantt chart. In most
cases it would be helpful if there is a column that shows the start and the end of a task. In order to implement that,
we simply have to set the columns CellEditor property to AutoStart and AutoEnd.
Select the first column. Please note in the Delphi designer you simply can left click on a column header to
select the column.
Please set AutoStart as value for the CellEditor property of the first column. You may set the columns Caption
property to ‘Start’.
Please set AutoEnd as value for the CellEditor property of the second column. You may set the columns
Caption property to ‘Finish’.
After you have run the sample application again and dragged in some bars, you should see that the value for the
start and finish of the bars has been automatically set to the cell values. Additionally, you are now able to define a
start and end of a task by editing the corresponding cell – the bar in the right section will be automatically updated.
Gantt Control Component Developer Reference 7
Weise Software GmbH
Now we will add two more timescales that display week and month information.
Select the GanttChart component and open the TimeScales sub dialog by clicking the […] button at the
TimeScale property.
Add two more time scales. Please note that the lower most time scale has the id 0 and the top most time
scale has the id 2.
Please select the time scale #1 and set the TimeMode to tmWeek and the TimeFormat to tmfWeekMonth
Now select the time scale #2 and set the TimeMode to tmMonth and the TimeFormat to
tmfMonthMediumYear
Finally, we will add a GanttPrintPreview component and will show the print preview.
In order to do so, please add a new TGanttPrintPreview component onto your form. You will find the
component in the GanttSuite3 section of the tool palette.
After you have added the component, please select it and link your gantt chart to the print preview by
assigning the GanttChart property.
Now, please add a new button somewhere onto your form. Double click the button to create the button
OnClick event handler.
2. begin
3. GanttPrintPreview1.ShowPreview();
4. end;
Please add the single line of code GanttPrintPreview1.ShowPreview(); into the event handler. At runtime of
the application, the print preview will be shown after the user clicks on the button.
The sample application is finished so far. After having reproduced the steps, you should be able to set up the
component, add basic elements such as rows, column, timescales and invoke a print preview.
At this point we suggest to have a look at the sample applications that comes along with the component. They may
give you an overview of the features and functionalities of the component and how to implement them or you may
continue to read the developer reference.
Gantt Chart
Overview
The GanttChart is an interactive user interface component that connects a tree grid structure with a table that
visualizes bars or tasks based upon their scheduled start and finish dates. We will give a brief overview of the most
relevant elements of the GanttChart component.
Gantt Control Component Developer Reference 8
Weise Software GmbH
Nr Item Description
1 Indicator column The indicator column. For each row the component will automatically display a row
number. There are two options for numbering a row. You either can set a
hierarchical row numbering (rnHierarchical) or a continuous row numbering
(rnContinuous) for the Numeration property of the Indicator Column. The
GanttChart.IndicatorColumn object provides access to the property of the Indicator
column. The end user may resize the height of a row, or change to row order by
mouse-dragging a cell of the indicator column.
2 Column headers The column header of the column. You can optionally resize the columns width with
the mouse. If you click on the triangle in the right of a column header, the column
menu will be shown. The column menu allows sorting and filtering of rows. By
default, if you double-click on a column header you can rename the caption of the
column.
3 Splitter There is a splitter object between the tree grid and the chart area of the GanttChart
component. If you set the fixed property of the Splitter to true, the splitters position
could not be changed by the end user. In order to specify a position for the splitter
assign a numeric value (0-100) for the OpenPercent property. Alternatively you can
specify the GanttChart.TreeWidth property.
4 Timescales The Timescale objects of the GanttChart component. For each time scale object a
TimeMode (tmDay, tmHour, tmWeek, tmMonth, tmYear, tmQuarter) and its
corresponding TimeFormat can be specified. Please note that when you change the
global TimeMode of the GanttChart component
GanttChart.GanttChartView.TimeMode the time modes of the time scales are
changing accordingly.
5 Collapsed Row Rows can be structured hierarchically. Therefore rows can be collapsed or
expanded.
6 Bar Object Each row – with the exception of rows that has own child rows -can hold an
unlimited amount of several bar objects, such as task bars, progress bars,
milestones, text bars, image bars or shadow bars. Rows that have child rows itself
(so called grouped rows or summary rows) automatically create a summary bar
object and cannot hold other bars.
7 Cell A single cell of the tree grid. Cells may be accessible by the
GanttChart.AbsoluteRow[n].Cells[c] or the GanttChart.Rows[n].Cells[c] object.
Each cell can hold unique values for the background color or the cells font.
8 Row A row object of the Gantt Chart. There are three different ways to access rows. We
recommend to use the GanttChart.AbsoluteRow[] Array as it provides easy and flat
access to all rows ignoring any hierarchical structure. Alternatively, when requiring
a hierarchical access, you should use the GanttChart.Rows[] array. The
GanttChart.VisibleRows[] array provides access only to the unfiltered visible rows.
Rows (TGanttRow)
The TGanttRow object is a basic element of the GanttChart component as it provides access to its bars and cells.
Accessing Rows
As mentioned above, there are 3 ways on how to access row objects of the GanttChart.
For each array there is a function to retrieve the total number of rows it holds:
Method Description
TGanttChart. AbsoluteRowCount Returns the number of rows in the AbsoluteRow[] Array .
TGanttChart. RowCount Returns the number of rows in the Row[] Array.
TGanttChart. VisibleRowCount Returns the number of rows in the VisibleRow[] Array.
For a given TGanttRow you can access its child using the child[] Array and the ChildCount function.
Method Description
TGanttRow.Child[] Provides Access to the child rows of a row.
TGanttRow.ChildCount Returns the total number of childrows of a row.
Properties
Based on the Numeration property of the IndicatorColumn, Number returns the unique row identifier in either a
hierarchical or a continuous format, e.g (“3.1” or “4”).
Collapsed:Boolean
Returns true if the row is collapsed otherwise false.
Filtered:Boolean
Returns true if the row is filtered out or not.
Color:TColor
Specifies the color of the row. Please note, that each cell of the tree does have its own color. If you want to colorize
the entire row you have to use the code shown below:
1. ...
2. GanttChart1.BeginUpdate;
3. GanttChart1.AbsoluteRow[2].Color := clLime;
5. GanttChart1.AbsoluteRow[2].Cells[c].Color := clLime;
6. GanttChart1.EndUpdate;
7. ...
RowCalendar:TGanttRowCalendar
By default, the GanttChart component uses a single calendar (BaseCalendar) entity that defines all working and
non-working date exceptions, such as holidays, weekends or vacations. The GanttControl 3.0 component provides
the possibility to assign a different calendar to a single or a set of rows. If you assign a TGanttRowCalendar object
to the RowCalendar property, the RowCalendar will be used for this row instead of the BaseCalendar.
StartDate:TDateTime
Returns the start date of the first (earliest) bar object in this row.
EndDate:TDateTime
Returns the end date of the last (latest) bar object in this row.
IsGroupRow:Boolean
Returns true, if the row does have children otherwise it will return false.
SummaryBar:TGanttSummaryBar
If the row has at least one children that holds a bar object, the GanttChart component will automatically create a
TGanttSummaryBar object. The summary bar starts at the earliest start of a child bar object and ends at the latest
end of a child bar object. If the start- or enddate of the child bars will be changed the summary bar will update itself
immediately.
DurationDisplayMode:TSpinDurationMode
Specifies whether the duration of a task, that will be automatically shown in the cells of AutoDuration columns, will
be shown in hours (dmHours), days (dmDays) or weeks (dmWeeks).
AutomaticScheduling:Boolean
If a bar requires to be rescheduled due some restriction defined by a connection, the GanttChart component will
reschedule the bar automatically if AutomaticScheduling is set to true, otherwise it will not reschedule the bar.
Note:string
Optionally the user can assign a text note to each row. To edit the row note you can call the
TGanttChart.EditRowNote function.
PertBar:TPertBar
Returns the TPertBar object that is linked with the row.
AllowResize:Boolean
Specifies whether the end user can modify the row height of this row.
Methods / Functions
Gantt Control Component Developer Reference 11
Weise Software GmbH
The following list gives an overview of the methods and functions of the TGanttRowObject.
function GetCalendar: TGanttCalendar;function CellCount:integer
Returns the calendar that is actually being used for this row. If the RowCalendar is nil for this row, it will return the
BaseCalendar otherwise it will return the RowCalendar.
function Parent : TGanttRow
Returns the parent row object for the given row.
function GetRecursivChildRows(var AChildRows :TList<TGanttRow>):integer
Returns a list of all child rows and their recursive children of a given row.
function GetRecursivChildBars(var AChildBars :TList<TGanttBaseBar>; AOpBars:Boolean=false):integer
Returns a list of all child bars and their recursive child bars of a given row.
function ChildCount : integer
Returns the number of children a row has.
function GetFirstChild:TGanttRow
Returns the first child of a row.
function GetLastChild:TGanttRow
Returns the last child of a row.
function AddChild:TGanttRow
Adds a new child row to a specific row.
function InsertChild(APos:integer):TGanttRow
Insert a child at the specified absolute index.
procedure DeleteChilds
Deletes all children.
function DeleteChildRow(AIndex:integer):Boolean
Deletes a child row according to its Index.
function IsHotTracked:Boolean
Returns true if the current row is being hot tracked.
procedure Collapse
Collapses the row.
procedure Expand
Expands the row.
procedure MakeVisible
Will force the control, to set a proper scroll position, so that the row will be part of the view range.
procedure DeselectBars
Deselect all bars of the given row.
function BarCount:integer
Returns the number of bars the row holds.
function BarCount(ABarSet:TGanttBarTypeSet):integer
Returns the number of bars for a given bar type or a set of bar types.
function AddTaskBar(AStartDate, AEndDate : TDateTime):TGanttTaskBar
Adds a new task bar to the row and returns a reference on it.
function AddProgressBar(AStartDate, AEndDate : TDateTime):TGanttProgressBar
Adds a new progress bar to the row and returns a reference on it.
function AddMileStoneBar(AStartDate, AEndDate : TDateTime):TGanttMileStoneBar
Adds a new milestone bar to the row and returns a reference on it.
function AddTextBar(AStartDate, AEndDate : TDateTime):TGanttTextBar
Gantt Control Component Developer Reference 12
Weise Software GmbH
Adds a new text bar to the row and returns a reference on it.
function AddImageBar(AStartDate, AEndDate : TDateTIme):TGanttImageBar
Adds a new image bar object to the row and returns a reference to it.
function CreatePertBar(AFromPertBar:TPertBar):TPertBar
Creates a new PertBar object for the given row. If AFromPertBar is not null it will copy the suitable properties from
AFromPert.
procedure Assign(Source: TGanttRow)
Copies the properties from the Source row object.
constructor Create(AOwner: TComponent)
Constructor. Creates a new TGanttRowObject
destructor Destroy
Destructor. Destroys the TGanttRowObject
procedure ApplyVisualFrom(AGanttRow:TGanttRow)
Assigns the visual properties for the given row (such as color, cell values) from the AGanttRow parameter.
procedure RefreshAutoValues
Updates values for AutoStart, AutoEnd and AutoDuration columns.
Adding / removing rows
GanttChart.DataController.RowCount:integer
Use the RowCount property to obtain and set the total number of rows for the GanttChart component.
GanttChart.DataController.AddRow:TGanttRow
The AddRow() method will add a new row behind the last currently existing row and will return a reference to the
newly created row.
GanttChart.DataController.ClearRow(ARow: TGanttRow)
The ClearRow(ARow:TGanttRow) method will remove all existing bars of a given row and clears all cells of a row.
The visual properties of the cells will not be modified.
GanttChart.DataController.DeleteRow(ARowIndex:integer):Boolean
Removes the row, that is specified with the row index of the Row[] Array.
GanttChart.DataController.DeleteRow(ARow:TGanttRow):Boolean
Removes the row.
GanttChart.DeleteAbsoluteRow(AAbsoluteIndex:integer):Boolean
Removes the row, that is specified with the absolute Row Index.
GanttChart.DataController.DeleteSelectedRows (AllowPartialSelectedRows:Boolean): Boolean
Deletes the selected rows. If AllowPartialSelectedRows is true, then all rows will be deleted, that contains at least a
single selected cell. If AllowPartialSelectedRows is set to false, then only rows are deleted that are fully selected (all
cells are selected).
GanttChart.DataController. AddChildRow(AParentRow: TGanttRow): TGanttRow
Adds a new child row to the AParentRow row object.
GanttChart.DataController.InsertRow (AParentRow:TGanttRow; AIndex:integer):TGanttRow
This will add a new child row to the row that is set by the AParentRow parameter. AIndex will define the insert
position of the row.
GanttChart.DataController. InsertAbsoluteRow(AAbsoluteIndex:integer):TGanttRow
InsertAbsoluteRow will insert a new row at the position that is defined by the AAbsoluteIndex parameter.
GanttChart.DataController.InsertChildRow()
Inserts a new child row for the given row and position.
GanttChart.DataController.DeleteChildRow()
Deletes a child row.
Gantt Control Component Developer Reference 13
Weise Software GmbH
GanttChart.DataController.DeleteChilds()
Delete all children of a row.
Hierarchical structuring of rows
The tree of the gantt graph allows it to create a hierarchical structure. There are several methods enabeling the
developer to apply a hierarchical tree structure.
GanttChart.DataController.RowsGroup(AbsoluteStartIndex, AbsoluteEndIndex: integer): TGanttRow
You can group a range of rows and increase their nesting level by using the RowsGroup(AbsoluteStartIndex,
AbsoluteEndIndex:integer) method. The range is determined by the AbsoluteStartIndex and the AbsoluteEndIndex.
1. GanttChart1.DataController.RowsGroup(0,2);
Columns (TGanttColumn)
By default, the tree of the gantt chart does only hold an Indicator column. The value of the cells of the indicator
column is automatically generated by the component itself and displays the logical row identifier. When adapting
the gantt control to your specific requirements its necessary to add columns to the tree.
Columns can be added and deleted at design time, if you edit the
Columns property of the TGanttChart in the Object Inspector.
The most important property of a column is the CellEditor property. The columns editor type is specified by its
CellEditor property.
Gantt Control Component Developer Reference 14
Weise Software GmbH
Basically there are two types of columns – predefined columns and user defined columns. Predefined columns are
columns that are handled completely by the logic of the gantt control component itself.
The following table shows all predefined column types and a brief description.
Predefined column types
CellEditor Description
AutoStart Displays the earliest start date of all bars for each row. When the user assigns a value
the component will either create a new bar or reschedule an existing bar.
AutoEnd Displays the latest end date of all bars for each row. When the user assigns a value,
the component will either create a new bar or reschedule an existing bar.
AutoDuration Displays the duration of all bars.
User defined columns are not handled by the component itself and hold several different CellEditor types, shown
below:
CellEditor Description
SingleLineText Is used to edit a single line of text strings.
MultiLineText Is used to edit or display multi line text.
ComboBox Provides an editable combo box.
CurrencyEdit Is used to edit and display currency values.
ButtonEdit Is a composition of a single line of text and an additional button.
DateTime Is used to edit and display datetime values.
SpinEdit Is used to edit and display integer values, contains a spin edit control.
ImageComboBox Contains an image combo box control.
Indicator Columns with the Indicator-CellEditor can hold multiple IndicatorItems, that can be
used to visualize special states of a row in form of an icon. The component provides
hints for IndicatorItems. Additional there is the possibility to specify an automatic in-
built logic for IndicatorItems, such as to set the viewport to the first bar, or to display
and edit the row note or to toggle the automatic scheduling property of a row.
If you want to add columns at runtime by code, please use the code below. The parameter AColumnType defines
the columns editor type and can take one of the following values (etSingleLineText, etMultiLineText, etDateTime,
etComboBox, etSpinEdit, etButtonEdit, etIndicator, etAutoStart, etAutoEnd, etAutoDuration, etCurrencyEdit,
etImageComboBox).
1. with GanttChart1.DataController.AddColumn(etDateTime) do
2. begin
5. end;
Alternatively, you can use the following line of code. Here the overloaded AddColumn method does not take any
parameters and creates a single line text editor column. You can change the columns editor type if you assign a new
value to the PropertySelector property:
1. with GanttChart1.DataController.AddColumn do
2. begin
Gantt Control Component Developer Reference 15
Weise Software GmbH
4. PropertySelector := etDateTime;
5. end;
In order to delete an existing column at runtime, you can use the DeleteColumn method of the DataController as
shown in the code snippet below:
1. GanttChart.DataController.DeleteColumn(1);
If it is required to change the order of two existing columns, use the MoveColumn method of the DataController.
The following code will take the first column and will insert it after the second column:
2. GanttChart.DataController.MoveColumn(0,2);
Below is a list of all functions and methods the data controller holds, in order to manipulate TGanttColumn column
objects:
GanttChart.DataController.ColCount:integer
Returns the total number of columns.
GanttChart.DataController.SortColumn(AColumnID: integer; ASortOrder:ganttconsts.TColumnSortOrder)
SortColumn will perform a sorting on the Column defined by the parameter AColumnID. For the parameter
ASortOrder, use csAsc for an ascending and csDesc for a descending sorting. In order to cancel the sorting please
assign csNone. Please note, that after you have called the SortColumn method, any changes made in the cell values
of the column, are not automatically sorted in.
GanttChart.DataController.CancelSort
CancelSort will cancel the sorting of any column.
GanttChart.DataController.ApplyFilter(AColumnID: integer; var AFilteredItems: TStrings)
If you want to set a filter to a specific column, you can use the ApplyFilter method. The parameter AFilteredItems
is a TStrings object, such as a TStringList, that contains the strings that defines the filter.
GanttChart.DataController.CancelAllFilter
CancelAllFilters will cancel filtering of any column.
GanttChart.DataController.ColumnOfCell(ACell:TGanttCell):TGanttColumn
The method ColumnOfACell will return the corresponding column object of a cell.
GanttChart.DataController.AddColumn: TGanttColumn
AddColumn will add a new column and will return a reference to the column.
GanttChart.DataController.InsertColumn(Index: integer): TGanttColumn
InsertColumn will insert a new column at the position, defined by the parameter Index, and will return a reference
to the column.
GanttChart.DataController.DeleteColumn(Index:integer)
Deletes the column, specified by the Index parameter.
GanttChart.DataController.MoveColumn(IndexFrom, IndexTo: integer)
Changes the position of the column. The column defined with the index IndexFrom will be repositioned to the new
position, defined by the parameter IndexTo.
GanttChart.DataController.ClearColumns
Removes all columns.
GanttChart.DataController.ClearColumnFixation
Columns do have the property “FixedTillHere”. All columns left of the column that has the property FixedTillHere
set to true, will remain permanent visible when the user scrolls the content of the tree horizontally. Only one column
Gantt Control Component Developer Reference 16
Weise Software GmbH
can have the boolean “FixedTillHere” property set to true at a given time. The method ClearColumnFixation will
remove any column fixation of the tree.
GanttChart.DataController.GetFixedColumn
The method GetFixedColumn will return the index of the column that has its property “FixedTillHere” set to true.
GanttChart.DataController.EditCaptionTitle(AColumn: TGanttColumn)
The method EditCaptionTitle(AColumn:TGanttColumn) will set the columns header in an edit mode, so that the end
user can edit the columns caption at runtime. If you do not want to make it possible for the end-user to edit the
caption of the column at runtime by double-clicking the columns header, please set the boolean poperty
AllowCaptionEditing of the column to false.
Properties
The following list gives an overview of the properties of the TGanttColumn object.
AllowCaptionEditing:Boolean
If set to true, the end-user is able to edit the columns caption by double-clicking the columns header.
AllowResize:Boolean
Allow resize determines whether it is possible for the end-user to resize the width of a column header.
AutoWidth:Boolean
If set to true, the width of a column will be adjusted according to the content of a column.
BarTextKey:string
If a value for the property BarTextKey has been assigned and matches with a value for a bar text (
Bar.TextSettings.TextLeft, Bar.TextSettings.TextTop, Bar.TextSettings.TextRight, Bar.TextSettings.TextBottom or
Bar.TextSettings.TextCenter) the component will automatically display the content of a cell at its corresponding bar.
In the sample code below you can see that both - the captions BarTextKey property and the TextLeft property of
the bar - are mapped to the same value. As soon as you have created a bar object and have edited a cell value of
the column, the cells value should be drawn left of the bar.
2. begin
3. with GanttChart1.DataController.AddColumn do
4. begin
5. Caption := 'Column';
6. BarTextKey := '[mybartextkey]';
7. end;
8. GanttChart1.DataController.RowCount:=5;
9. end;
10.
12. begin
14. end;
Caption:string
The caption of the column.
CellEditor: TEditorProperties
The CellEditor property provides access to specific column editor properties. Assign a new value to the
PropertySelector property of the column if you want to modify the columns editor type at runtime. For accessing
and setting sub properties of the cell editor it is required to typecast the CellEditor. Please refer to the next chapter
on how to access and set properties of a cell editor.
Gantt Control Component Developer Reference 17
Weise Software GmbH
Color:TColor
Specifies the background color of the cells header.
ColumnHintDescription.HintDescription:string
Use the HintDescription property to set up a multiline hint text for the
column.
As you can see on the left side you can control the font style in the
column hint.
The following code snippet shows how to set up the formatted text for the column hint.
1. with GanttChart1.DataController.AddColumn do
2. begin
3. Caption := 'Column';
4. BarTextKey := '[mybartextkey]';
5. ColumnHintOptions.ShowHint := true;
6. ColumnHintOptions.HintTitle := 'HintTitle';
10. end;
As you can see there are some control character that triggers special formatting of the text:
Character Desscription
@@ Triggers the text formatting mode. Must be used, in order to use any of the control characters
below.
@b Sets the bold font style mode.
@i Sets the italic font style mode.
@u Sets the underline font style mode.
@d Sets the default font style. The bold, italic and underline flags will be unset.
ColumnHintDescription.HintTitle:string
Sets a title for the columns hint.
ColumnHintDescription.ShowHint:Boolean
Determines whether the column hint will be shown or not.
ColumnMenuOptions.Filtering:Boolean
When set to true, the column menu provides a section where the end-user is able to apply a filter to the gantt chart.
ColumnMenuOptions.Sorting:Boolean
When set to true, the column menu provides the possibility to apply an ascending, descending sorting of the gantt
chart.
DefaultCellHorizontalAlignment: TCellHorzAlign
Specifies the default horizontal alignment for cells of the column. However, each cell of the column may have its
own independent alignment settings.
DefaultCellVerticalAlignment: TCellVerticalAlign
Specifies the default vertical alignment for cells of the column. However, each cell of the column may have its own
independent alignment settings.
Gantt Control Component Developer Reference 18
Weise Software GmbH
FilteredItems:TStrings
Defines the values for the column filter. Only rows of the gantt chart will be displayed that cells contain values which
are part of the FilteredItems.
FixedTillHere:Boolean
All columns left of the column that has the property FixedTillHere set to true, will remain permanent visible when
the user scrolls the content of the tree horizontally. Only one column can have the boolean “FixedTillHere” property
set to true at a given time.
Font:TFont
The font object of the columns header.
HeaderGlyph:TPicture
It is possible to display a glyph for each column header.
HeaderGlyphHorzAlignment: TCellHorzAlign = (chaLeft, chaRight, chaCenter)
Defines the horizontal alignment for the header glyph.
HeaderGlyphVertAlignment:TCellVerticalAlign= (cvaTop, cvaBottom, cvaCenter)
Defines the vertical alignment for the header glyph.
HorzAlignment: TCellHorzAlign = (chaLeft, chaRight, chaCenter)
Horizontal alignment for headers caption.
MaxWidth:Integer
Maximal column with in pixel.
MinWidth:Integer
Minimal column with in pixel.
Printable:Boolean
If the printable flag has been set to false, the column will not be printed.
ReadOnly:Boolean
When set to true the cells of the column are not editable.
SortOrder: TColumnSortOrder=( csNone, csAsc, csDesc)
The rows of the gantt chart component will be sorted based upon the cell values of the column. If you have applied
a sort order for the column, changes made to a cell values will not force the component to immediately readapt the
rows sort order.
Tag:integer
Can be used by the developer to store any user defined unspecific integer value to a colum.
VertAlignment:TCellVerticalAlign= (cvaTop, cvaBottom, cvaCenter)
Vertical alignment for the headers caption.
Visible:Boolean
Defines the visibility of the column.
Width:integer
Specifies the width of the column in pixel.
Column type editors
The following chapter will introduce all column types and their specific properties. Each editor specify property can
be accessed and set at run time, by typecasting the CellEditor of the column. The most important property of a
column is the CellEditor property. The columns editor type is specified by its CellEditor property.
The code below typecasts the CellEditor property to a TSingleLineTextEditorProperties class and sets the
AutoComplete property to false.
1. TSingleLineTextEditorProperties(GanttChart1.Column[1].CellEditor).AutoComplete := false;
Gantt Control Component Developer Reference 19
Weise Software GmbH
For each cell editor the associated EditorProperties class will be shown in round brackets.
SingleLineText (TSingleLineTextEditorProperties)
Columns of the single line text type are used to edit a single line of text. This column editor supports an auto
complete functionality, which can be activated or deactivated by the AutoComplete property.
AutoComplete:boolean When the AutoComplete property has been set to true and the end user is
editing cell values, the gantt chart component tries to auto complete the
current value based on all existing cell values of the column.
MultiLineText (TMultiLineTextEditorProperties)
Columns of the multi-line text type are used to edit a multi-line text including line breaks and word wrapping.
ScrollBars: TScrollStyle ( Specifies whether and what kind of scroll bars are shown when editing a multi
ssBoth, ssHorizontal, line text cell.
ssNone, ssVertical)
ComboBox
Columns of the combo box type provides an editable drop down combo box.
AutoCloseUp:Boolean Determines whether the drop-down list closes automatically after the user has
selected a list item.
AutoComplete:Boolean AutoComplete positions entries on matching list values and saves key strokes.
AutoCompleteDelay:Integer Sets the delay between pressing a key and trying to complete the field
automatically.
AutoDropDown:Boolean Determines whether the drop-down list is automatically opened when the user
presses a key.
DropDownCount:Integer Sets how many entries the drop-down list can display.
ItemHeight:Integer Specifies the height of the entries in the drop-down list in pixels.
Items:TStrings Allows access to the elements (strings) in the combo box.
Use items to access the items in the combo box. Items can be added, inserted,
deleted, or moved using the methods of items. By assigning items, you can copy
the elements of another string list into the list of the combination field.
Style:TComboBoxStyle Determines how the combo box is displayed.
CurrencyEdit
Columns of the currency edit type are used to edit and display currency values.
Currency:String Defines the Currency symbol as string, such as ($, €, EUR, …).
ButtonEdit
Columns of the button edit type provides editable cells that are a composition of a single line of text and an
additional button.
AutoComplete:Boolean When the AutoComplete property has been set to true and the end user is
editing cell values, the gantt chart component tries to auto complete the
current value based on all existing cell values of the column.
ButtonCaption:String The caption of the button.
Furthermore, columns of this type provides the OnButtonClicked event, that is raised when the user clicks on the
button.
2. var
3. ACell : TGanttCell;
4. AColumn : TGanttColumn;
Gantt Control Component Developer Reference 20
Weise Software GmbH
5. ARow : TGanttRow;
6. begin
8. begin
9. ACell := GanttChart1.Selection.GetFirstSelectedCell;
12.
13. GanttChart1.TreeCellEditor.CancelEditor;
15. end;
16. end;
The example shows how to get the cell and the corresponding column and row, whose button has been clicked. If
you want to assign a value within the ButtonClicked event of the column, you first have to call the
GanttChart.TreeCellEditor.CancelEditor statement(13) as shown above.
DateTime
Columns of the Date Time edit type are used to display date time values.
DateFormat:TDTDateFormat = Specifies whether the date value will be editable in short or long date time
(dfShort, dfLong); format.
Format:String Format sets a custom format for displaying date / time values. Please refer
to the next table that lists all format characters and their functions.
Kind: TDateTimeKind = (dtkDate, Specifies whether date or time values are edited.
dtkTime);
ShowCalWeeks:Boolean When set to true, and the columns kind is set to dtkDate the drop down
calendar, that appears when the user edits a date, displays additional
calendar weeks.
The following table list all format character and their functions.
Item Description
d The one- or two-digit day.
dd The two-digit day. Single-digit day values are preceded by a zero.
ddd The three-character weekday abbreviation.
dddd The full weekday name.
h The one- or two-digit hour in 12-hour format.
hh The two-digit hour in 12-hour format. Single-digit values are preceded by a zero.
H The one- or two-digit hour in 24-hour format.
HH The two-digit hour in 24-hour format. Single-digit values are preceded by a zero.
m The one- or two-digit minute.
mm The two-digit minute. Single-digit values are preceded by a zero.
M The one- or two-digit month number.
MM The two-digit month number. Single-digit values are preceded by a zero.
MMM The three-character month abbreviation.
MMMM The full month name.
t The one-letter AM/PM abbreviation (that is, AM is displayed as "A").
Gantt Control Component Developer Reference 21
Weise Software GmbH
SpinEdit
Columns of the spin edit type are used to edit and display integer values in a spin edit control.
MaxValue:integer MaxValue specifies the maximum value for the Value property the spin edit
control can take.
MaxValueAssigned:Boolean MaxValueAssigned determines whether a range check for the maximum
value should be performed.
MinValue:integer MinValue specifies the minimum value for the Value property the spin edit
control can take.
MinValueAssigned:Boolean MinValueAssigned determines whether a range check for the minimum
value should be performed.
ImageComboBox
Columns of the image combo box type provides an editable combo box including an additional image.
AutoCloseUp:Boolean Determines whether the drop-down list closes automatically after the user has
selected a list item.
AutoComplete:Boolean AutoComplete positions entries on matching list values and saves key strokes.
AutoCompleteDelay:Integer Sets the delay between pressing a key and trying to complete the field
automatically.
AutoDropDown:Boolean Determines whether the drop-down list is automatically opened when the user
presses a key.
DropDownCount:Integer Sets how many entries the drop-down list can display.
ItemHeight:Integer Specifies the height of the entries in the drop-down list in pixels.
Items:TStrings Allows to access the elements (strings) in the combo box.
Use items to access the items in the combo box. Items can be added, inserted,
deleted, or moved using the methods of items. By assigning items, you can copy
the elements of another string list into the list of the combination field.
Style:TComboBoxStyle Determines how the combo box is displayed.
Images:TImageList A reference to an image list that is used for displaying the images
ShowCaption:Boolean Determines whether the caption are shown when in edit mode.
Indicator
Columns with the indicator cell editor can provide multiple indicator items, that can be used to visualize special
states of a row in form of an icon. The component provides hints for indicator items. Additional there is the
possibility to specify an automatic in build logic for Indicator items, such as to set the viewport to the first bar or to
display and edit the row note or toggle the automatic scheduling property for a row.
The visibility of each indicator item can be set within the OnShowIndicatorItem of the gantt chart component.
DefaultVisible:Boolean Specifies, whether the indicator items are by default visible (active).
Gantt Control Component Developer Reference 22
Weise Software GmbH
DrawStyle:TIndicatorDrawStyle When set to idsColumn all indicator glyphs hold their horizontal position
independent from their visibility. When set to idsLeftAligned all visible
indicator items will be shown left aligned.
DrawVerticalLine:Boolean If set to true a small vertical line will be displayed between the glyphs of
the indicator items.
Items:TIndicatorItems The items array grants access to the indicator items. Use the Items array to
access, add or remove single indicator items.
ShowInactiveGlpyhs:Boolean When set to true, the component will draw the GlyphInactive otherwise no
glpyh will be drawn for inactive indicators.
The code sample below uses the OnShowIndicatorItem event to set all indicators visible for uneven rows. Within
this event set the Boolean var parameter AShow to true, when the indicator items should be visible (active) or false
if the indicator item should be invisible (inactive).
3. begin
4. AShow:= Odd(ARow.AbsoluteIndex);
5. end;
If it is required to set a unique (row-dependant) hint for an indicator item, you can use the OnIndicatorGetHint
event.
If it is required to react on a mouse down event on the indicator items, you can use the OnIndicatorMouseDown
event.
AutoStart
Gantt Control Component Developer Reference 23
Weise Software GmbH
Columns with the auto start editor type, display the earliest start of all bars for each row. When the user assigns a
value the component will either create a new bar or reschedule an existing bar.
HandleTaskBars:Boolean When set to false, the AutoStart column will be in read only mode and will only
display the earliest start date of the bars. When set to true, changes made in
cells of the columns, will automatically force the component to update the bars
start date.
IncludeBars: Defines what kind of bar types should be considered for calculating the start
TGanttBarTypeSet date of the row.
AutoEnd
Columns with the auto end editor type, display the latest end date of all bars for each row. When the user assigns
a value, the component will either create a new bar or reschedule an existing bar.
HandleTaskBars:Boolean When set to false the AutoEnd column will be in read only mode and will only
display the latest end date of the bars. When set to true, changes made in cells
of the columns, will automatically force the component to update the bars end
date.
IncludeBars: Defines what kind of bar types should be considered for calculating the end
TGanttBarTypeSet date of the row.
AutoDuration
Columns with the auto duration editor type, display the duration of all bars.
AsWorkingTime:Boolean Determines whether the duration of the corresponding bars should be
displayed excluding non-working times.
HandleTaskBars:Boolean When set to false the AutoDuration column will be in read only mode and will
only display the duratuion of the bars. When set to true, changes made in cells
of the columns, will automatically force the component to update the duration
of bars.
IncludeBars Defines what kind of bar types should be considered for calculating the
duration of bars.
IndicatorColumn (TGanttIndicatorColumn)
The indicator column contains cells that displays the logical row number. The rows can either be numbered
hierarchically or continuously. Additionally, there are some end-user mouse interactions, such as resizing the height
of a row or changing the row order, that may be triggered at cells of the indicator column.
Properties
The following list gives an overview of the properties of the TGanttIndicatorColumn object.
AllowResize:Boolean
AllowResize determines whether it is possible for the end-user to resize the width of the indicator column.
AutoWidth:Boolean
If set to true, the width of the indicator column will be adjusted according to the maximum width of the content of
the indicator columns cells.
Caption:String
The caption of the indicator column.
Color:TColor
The background colour of the indicator column cells.
Font:TFont
The font object of the indicator columns header.
FontRow:TFont
The font object of the cells of the indicator columns.
HeaderColor:TColor
Gantt Control Component Developer Reference 24
Weise Software GmbH
rnHierarchical rnContinuous
tmHour Hours
tmDay Days
tmWeek Weeks
tmMonth Months
tmQuarter Quarters
tmYear Years
All time scales can be accessed in the TGanttChart.TimeScales[] array. The draw order of the time scales may be
misleading as the time scales will be drawn from bottom to top – therefore if you access time scales, keep in mind
that the time scale with the index 0 will be the bottom most.
Properties
The following table gives a list of all properties of a time scale object.
Color:TColor
The background colour of the time scale.
DisplayFormat:string
DisplayFormat sets a custom format for displaying date / time values. Please refer to the next table that list all
format character and their effects.
Character Description
d The one- or two-digit day.
dd The two-digit day. Single-digit day values are preceded by a zero.
ddd The three-character weekday abbreviation.
dddd The full weekday name.
h The one- or two-digit hour in 12-hour format.
hh The two-digit hour in 12-hour format. Single-digit values are preceded by a zero.
H The one- or two-digit hour in 24-hour format.
HH The two-digit hour in 24-hour format. Single-digit values are preceded by a zero.
m The one- or two-digit minute.
mm The two-digit minute. Single-digit values are preceded by a zero.
M The one- or two-digit month number.
MM The two-digit month number. Single-digit values are preceded by a zero.
MMM The three-character month abbreviation.
MMMM The full month name.
t The one-letter AM/PM abbreviation (that is, AM is displayed as "A").
tt The two-letter AM/PM abbreviation (that is, AM is displayed as "AM").
yy The last two digits of the year (that is, 2017 would be displayed as "17").
yyyy The full year (that is, 2017 would be displayed as "2017").
DrawHorzLine:Boolean
Specifies whether a horizontal line should be drawn at the bottom of the time scale.
DrawVertLine:Boolean
Specifies whether a small vertical line should be drawn between at time segments of a time scale.
Font:TFont
The font object of the time scale.
FontAutoSize:Boolean
Gantt Control Component Developer Reference 26
Weise Software GmbH
If set to true, the component will automatically apply the best font size, so that the date label still fits into the given
time segment. Especially if you implement some kind of zooming for the width of a time segment, or changing the
time mode at runtime, it is recommended to set the FontAutoSize to true.
Height:integer
The height of a time scale in pixel. Please note, that the total height of all visible time scales, determines the total
height of the column headers.
HotTracked:Boolean
Determines whether single time segments can be highlighted when moving the mouse cursor over them.
ShowHint:Boolean
ShowHint specifies, whether a hint should be displayed for a time segment.
TimeFormat: TGanttTimeFormat
The TimeFormat defines, in which way the displayed date label is formatted.
The following table shows all time formats, the corresponding time mode and a brief example.
The time mode of the time scale, specifies the time/date range for a time segment.
Visible:Boolean
Defines whether the time scale is visible or not.
DateLines (TGanttDateLines)
If you want to highlight a specific date or time in the gantt chart you can add a DateLine in the DateLines[] array.
DateLines can be formatted in various ways and provide some optional built-in-logic for showing the current date
or the start date/ end date for all selected bars.
The image on the left shows three date lines. The first (red
bold line) shows a user defined date lines on the 29th May
2016. The second and third date lines shows the start and
end of the range of the selected bars.
DateLines are highly adaptable. You can define the color,
line style, line widh or text orientation.
Caption:String
The caption of the date line.
Color:TColor
The colour value of the date line.
Date:TDateTime
Specifies the Date of the date line. The component will draw the date line at the specified date, when the
DateLineType has been set to gdlDateValue.
DateLineType: TGanttDateLineType = (gdlDateValue, gdlCurrentDate, gdlSelectedBarsStart, gdlSelectedBarsEnd)
Specifies whether the date line will be drawn at a user specified date or calculated by built-in-logic of the
component.
DateLineType Effect
gdlDateValue The date line will be drawn at the date specified by the Date property.
gdlCurrentDate The date line will be drawn at the current date and the current time.
gdlSelectedBarsStart The date line will be drawn at the start of the earliest selected bar.
gdlSelectedBarsEnd The date line will be drawn at the end of the latest selected bar
Font:TFont
The font object of the date line.
PenStyle:TPenStyle (psSolid, psDash, psDot, psDashDot, psDashDotDot, psClear,
psInsideFrame, psUserStyle, psAlternate)
Specifies the pen style for the date line.
ShowDateAsCaption:Boolean
Specifies whether the component shows the actual date at the date line or not. You still can assign a value for the
caption property. The component will concatenate the date and the caption.
Gantt Control Component Developer Reference 28
Weise Software GmbH
Bars (TGanttBar)
Bars are mainly used to visualize planned tasks or activities and their chronological determination. The component
holds various bar types for different types of activities or to provide the user with additional information.
Each row (that has no child rows) can own an unlimited number of bar objects. Bars – with the exception of shadow
bars – must not overlap.
See the following table for the different bar types, the component provides:
Bar Description
TGanttTaskBar The task bar is the main element of the gantt chart. It is used to visualize
a single (planned/target) activity. Task bars can be linked together in form
of a single connection. Task bars are basically defined and determined by
their StartDate and EndDate as well as the row in which they are
displayed.
Bar Description
TGanttProgressBar A progress bar is commonly used to visualize the effective progress of a
task. Therefore it can be displayed under a task bar in the same row as
the task bar. Please not that a progress bar is not limited to be located
within the range of a task bar. Progress bars can be linked together.
Bar Description
TGanttMileStoneBar Milestones represent special dates with a unique character, for example
a deadline where a project has to reach a certain state. A milestone will
be represented as a small diamond symbol that visualizes a specific time
/ date. Milestones do have a fixed size and are not resizable.
Bar Description
TGanttImageBar The TGanttImageBar object can be used to display images. Image bars are
resizable.
Image bars cannot be linked together with connections.
Bar Description
Gantt Control Component Developer Reference 29
Weise Software GmbH
TGanttTextBar To display any textual information inside the gantt chart, a suitable
option would be to use a text bar. The text bar does have an additional
title string.
Text bars cannot be linked together.
Bar Description
TGanttSummaryBar If the child row of a grouped row contains at least a taskbar, a milestone
or a progress bar, a summary bar - shown on the left – will be created
automatically. If the start- or enddate of the child bars will be rescheduled
the summary bar will update itself immediately.
Please note, that it is not possible to create any other bar within a
grouped row.
Bar Description
TGanttShadowTaskBar, The TGanttShadowTaskBar and TGanttShadowProgressBar are non-
TGanttShadowProgressBar interactive gantt bar objects. The end-user is unable to delete or modify
them. Also the shadow bars are the only bar types that may overlap other
bars – as shown on the left side.
Shadow bars are mainly used to display specific time ranges in the
background behind task bars. In some applications shadow bars are used
to visualize a previous state of planned activities, the actual state of
planned activities is visualized by task bars.
The end user is able to create new bars by holding down the left mouse button and drag in a new object into a row
of the gantt chart. By default, all new bars that will be inserted this way are task bars. However you can specify the
bar type by assign a value to the GanttChart.GanttChartView.DragNewBarType property.
The following table lists all possible values for the DrawNewBarType property.
Bar objects are accessible throughout the Bar[] Array of the GanttRow. If you have accessed a bar object and want
to set a specific property you may have to typecast the bar.
TGanttRow.SummaryBar Provides access to the summary bar if the row has a summary bar,
otherwise it will return NIL.
The code example below iterates through all the task bars and progress bars in the third row and set their startdate
to the current date.
1. var
2. i : integer;
3. begin
4. if GanttChart1.AbsoluteRow[2].BarCount([btTaskBar, btProgressBar]) > 0 then
5. for i := 0 to GanttChart1.AbsoluteRow[2].BarCount do
6. begin
7. if GanttChart1.AbsoluteRow[2].Bar[i].BarType in [btTaskBar, btProgressBar] then
8. GanttChart1.AbsoluteRow[2].Bar[i].StartDate := Trunc(Now);
9. end;
10. end;
Please note, that if you perform a bunch of data manipulative operations it is important to put the command
between a GanttChart.DataController.BeginUpdate and GanttChart.DataController.EndUpdate statement – as this
will improve the performance a lot.
TGanttRow.AddTaskBar(AStartDate, AEndDate: TDateTime): TGanttTaskBar
Adds a new task bar to the row and returns a reference on it.
TGanttRow.AddProgressBar(AStartDate, AEndDate: TDateTime): TGanttProgressBar
Adds a new progress bar to the row and returns a reference on it.
TGanttRow.AddMileStoneBar(AStartDate, AEndDate: TDateTime): TGanttMileStoneBar
Adds a new milestone bar to the row and returns a reference on it.
TGanttRow.AddTextBar(AStartDate, AEndDate: TDateTime): TGanttTextBar
Adds a new text bar to the row and returns a reference to it.
TGanttRow.AddImageBar(AStartDate, AEndDate : TDateTIme):TGanttImageBar
Adds a new image bar object to the row and returns a reference to it.
GanttChart.DataController.AddSummaryBar(AStartDate, AEndDate: TDateTime; ARow:TGanttRow):
TGanttSummaryBar
Adds a summary bar to the row. Please note, that summary bars are by default controlled by the components logic.
GanttChart.DataController.AddTaskBar(AStartDate, AEndDate: TDateTime; ARow: TGanttRow): TGanttTaskBar
Adds a new task bar to the row and returns a reference to it.
GanttChart.DataController.AddProgressBar(AStartDate, AEndDate : TDateTime; ARow:TGanttRow):
TGanttProgressBar
Adds a progress bar to the row and returns a reference to it.
GanttChart.DataController.AddMileStoneBar(AStartDate, AEndDate: TDateTime;
ARow: TGanttRow): TGanttMileStoneBar
Adds a milestone bar object to the row and returns a reference to it.
GanttChart.DataController.AddTextBar(AStartDate, AEndDate: TDateTime; ARow: TGanttRow): TGanttTextBar
Adds a text bar object to the row and returns a reference to it.
GanttChart.DataController.AddImageBar(AStartDate, AEndDate : TDateTime; ARow:TGanttRow): TGanttImageBar
Adds an image bar object to the row and returns a reference to it.
GanttChart.DataController.AddShadowTaskBar(AStartDate, AEndDate: TDateTime; ARow: TGanttRow):
TGanttShadowTaskBar
Adds a shadow task bar object to the row and returns a reference to it.
Gantt Control Component Developer Reference 31
Weise Software GmbH
2. GanttChart1.BeginUpdate;
3. GanttChart1.AbsoluteRow[2].AddTaskBar(Trunc(Now), Trunc(Now)+10);
4. GanttChart1.EndUpdate;
A task bar is defined by its start- and end date. Use the TGanttTaskBar.StartDate:TDateTime or
TGanttTaskBar.EndDate:TDateTime property to assign a new value or to retrieve the current value. Please note,
that when assigning a new time range for taskbars the EndDate must always been larger than the StartDate. For
example: If you want to change the duration of a task bar to one day, the EndDate should be EndDate := StartDate
+ 1.
Properties
The picture on the left shows a taskbar that has a progress value of
50 percent, an EndGlyph, assigned bar texts and a Start- and
EndShape.
Progress:integer
For each taskbar you can set an internal bar progress within a range of 0% to 100% - that is visualized as a horizontal
line inside the task bar.
BufferTimeLeft:TDateTime
It is possible to fill a range with an optional pattern on the inner left side on the bar as a buffer time. BufferTimeLeft
specifies the buffer time in days on the start of the task bar.
BufferTimeRight:TDateTime
It is possible to fill a range with an optional pattern on the inner right side on the bar as buffer time. BufferTimeRight
specifies the buffer time in days on the end of the task bar.
StartGlyph:TPicture
Assigns a glyph that is displayed at the start of the task bar.
EndGlyph:TPicture
Gantt Control Component Developer Reference 32
Weise Software GmbH
bsAdrienne bsAgatha
bsAlexandra bsAmanda
bsAmy bsAnastasia
bsAndrea bsAnne
bsAntonia bsAshley
bsAurora bsBabette
bsBetty bsBeverly
bsBridget bsCarla
bsCarlotta bsCarol
bsCaroline bsCatherine
bsCharlotte bsChristine
bsClara bsConstance
bsCordelia
StartShapeColor:TColor
Specifies the color value for the Start shape symbol.
StartShapeAlignment:TCellHorzAlign
The horizontal alignment of the start shape. The following table shows the three possible values.
Gantt Control Component Developer Reference 33
Weise Software GmbH
EndShape:TBarShape
Assigns a small shape at the end of the task bar. Please refer to the table above for the different possible values.
EndShapeColor:TColor
Specifies the color value for the End shape symbol.
EndShapeAlignment:TCellHorzAlign
The horizontal alignment of the end shape.
Data:Pointer
Each task bar holds a Data pointer reference that may be used to point to any application specific user data objects.
StartDate:TDateTime
The start date of the task bar. Settings a new value for the StartDate property will reschedule the task bar.
EndDate:TDateTime
The end date of the task bar. Setting a new value for the EndDate property will reschedule the task bar.
BarType:TGanttBarType = (btBaseBar, btTaskBar, btSummaryBar, btProgressBar, btMileStoneBar, btTextBar,
btImageBar, btShadowTaskBar, btShadowProgressBar, btPertBar)
For taskbars the BarType returns btTaskBar.
HotTracked:Boolean
Returns true if the task bar is currently hot tracked.
Selected:Boolean
Returns true if the task bar is selected.
GUID:TGUID
The gantt chart component assigns to each task bar a unique Globally Unique Identifier (GUID) in order to distinguish
the bar objects.
Locked:Boolean
If the task bar is locked, it will be unmodifiable by the end-user. Also locked task bars are fixed and will not be
rescheduled automatically by the component. A small symbol – displaying a lock – is drawn for all locked bars in the
upper left corner of the bar.
Height:integer
The height in pixel of a task bar.
Color:TColor
The color of the task bar. Please note that dependant from your draw style, it may be the case that the color
property is not used when drawing the task bar. Please refer to this Section – Draw Options – for further details.
Tag:integer
With the help of the Tag property any developer that uses the component can store user defined integer values to
each task bar for their own purpose. The Tag property will be ignored by the GanttChart component.
Border:Boolean
Specifies whether a border will be drawn or not.
BorderWidth:integer
Specifies the width of the border in pixel.
BorderColor:TColor
Specifies the border color.
Gantt Control Component Developer Reference 34
Weise Software GmbH
AutomaticSchedulung:Boolean
Read-only property. The value will be determined by the AutomaticScheduling property of the corresponding
TGanttRow. When set to false the component will not automatically reschedule the task bar due any changes to a
connected bar.
Row:Pointer
Holds a reference pointer to the corresponding bar object.
Owner:Pointer
Holds a reference to the corresponding gantt chart object.
Successors:TList<TGanttBaseBar>
Provides a list of all directly connected bars that are successors.
Predecessor:TList<TGanttBaseBar>
Provides a list of all directly connected bars that are predecessors.
AllowVerticalDrag:Boolean
Read-only property. Task bars can be dragged from one row to another – therefore the property returns true.
AllowHorizontalDrag:Boolean
Read-only property. Task bars can be dragged horizontally in a row.
AllowMultiRow:Boolean
Read-only property. It is not possible for task bars to be larger than the height of a single row, so the property
returns false for task bars.
AllowConnections:Boolean
Read-only property. Task bars can be connected to other bar objects – so the property will be true for task bars.
Hint:Boolean
Specifies whether the component should provide a hint for the task bar.
DefaultHint:Boolean
Specifies whether the DefaultHint or a user-defined hint (see HintTitle and HintDescription) will be used.
HintTitle:string
Specifies the title for the user defined hint.
HintDescription:string
Specifies the description for the user defined hint.
GetDuration:Double
Returns the total (working and non-working) duration of the task bar.
GetEffectiveDuration:Double
Returns the work time duration for the task bar.
SetEffectiveDuration(AValue:TDateTime)
Sets the work time duration for the task bar.
IsPartOfCriticalPath:Boolean
The Gantt Control component includes the calculation of the critical path. The calculation of the critical path
determines which tasks are critical and non-critical. When a task is critical any delay of this task will result in a delay
of the entire project. The critical path is the sequence of all critical tasks.
Returns true if the task bar is part of the critical path, otherwise it will return false.
DrawOptions.DrawStyle: TGanttBarDrawStyle = (dsSolid, dsGradient, dsPattern, ds3D)
Gantt Control Component Developer Reference 35
Weise Software GmbH
There are four different ways a task bar can be drawn. These are a solid fill style (dsSolid), a gradient style fill
(dsGradient), a pattern draw style (dsPattern) and a three dimensional draw style (ds3D). The following table shows
the draw style and the resulting task bar.
DrawStyle Taskbar
dsSolid
dsGradient ( horizontal)
dsGradient (vertical)
dsPattern
ds3D
DrawOptions.GradientStartColor:TColor
Specifies the start color for the gradient draw style.
DrawOptions.GradientEndColor:TColor
Specifies the end color for the gradient draw style.
DrawOptions.GradientDirection:TGradientDirection
Specifies the direction for the gradient. TGradientDirection is defined in the unit VCL.GraphUtil. You have to add
this to the uses clause.
DrawOptions.BrushStyle:TBrushStyle
Defines the type of pattern that is used when drawing.
DrawOptions.PatternColor:TColor
Specifies the color that is used when drawing the foreground lines of the patterns.
DrawOptions.ProgressColor:TColor
Specifies the color, that is used when drawing the internal bar progress.
CPMData.EarliestStart:TDateTime
A datetime property defining the ealiest possible start time of a task/bar. The earliest start time depends on the
connection ending at the bar. The task cannot start earlier because other tasks have to be finished/started first.
CPMData.EarliestFinish:TDateTime
A datetime property defining the earliest finish time of a task. The earliest possible finish time of a task is calculated
by the earliest possible start time and its duration.
CPMData.LatestStart:TDateTime
A datetime property defining the latest possible start time of a task/bar. The latest start time depends on the
connection starting from the bar. If the bar would be moved only one day later then the whole project end date
would be delayed.
CPMData.LatestFinish:TDateTime
A datetime property defining the latest possible finish time of a pert bar. The latest possible finish time of a task is
calculated by the latest possible start time and its duration.
CPMData.LocalBuffer:TDateTime
A datetime property defining the free buffer of a task. The free buffer is the number of intermediate days between
this bar and the earliest connected followed bar.
CPMData.GlobalBuffer:TDateTime
A datetime property defining the global buffer of a task. The global buffer is the number of days that a task can
delay without influencing the final project endtime. If the global buffer is 0 then any delay of this bar/task would
extends the overall project time. If the global buffer is zero, then the according task/bar is part of the critical path.
TextSettings.Font:TFont
Holds a reference to the font object.
TextSettings.TextLeft:String
Gantt Control Component Developer Reference 36
Weise Software GmbH
Specifies the text that is drawn on the left side of the bar.
TextSettings.TextTop:String
Specifies the text that is drawn on top of the bar.
TextSettings.TextRight:String
Specifies the text that is drawn on the right side of the bar.
TextSettings.TextBottom:String
Specifies the text that is drawn on bottom of the bar.
TextSettings.TextCenter:String
Specifies the text that is drawn inside the bar.
By default, the progress bar is drawn below the task bar – as shown
on the left. However you can specify the vertical position of the
progress bar – and the height / ratio of progress bars and task bars
and other visual aspects in the ProgressBarView array of the
GanttChartView.
StartDate:TDateTime
The start date of the progress bar. Settings a new value for the StartDate property will reschedule the progress
bar.
EndDate:TDateTime
The end date of the progress bar. Setting a new value for the EndDate property will reschedule the progress bar.
BarType:TGanttBarType = (btBaseBar, btTaskBar, btSummaryBar, btProgressBar, btMileStoneBar, btTextBar,
btImageBar, btShadowTaskBar, btShadowProgressBar, btPertBar)
For progress bars the BarType returns btProgressBar.
Gantt Control Component Developer Reference 37
Weise Software GmbH
HotTracked:Boolean
Returns true if the progress bar is currently beeing hot tracked.
Selected:Boolean
Returns true if the progress bar is selected.
GUID:TGuid
The gantt chart component assigns to each bar a unique Globally Unique Identifier (GUID) in order to distinguish
the bar objects.
Locked:Boolean
If the progress bar is locked, it will be unmodifiable by the end-user. Also locked progress bars are fixed and will not
be rescheduled automatically by the component. A small symbol – displaying a lock – is drawn for all locked bars in
the upper left corner of the bar.
Height:integer
The height in pixel of a progress bar.
Color:TColor
The color of the progress bar.
Tag:integer
With the help of the Tag property any developer that uses the component can store user defined integer values to
each task bar for their own purpose. The Tag property will be ignored by the GanttChart component.
Border:Boolean
Specifies whether a border will be drawn or not.
BorderWidth:Integer
Specifies the width of the border in pixel.
BorderColor:TColor
Specifies the border color.
AutomaticScheduling: Boolean
Read-only property. The value will be determined by the AutomaticScheduling property of the corresponding
TGanttRow. When set to false the component will not automatically reschedule the progress bar due any changes
to a connected bar.
TextSettings.Font:TFont
Holds a reference to the font object.
TextSettings.TextLeft:String
Specifies the text that is drawn on the left side of the bar.
TextSettings.TextTop:String
Specifies the text that is drawn on top of the bar.
TextSettings.TextRight:String
Specifies the text that is drawn on the right side of the bar.
TextSettings.TextBottom:String
Specifies the text that is drawn on bottom of the bar.
TextSettings.TextCenter:String
Specifies the text that is drawn inside the bar.
Row:Pointer
Holds a reference pointer to the corresponding bar object.
Owner:Pointer
Holds a reference to the corresponding gantt chart object.
Successors:TList<TGanttBaseBar>
Provides a list of all directly connected bars that are successors.
Predecessor:TList<TGanttBaseBar>
Gantt Control Component Developer Reference 38
Weise Software GmbH
Picture:TPicture
Alternatively, it is possible to display an image instead of the diamond for milestone bars. You can use the Picture
property to load/assign an image.
GlyphTag:integer
Could be used by the developer to store an integer value to the milestone bar.
AllowResize:Boolean
Milestone bars are not resizable – therefore the read only property will return false.
GetEffectiveDuration:Double
Returns the work time duration for the milestone bar.
StartDate:TDateTime
The start date of the milestone bar. Assigning a new value for the StartDate property will reschedule the milestone
bar.
EndDate:TDateTime
Gantt Control Component Developer Reference 39
Weise Software GmbH
The end date of the milestone bar. Assigning a new value to the EndDate property will reschedule the milestone
bar.
BarType:TGanttBarType = (btBaseBar, btTaskBar, btSummaryBar, btProgressBar, btMileStoneBar, btTextBar,
btImageBar, btShadowTaskBar, btShadowProgressBar, btPertBar)
For milestone bars the BarType returns btMileStoneBar.
HotTracked:Boolean
Returns true if the milestone bar is currently hot tracked.
Selected:Boolean
Returns true if the milestone bar is selected.
GUID:TGUID
The gantt chart component assigns to each bar a unique Globally Unique Identifier (GUID) in order to distinguish
the bar objects.
Locked:Boolean
If the milestone is locked, it will be unmodifiable by the end-user. Also locked milestone bars are fixed and will not
be rescheduled automatically by the component. A small symbol – displaying a lock – is drawn for all locked bars in
the upper left corner of the bar.
Color:TColor
Specifies the color of the milestone bar.
Tag:integer
With the help of the Tag property any developer that uses the component can store user defined integer values to
each milestone bar for their own purpose. The Tag property will be ignored by the GanttChart component.
Border:Boolean
Specifies whether a border will be drawn or not.
BorderWidth:integer
Specifies the width of the border in pixel.
BorderColor:TColor
Specifies the border color.
AutomaticScheduling:Boolean
Read-only property. The value will be determined by the AutomaticScheduling property of the corresponding
TGanttRow. When set to false the component will not automatically reschedule the milestone bar due any changes
to a connected bar.
Row:Pointer
Holds a reference pointer to the corresponding bar object.
Owner:Pointer
Holds a reference to the corresponding gantt chart object.
Successors:TList<TGanttBaseBar>
Provides a list of all directly connected bars that are successors.
Predecessor:TList<TGanttBaseBar>
Provides a list of all directly connected bars that are predecessors.
AllowVerticalDrag:Boolean
Read-only property. Milestone bars can be dragged from one row to another – therefore the property returns true.
AllowHorizontalDrag:Boolean
Read-only property. Milestone bars can be dragged horizontally in a row.
AllowMultiRow:Boolean
Read-only property. It is not possible for milestone bars to be larger than the height of a single row, so the property
returns false for task bars.
AllowConnections:Boolean
Gantt Control Component Developer Reference 40
Weise Software GmbH
Read-only property. Milestone bars can be connected to other bar objects – so the property will be true for task
bars.
Hint:Boolean
Specifies whether the component should provide a hint for the milestone bar.
DefaultHint:Boolean
Specifies whether the DefaultHint or a user-defined hint (see HintTitle and HintDescription) will be used.
HintTitle:string
Specifies the title for the user defined hint.
HintDescription:string
Specifies the description for the user defined hint.
3.
4. ....
5.
6. procedure AddImage;
7. var
8. AGanttImageBar : TGanttImageBar;
9. begin
12. end;
Properties
AllowMultiRow:Boolean
Read-only property. It is possible for image bars to be larger than the height of a single row, so the property returns
true.
AllowConnection:Boolean
Read only property. It is not possible for image bars to be connected to other bars, therefore it will return false.
Width:Integer
Specifies the width of the image bar, if the WidthMode property is set to bwmByWidth.
Proportional:Boolean
If set to true, the image bar will keep the height/width ratio while resizing.
StringData1:String
String property that can be used by the developer to store any additional string value to the image bar.
VerticalRowOffset:Integer
Specifies the vertical offset in pixel to the top of the parent row.
WidthMode:TBarWidthMode
Gantt Control Component Developer Reference 41
Weise Software GmbH
Specifies whether the width of the image bar should be calculated by the Width property or calculated by the
horizontal position of the EndDate property.
Data:Pointer
Each image bar holds the Data pointer reference that may be used to point to any application specific user data
objects.
StartDate:TDateTime
The start date of the image bar. Setting a new value for the StartDate property will reschedule the image bar.
EndDate:TDateTime
The end date of the image bar. Setting a new value for the EndDate property will reschedule the image bar.
BarType:TGanttBarType
For image bars the BarType returns btImageBar.
HotTracked:Boolean
Returns true if the image bar is currently hot tracked.
Selected:Boolean
Returns true if the image bar is selected.
GUID:TGUID
The gantt chart component assigns to each image bar a unique Globally Unique Identifier (GUID) in order to
distinguish the bar objects.
Locked:Boolean
If the image bar is locked, it will be unmodifiable by the end-user. Also locked image bars are fixed and will not be
rescheduled automatically be the component. A small symbol – displaying a lock – is drawn for all locked bars in the
upper left corner of the bar.
Height:integer
The height in pixel of the image bar. When the Proportional property has been set to true, the height of the image
bar will be calculated by the component itself.
Tag:integer
With the help of the Tag property any developer that uses the component can store user defined integer values to
each image bar for their own purpose. The Tag property will be ignored by the GanttChart component.
Border:Boolean
Specifies whether a border will be drawn or not.
BorderWidth:Integer
Specifies the width of the border in pixel.
BorderColor:TColor
Specifies the color of the border.
TextSettings.Font:TFont
Holds a reference to the font object.
TextSettings.TextLeft:String
Specifies the text that is drawn on the left side of the bar.
TextSettings.TextTop:String
Specifies the text that is drawn on top of the bar.
TextSettings.TextRight:String
Specifies the text that is drawn on the right side of the bar.
TextSettings.TextBottom:String
Specifies the text that is drawn on bottom of the bar.
TextSettings.TextCenter:String
Specifies the text that is drawn inside the bar.
Row:Pointer
Gantt Control Component Developer Reference 42
Weise Software GmbH
AllowMultiRow:Boolean
Read-only property. It is possible for text bars to be larger than the height of a single row, so the property returns
true.
AllowConnections:Boolean
Read only property. It is not possible for text bars to be connected to other bars, therefore it will return false.
Width:integer
Specifies the width of the text bar, if the WidthMode property is set to bwmByWidth.
Title:String
The title of the text bar.
ShowTitle:Boolean
Specifies whether the text bar should display a title.
Text:string
The text of the text bar.
Font:TFont
The font object used for the text of the text bar.
TitleFont:TFont
The title font object that is used for the title of the text bar.
Transparent:Boolean
When set to true, no solid filled background will be drawn.
Gantt Control Component Developer Reference 43
Weise Software GmbH
VerticalRowOffset:Integer
Specifies the vertical offset in pixel to the top of the parent row.
WidthMode:TBarWidthMode
Specifies whether the width of the text bar should be calculated by the Width property or calculated by the
horizontal position of the EndDate property.
Data:Pointer
Each text bar holds the Data pointer reference that may be used to point to any application specific user data
objects.
StartDate:TDateTime
The start date of the text bar. Setting a new value for the StartDate property will reschedule the text bar.
EndDate:TDateTime
The end date of the text bar. Setting a new value for the EndDate property will reschedule the text bar.
BarType:TGanttBarType
For text bars the BarType returns btTextBar.
HotTracked:Boolean
Returns true if the text bar is currently hot tracked.
Selected:Boolean
Returns true if the text bar is selected.
GUID:TGUID
The gantt chart component assigns to each bar a unique Globally Unique Identifier (GUID) in order to distinguish
the bar objects.
Locked:Boolean
If the text bar is locked, it will be unmodifiable by the end-user. Also locked text bars are fixed and will not be
rescheduled automatically by the component. A small symbol – displaying a lock – is drawn for all locked bars in the
upper left corner of the bar.
Height:Integer
The height in pixel of the text bar. When the Proportional property has been set to true, the height of the text bar
will be calculated by the component itself.
Color:TColor
The background color of the text bar.
Tag:Integer
With the help of the Tag property any developer that uses the component can store user defined integer values to
each text bar for their own purpose. The Tag property will be ignored by the GanttChart component.
Border:Boolean
Specifies whether a border will be drawn or not.
BorderWidth:Integer
Specifies the width of the border in pixel.
BorderColor:TColor
Specifies the color of the border.
TextSettings.Font:TFont
Holds a reference to the font object.
TextSettings.TextLeft:String
Specifies the text that is drawn on the left side of the bar.
TextSettings.TextTop:String
Specifies the text that is drawn on top of the bar.
TextSettings.TextRight:String
Specifies the text that is drawn on the right side of the bar.
Gantt Control Component Developer Reference 44
Weise Software GmbH
TextSettings.TextBottom:String
Specifies the text that is drawn on bottom of the bar.
TextSettings.TextCenter:String
Specifies the text that is drawn inside the bar.
Row:Pointer
Holds a reference pointer to the corresponding bar object.
Owner:Pointer
Holds a reference to the corresponding gantt chart object.
Successors:TList<TGanttBaseBar>
Provides a list of all directly connected bars that are successors.
Predecessor:TList<TGanttBaseBar>
Provides a list of all directly connected bars that are predecessors.
AllowVerticalDrag:Boolean
Read-only property. Text bars can be dragged from one row to another – therefore the property returns true.
AllowHorizontalDrag:Boolean
Read-only property. Text bars can be dragged horizontally in a row.
Hint:Boolean
Specifies whether the component should provide a hint for the text bar.
DefaultHint:Boolean
Specifies whether the DefaultHint or a user-defined hint (see HintTitle and HintDescription) will be used.
HintTitle:string
Specifies the title for the user defined hint.
HintDescription:string
Specifies the description for the user defined hint.
Objects of the type TGanttShadowTaskbar and TGanttShadowProgressBar are none interactive gantt bar objects.
They can be used to visualize additional information behind any other task bar object. The shadow bar objects have
been implemented in the gantt control component in order to be able to display multiple bar objects at the same
time range as the task bar object.
Shadow bars do not collide or interfere with other bar objects. When creating shadow bars on a row – it would be
recommended to increase the rows height in order to visualize the shadow bar, if it is behind a task bar.
As pointed out before, shadow bars cannot be deleted or modified by the user at runtime.
Properties
AllowResize:Boolean
Read only. Returns false for shadow bars.
AllowVerticalDrag:Boolean
Read only. Returns false for shadow bars.
AllowHorizontalDrag:Boolean
Read only. Returns false for shadow bars.
AllowMultiRow:Boolean
Gantt Control Component Developer Reference 45
Weise Software GmbH
SummaryBar (TGanttSummaryBar)
If one or multiple child rows do own at least a single task bar, progress bar or milestone bar object, a summary bar
will be automatically created for the parent row.
The summary bar starts at the earliest start date of all child bars
and ends at the latest end of all child bar objects. Changes made
to the child bars start date or end date, will force the
component to update the summary bar immediately.
It is possible to resize or move the entire summary bar for the end-user. If you delete the last bar object of a
summary bar, the summary bar itself will be removed from the component.
Furthermore, the end-user is able to connect a summary bar to another summary bar or a bar object.
Properties
AllowVerticalDrag:Boolean
Read-only property. Summary bars cannot be dragged from one row to another – therefore the property returns
false.
AllowHorizontalDrag:Boolean
Read-only property. Summary bars can be dragged horizontally in a row.
Data:Pointer
Each summary bar holds the Data pointer reference that may be used to point to any application specific user data
objects.
StartDate:TDateTime
The start date of the summary bar. In order to reschedule an entire summary bar, you may call the
RescheduleChilds(ABarStart, ABarEnd: TDateTime; AOpBars:Boolean=False) method.
EndDate:TDateTime
The end date of the summary bar. In order to reschedule an entire summary bar, you may call the
RescheduleChilds(ABarStart, ABarEnd: TDateTime; AOpBars:Boolean=False) method.
BarType:TGanttBarType = (btBaseBar, btTaskBar, btSummaryBar, btProgressBar, btMileStoneBar, btTextBar,
btImageBar, btShadowTaskBar, btShadowProgressBar, btPertBar)
For summary bars the BarType returns btSummaryBar.
HotTracked:Boolean
Returns true if the summary bar is currently hot tracked.
Selected:Boolean
Gantt Control Component Developer Reference 47
Weise Software GmbH
DefaultHint:Boolean
Specifies whether the DefaultHint or a user-defined hint (see HintTitle and HintDescription) will be used.
HintTitle:string
Specifies the title for the user defined hint.
HintDescription:string
Specifies the description for the user defined hint.
Selection (TGanttSelection)
When integrating the gantt chart component in your application, it is highly common that it is required to know
what bars or rows the user has selected or to select some bars by the application by code. The gantt chart
component provides the GanttChart.Selection object to handle and group methods and functions refering to the
selection of objects. Below is a list of properties and methods of the GanttChart.Selection object.
The component provides several lists of the selected objects. For rows the component distinguishes wheter a row
is fully selected – all cells of a row are selected – or partially selected – only some cells of the rows – are selected.
All fully selected rows are also part of the SelectedRowsPartial list.
SelectedCells : TList<TGanttCell>
Contains all selected cells.
SelectedRows : TList<TGanttRow>
Contains all fully selected rows. A row will only be part of the SelectedRows list, when all cells of the rows are
selected.
SelectedRowsPartial : TList<TGanttRow>
Contains all partial selected und fully selected rows. A partial selected row is a row that has at least a single selected
cell.
SelectedBars : TList<TGanttBaseBar>
Contains all selected bars, without pert bars.
SelectedBarsAndPertBars : TList<TGanttBaseBar>
Contains all selected bars and all selected part bars.
SelectedPertBars : TList<TGanttBaseBar>
Contains all selected pert bars.
The component uses generic list in order to return the selected objects. The code sample below shows, how you
can iterate easily through the list of the selected cells and set the cell color for each selected cell to clBlack.
1. procedure TForm1.IterateThroughSelectedCells;
2. var
3. aGanttCell : TGanttCell;
4. begin
6. begin
7. aGanttCell.Color := clBlack;
8. end;
9. end;
Below is a list of methods of the Selection object that allows the developer to manipulate the selection of objects:
Gantt Control Component Developer Reference 49
Weise Software GmbH
Deselect
Deselect all cells and rows.
DeselectBars
Deselect all bars.
SelectAll
Select all rows of the gantt chart.
SelectAllBars(ABarType:TGanttBarTypeSet)
Select all bars of the specified bar type. TGanttBarTypeSet is a set of the TGanttBarType = (btBaseBar, btTaskBar,
btSummaryBar, btProgressBar, btMileStoneBar, btTextBar, btImageBar, btShadowTaskBar, btShadowProgressBar,
btPertBar).
There are some predefined BarTypeSets defined that you may use.
TGanttBarTypeSet Elements
btScheduleBars [btTaskBar, btProgressBar, btMileStoneBar]
btNonScheduleBars [btTextBar, btImageBar, btShadowTaskBar, btShadowProgressBar ]
btShadowBars [btShadowTaskBar, btShadowProgressBar]
btAllBars […all bar types…]
The code sample below selects all taskbars and progress bars:
1. ...
2. GanttChart1.Selection.SelectAllBars([btTaskBar, btProgressBar]);
3. ...
TSelectionAddMode Description
omDefaultSelect Replaces the prior selection with new selected
objects.
omAddToSelection Adds the selected objects to the selected Ranges
array.
omMergeSelection The component will integrate the selected range into
the previously selected range.
SelectionMovePageDown
Moves the selection down one page.
SelectedBarsBarType(ABarType:TGanttBarTypeSet): TList<TGanttBaseBar>
Returns the selected bars specified by their type.
By default the end user is able to select various cells, providing the option to drag the SelectionFrame as shown
below:
The user is able to manipulate the range of the selected cells by dragging the small
square in the lower right corner.
If you click on a column header you will select all cells of the column. Accordingly if the user clicks a row indicator
cell, all cells of this row will be selected. If you click on the indicator columns header all cells of the gantt chart will
be selected.
The TGanttOptionsSelection object holds severall properties that makes it possible to customize the selection
behaviour of the component.
GanttChart.OptionsSelection.CellSelect:Boolean
If set to true the end user will be able to select single cells, otherwhise only entire rows will be selectable.
GanttChart.OptionsSelection.HeaderColumnQuickSelect:Boolean
If set to true the end user will be able to select cells of multiple columns, as he keeps the left mouse button pressed
and moves (drags) the mouse cursor over some column headers.
GanttChart.OptionsSelection.IndicatorRowQuickSelect:Boolean
If set to true the end user will be able to select cells of multiple rows, as he keeps the left mouse button pressed
and moves (drags) the mouse cursor over some indicator cells.
GanttChart.OptionsSelection.MultiSelect:Boolean
If set to true, the end-user will be able to select multiple objects. Depending on the
GanttChart.OptionsSelection.CellSelect property, he can either select multiple cells or multipl rows.
GanttChart.OptionsSelection.ShowSelectionFrame:Boolean
If set to true, the SelectionFrame is shown.
Undo (TGanttUndoRedoStack)
The component is fully undo- and redoable by default. Whenever an operation has manipulated data, properties of
objects or the structure a complete copy of the current component will be pushed on an undo stack. You may call
GanttChart.UndoRedoStack.Undo(); to restore the state of the component before the changes have been applied.
Furthermore you may be able to set the component to any prior stored state of the undo stack immediately.
If you have undone any changes, you may redo the changes.
By default the undo- and redo stack only stores the last 20 states of the component. Please keep in mind that a
single entry in the undo stack holds the entire copy of the component including all elements and their properties.
So it might be possible that a scenario where the gantt chart does have a large amount of rows or bars, may require
Gantt Control Component Developer Reference 52
Weise Software GmbH
some more memory. You can specifiy the undo and redo stack size. Also it is recommended to disable the
TGanttUndoRedoStack if you require the best performance for the component.
Below are the properties and methods of the TGanttUndoRedoStack of the component:
GanttChart.UndoRedoStack.MaxStackSize:Integer
The size of the undo and redo stack. Specifies how many actions can be undone or redone.
GanttChart.UndoRedoStack.Enabled:Boolean
Specifies whether the undo- and redo mechanism should be active or not. If the application that integrates the
gantt chart component does not provide and uses the inbuildt undo and redo methods, you can disable the
UndoRedoStack for a better performance.
GanttChart.UndoRedoStack.Clear
Clears the entire undo- and redo stack.
GanttChart.UndoRedoStack.BeginGroup
If you want to call multiple data sensitive operations at once, and you want the user to undo the changes at once,
you have to group the operations between a BeginGroup and EndGroup section.
GanttChart.UndoRedoStack.EndGroup
If you want to call multiple data sensitive operations at once, and you want the user to undo the changes at once,
you have to group the operations between a BeginGroup and EndGroup section.
GanttChart.UndoRedoStack.BlockUndo
If you want to make changes to the data of the component, and don’t want to make them undoable you have to
group the operation(s) between a BlockUndo() and EndBlockUndo() section.
GanttChart.UndoRedoStack.EndBlockUndo
EndBlockUndo() marks the end of an undo blocking section, started with BlockUndo().
GanttChart.UndoRedoStack.EndBlockUndoRestoreOldValue
EndBlockUndoRestoreOldValue() marks the end of an undo blocking section, started with BlockUndo(). If you use
EndBlockUndo() in a recursive call stack, it is recommended to use EndBlockUndoRestoreOldValue() instead of
EndBlockUndo().
GanttChart.UndoRedoStack.PushUndo(ACaption:String)
Stores the current state of the component in the undo stack of the component. Call PushUndo(ACaption:String)
before you apply any changes to the component, so that it is possible to undo the changes and restore the prior
state of the component. Caption describes the action you want to apply.
GanttChart.UndoRedoStack.PushRedo(ACaption:String)
Pushes the current state of the component on the RedoStack.
GanttChart.UndoRedoStack.Undo
Reverts the last command and restores the state of the component before the last operations have made changes
to the component.
GanttChart.UndoRedoStack.Undo(AIndex:integer)
Reverts the last commandos and set the component to a prior state. AIndex specifies the index in the UndoStack
that the component should be restored to.
GanttChart.UndoRedoStack.Redo
Reverts the effect of the last undo commando.
GanttChart.UndoRedoStack.Redo(AIndex:integer)
Reverts the effect of a last undo commando. AIndex specifies the index in the ReDoStack that the component will
be restored to.
GanttChartView (TGanttChartView)
Gantt Control Component Developer Reference 53
Weise Software GmbH
The GanttChartView record holds multiple basic options refering to visual aspects, the time mode, the scroll range
and the appearance of the progress bars. The time mode describes the time span the time scale will be segmented
into.
The following table shows the possible values for the time mode:
GanttCellWidth:integer
GanttCellWidth defines the width of the smallest time unit segment in pixel.
StartDate:TDateTime
The start date of the gantt chart view. Assigns a new start date in order to scroll the gantt chart horizontally.
EndDate:TDateTime (ReadOnly)
Depends on the GanttCellWidth and the width of the gantt chart itself. Use the read only EndDate property to
retrieve the start date of the (fully) last visible time segment that is displayed in the view range.
ScrollRangeStart:TDateTime
By default the end user is able to scroll horizontally without any boundaries throughout the gantt chart view.
However you can set a fixed scroll range. ScrollRangeStart specifies the start of the scroll range.
ScrollRangeEnd:TDateTime
By default the end user is able to scroll horizontally without any boundaries throughout the gantt chart view.
However you can set a fixed scroll range. ScrollRangeEnd specifies the end of the scroll range.
UseFixScrollRange:Boolean
If you want to set up a fixed scroll range, set UseFixScrollRange to true. Horizontally scrolling will then only be
possible within the specified scroll range.
SmoothScrolling:Boolean
If set to true, the component scrolls a little smoother horizontally.
ShowTimeScaleAtBottom:Boolean
If set to true, the defined time scales will be shown below the last gantt row.
ProgressBarView.Alignment: TProgressBarRowAlignment = (pbaTop, pbaBottom)
Specifies the position of progress bars within a gantt row.
Gantt Control Component Developer Reference 54
Weise Software GmbH
ProgressBarView.Height:integer
Specifies the height in pixel of the section that displays the progress bars within a row. Requires that the
ProgressBarView.HeightMode has been set to pbmFixedHeight.
ProgressBarView.HeightMode:TProgressBarHeightMode = ( pbmFixedHeight, pbmRatioRowHeight)
Specifies whether the absolute Height or the RatioRowHeight value will be used to determine the height of progress
bar section within a row.
The image shows a gantt row, where progress bars are shown
below task bars.
ProgressBarView.RatioRowHeight:integer
Specifies the ratio (0-100) between the height of the progress bar section and the task bar section. Requires that
the ProgressBarView.HeightMode has been set to pbmRatioRowHeight.
ProgressBarView.ShowGridProgressSplitLine:Boolean
If set to true a small horizontal line will be drawn between the progress bar section and the task bar section.
ProgressBarView.ShowProgressBars:Boolean
Specifies whether progress bars are shown within a gantt row.
DragNewBarType:TCreateNewBarType
The end user is able to create new bars by holding the left mouse button down and dragging a new object into a
row of the gantt chart. By default all new bars that will be inserted this way (by the user) are task bars. You can
specify a new value for the DrawNewBarType property in order to enable the end user to create another bar object.
The following table summarizes all possible bar types and their corresponding values:
TCreateNewBarType Description
nbTaskBar Task bars
nbProgressBar Progress bars
nbMileStoneBar Milestones
nbTextBar Text bars
nbImageBar Image bars
nbTaskBarorProgressBar Task bars and Progress Bars. Based on the y-position of the mouse
cursor either task bars or progress bars will be created.
OptionsBehaviour (TGanttOptionsBehaviour)
The OptionsBehaviour record holds multiple properties that defines how the end-user can interact with the gantt
chart component and what operations can be triggered or not.
OptionsBehaviour.ColumnResizing:Boolean
Specifies whether the end-user is able to resize the width of columns.
OptionsBehaviour.RowResizing:Boolean
Specifies whether the end user is able to resize the height of rows.
OptionsBehaviour.AutoFillCells:Boolean
If the user has selected a range of cells and expands the range vertically the component tries to auto fill the content
for the cells, if AutoFillCells has been set to true.
Please have a look at the example on the left: If the range of
the selected cells do have the sequence of ‘2’, ‘4’, ‘6’ as cell
values and the user expands the range, the component
automatically fills in the values ‘8’, ‘10’, 12’.
The component tries to detect linear series for numeric and
date values, day and month names. If no serie could be
detected it will copy the cell values for the new selected cells.
Gantt Control Component Developer Reference 55
Weise Software GmbH
OptionsBehaviour.RowDragging:Boolean
The end-user is able to reorder rows within its level of hierarchy. In order to drag a row to a new position. You have
to doubleclick in the indicator cell, hold the mouse button down and move the row to a new position.
OptionsBehaviour.ResizeMultipleRows:Boolean
Specifies whether the row height of all selected rows can be resized at once.
OptionsBehaviour.TreeCellEditOnTyping:Boolean
Specifies whether a key stroke will immediately set a cell in edit mode.
OptionsBehaviour.TreeCellEditOnEnter:Boolean
Specifies whether a cell will be set in edit mode when the end-user presses the [ENTER] key.
OptionsBehaviour.AddBars:Boolean
Specifies whether end-users are allowed to add new bar objects.
OptionsBehaviour.DeleteBars:Boolean
Specifies whether end-users are allowed to delete bar objects.
OptionsBehaviour.DeleteRows:Boolean
Specifies whether end-users are allowed to delete rows by selecting a row and pressing the [DEL] key.
OptionsBehaviour.InsertRows:Boolean
Specifies whether end-users are allowed to insert rows by selecting a row and pressing the [INSERT] key.
OptionsBehaviour.ModifyBars:Boolean
Specifies whether end-users are allowed to modify and reschedule bars.
OptionsBehaviour.AddConnections:Boolean
Specifies whether end-users are allowed to add connections between bar objects.
OptionsBehaviour.DeleteConnections:Boolean
Specifies whether end-users are allowed to delete connections between bar objects.
OptionsBehaviour.DeleteCellContent:Boolean
Specifies whether end-users are allowed to delete the content of selected cells by pressing then [DEL] key.
OptionsBehaviour.ApplyRowBestFitOnIndicatorDoubleClick:Boolean
Specifies whether end-users are allowed to apply a new best-fit heights for rows, by double clicking at the row
resizer in the indicator cell.
OptionsSchedule (TGanttOptionsSchedule)
OptionsSchedule holds some properties regarding the manipulation and rescheduling of bars.
SnapToTime : TSnapToTimeMode = (sttHours, sttDays)
When the SnapToTime property has been set to sttDays the bars will be automatically snapped to the start and the
end of a day. When set to sttHous bars can be reassigned to any time.
UpdateCriticalPath:Boolean
Specifies whether the critical path should be updated.
ScheduleBarsToWorkingTimes:Boolean
Gantt Control Component Developer Reference 56
Weise Software GmbH
When a bar is rescheduled and ScheduleBarsToWorking has been set to true, the component will automatically
reassign bars to always start on working times.
OptionsView (TGanttOptionsView)
The OptionsView record holds multiple options and properties regarding the visual appearance of the gantt chart
and its elements.
GridLineColor : TColor
The basic color for the grid lines. Grid lines are drawn between the cells and the day units of the gantt chart.
GridProgressSplitLineColor : TColor
The color for the progress bar split line within a gantt row.
GridLineBorderColor : TColor
The color for the outer border line of the gantt chart component.
DrawGridLinesSoft : Boolean
When set to true the component uses GridLineSoftColor to draw a color gradient for the start and the end of the
grid lines to apply a smoother look.
GridLineSoftColor : TColor
GridLineSoftColor is used as color value when drawing a color gradient for the start and the end of the grid lines.
Requires to set DrawGridLinesSoft to true.
SelectionRangeColor : TColor
The color that is used for drawing the border of the selected cell range and the focused column caption and focused
row numbers.
DefaultTaskBarOptions : TGanttDefaultTaskBarOptions
Specifies the visual settings for new created task bars. Requires DefaultTaskBarOptions.ApplyOptions has been set
to true.
DefaultProgressBarOptions : TGanttDefaultProgressBarOptions
Specifies the visual settings for new created progress bars. Requires DefaultProgressBarOptions.ApplyOptions has
been set to true.
DefaultMileStoneBarOptions : TGanttDefaultMileStoneBarOptions
Specifies the visual settings for new created milestone bars. Requires DefaultMileStoneBarOptions.ApplyOptions
has been set to true.
DefaultTextBarOptions : TGanttDefaultTextBarOptions
Specifies the visual settings for new created text bars. Requires DefaultTextBarOptions.ApplyOptions has been set
to true.
DefaultImageBarOptions : TGanttDefaultImageBarOptions
Specifies the visual settings for new created image bars. Requires DefaultImageBarOptions.ApplyOptions has been
set to true.
DefaultSummaryBarOptions : TGanttDefaultSummaryBarOptions
Specifies the visual settings for new created summary bars. Requires DefaultSummaryBarOptions.ApplyOptions has
been set to true.
DefaultCellOptions : TGanttDefaultCellOptions
Specifies the default color when a cell is created.
TaskBarMaxHeight : Boolean
Specifies the maximal height in pixel for task bars.
ProgressBarMaxHeight : Boolean
Specifies the maximal height in pixel for progress bars.
CriticalPathOptions : TCriticalPathOptions
Holds options for the appearance of the critical path.
Gantt Control Component Developer Reference 57
Weise Software GmbH
ShowBarButtons : Boolean
Specifies whether quick buttons on selected bars should be drawn or not.
NoDataToDisplay : String
Specifies the string that is displayed when the gantt chart component does not have any rows.
DefaultRowHeight : integer
Specifies the default row height.
ColorHot : TColor
Specifies the hot tracked color. The color is used to highlight objects that are currently under the mouse cursor.
ColorHotDarker : TColor
A secondary color for the ColorHot property.
ColorSelected : TColor
A Color that is used to draw the background of column headers for selected columns and the background of
indicator cells for selected rows.
ShowVerticalGridLines : Boolean
Specifies whether a vertical grid line should be drawn between each time unit of the gantt chart.
Calendar (TGanttCalendar)
The gantt chart control provides a calendar module that can be used to define and display special (working and
non-working) date exceptions, such as weekends or holidays. The calculation of the duration and the effective
duration (working times) of bars, is based on the definition of date exceptions of the calendar.
The component holds several calendar modules. Date Exceptions defined in the base calendar of the component
(GanttChart.BaseCalendar) are applied to all rows by default. However, it is possible to apply a unique RowCalendar
to a single row or a set of rows. In this case, the RowCalendar has a higher priority and the BaseCalendar will not be
interpreted. This provides the possibility to have applied different date exceptions to different rows.
A TGanttCalendar object holds an array of Categories (TGanttCalendar.Categorie[]). Each DateCategory provides
access to the DateExceptions and holds methods to add and delete DateExceptions.
Please note, that a single calendar cannot hold more than 255 date exceptions!
There are different date exception types, as it could be seen in the following table:
DateException Description
TDayException Define working or non-working hours for a day.
TWeekException Define working or non-working days or DayExceptions for a week.
TMonthException Define working or non-working days, DayExceptions for a month. Defines
working or non-working weeks or WeekExceptions for a month.
TYearException Defines working or non-working days or DayExceptions for a given date.
Defines working or non working weeks, WeekException or working/non-
working months.
TRecurringException Provides the possibility to define patterns for recurring DateExceptions.
A very import aspect of Date Exceptions is, that it is possible to define severall DateExceptions within other
DateExceptions. For example, you can define different MonthExceptions within a YearException – and the
MonthException holds 4 different WeekExceptios that are defined by DayExceptions. By structuring and using
recurring exceptions, it is possible to define complex scenarios.
The following code shows how to add a new DateCategory to the BaseCalendar and add a new YearException to it
and declare the 01.01.0217 as a non-working time.
A more complex scenario could look like the following sample of code:
1. procedure TForm1.AddExceptions;
2. var
3. WeekException1,
4. WeekException2 : TWeekException;
5. RecurringException : TRecurringException;
6.
7. DayException1,
8. DayException2 : TDayException;
9. begin
13.
16.
19.
24.
27. begin
31. end;
32. end;
The code above will add two different shifts to the gantt chart as shown below:
Gantt Control Component Developer Reference 59
Weise Software GmbH
DayExceptions (TDayException)
The day exception declares hourly working and non-working times.
Properties and Methods
WeekException (TWeekException)
ExceptionListCount:integer
Returns the total amount of exceptions defined by the DateException.
ExceptionList(ID:integer): TExceptionListElement
Provides access to an exception element.
GetCaption(const ADateTime:TDateTime):String
Returns the caption for a given time.
IsWorking(const ADateTime:TDateTime; const ADefault:Boolean):Boolean
Returns true, if the time specified by ADateTime is defined as working time.
GetException(const ADateTime:TDateTime): TBaseDateException
Returns the TBaseDateException element for a given time, otherwise it will return NIL.
Color:TColor
Defines the color for the exception.
Font:TFont
Holds a reference to the font object – that is used when drawing the caption.
ShowCaption:Boolean
Specifies whether the caption should be visible or not.
Visible:Boolean
Defines whether the DateException is visible or not. When set to false, the DateException still defines working and
non-working times for the gantt chart component.
MonthExceptions (TMonthException)
ExceptionList(ID:integer): TExceptionListElement
Provides access to an exception element.
GetCaption(const ADateTime:TDateTime):String
Returns the caption for a given time.
IsWorking(const ADateTime:TDateTime; const ADefault:Boolean):Boolean
Returns true, if the time specified by ADateTime is defined as working time.
GetException(const ADateTime:TDateTime): TBaseDateException
Returns the TBaseDateException element for a given time, otherwise it will return NIL.
Color:TColor
Defines the color for the exception.
Font:TFont
Holds a reference to the font object – that is used when drawing the caption.
ShowCaption:Boolean
Specifies whether the caption should be visible or not.
Visible:Boolean
Defines whether the DateException is visible or not. When set to false, the DateException still defines working and
non-working times for the gantt chart component.
YearException (TYearException)
RecurringException (TRecurringException)
For Exceptions that repeats in a certain chronological pattern you may use RecurringExceptions to define them.
RecurringException are always defined within a given time range.
Gantt Control Component Developer Reference 63
Weise Software GmbH
In the image above you see a calendar where a non-working time from Friday till Sunday is created and repeated
for the year 2017. The week exception repeats 5 times and is followed by a pause of 2 weeks. In order to create
such a calendar please use the code shown below:
1. procedure TForm1.AddExceptions;
2. var
3. WeekException : TWeekException;
4. RecException : TRecurringException;
5. begin
6.
7. WeekException := TWeekException.Create(GanttChart1.BaseCalendar);
9.
12.
14. begin
15. AddException(RecException)
16. end;
17. end;
Declare(AException:TBaseDateException)
Adds an Exception to the recurring exception. The Exception will repeat itself.
Declare(AException:TBaseDateException; ARecInfo : TRecurringInfo)
Adds an Exception to the recurring exception.
Declare(AException:TBaseDateException; FRepetition, FDistanceToPrior : integer; FDistanceUnit:TDistanceMode)
Adds an Exception to the recurring exception. FRepetition specifies the total number the exception will be repeated.
FDistanceToPrior specifies the distance in units set by the FDistanceUnit parameter, after the exception has been
repeated.
RecurringStartDate:TDateTime
Defines the start date of the first exception.
RangeEndDate:TDateTime
Gantt Control Component Developer Reference 64
Weise Software GmbH
DateCategorie(TDateCategory)
DateCategories are designed to manage and hold the DateExceptions. The list below shows the properties and
methods of the DateExceptions. If there are DateExceptions in different categories that overlap or share the same
date it is important to consider the order of the categories in the calendars category list. The date exceptions of the
category that is last in the category list will be displayed topmost within the gantt chart. Generally you should try
to avoid assigning a same date in different categories, as it is possible that there are contrary properties (working
and non-working) in each category.
Properties and Methods
AddDayException:TdayException
Adds a new DayException to the category.
AddWeekExcprion:TWeekException
Adds a new WeekException to the category.
AddMonthException:TMonthException
Adds a new MonthException to the category.
AddYearException:TyearException
Adds a new YearException to the category.
AddException(ADateException:TbaseDateException):Boolean
Gantt Control Component Developer Reference 65
Weise Software GmbH
Calendar (TGanttCalendar)
The calendar holds one or multiple DateCategories and provides methods for the calculation and checking of time,
regarding working- and non working times. The calendar uses an internal cache in order to precalculate working-
and non working times. By default the calendar has a cache size of 3650, whereby 1 entry hold information for a
single day and requires 52 byte per day.
The following table shows the properties of the Calendar object.
Properties and Methods
Categorie[I:Integer]:TdateCategory
Returns the DateCategorie given by the index i.
Delete(I:Integer; AReleaseExceptions:Boolean=true)
Deletes the specified DateCategory. If AReleaseException has been set to false, the component will not Release the
exceptions the categorie holds.
Add:TDateCategory
Adds a new DateCategory and returns a reference to it.
Add(Name:String):TDateCategory
Adds a new DateCategory, defines its name and returns a reference to it.
CategoryByName(AName: String): TDateCategory
Returns the first matching DateCatory specified by its name.
Clear
Clears the calendar and deletes all its content.
Count:integer
Returns the number of the DateCategorie objects.
GetWorkingTime2(AFrom:TDateTime; ATo:TDateTime):Double
Returns the effective working time for the date range AFrom till AFrom.
AddEffective2(AStart:TDateTime; AEffDuration:Double):TDateTime
Gantt Control Component Developer Reference 66
Weise Software GmbH
Adds an effective duration to the date AStart and returns the resulting date.
SubtEffective2(AStart:TDateTime; AEffDuration:Double):TDateTime
Substracts an effective time duration from the date AStart and returns the resulting date.
GetException(ADay:integer; AHour:Byte):TBaseDateException
Returns the DateException for the Day and the hour AHour.
DayHasException(ADay:integer):Boolean
Returns true if there is a matching date exception for the given day, otherwise the calendar will return false.
IsWorking(ADate:TDateTime):Boolean
Returns true, if the date ADate is defined as working, otherwhise it will return false.
IsWorking(ADate:TDateTime; var AException:TBaseDateException):Boolean
Returns true, if the date specified by the parameter date is defined as a working time and sets the corresponding
DateException as var parmeter AException.
IsWorkingFullDay(ADate:TDateTime):Boolean;
Returns true if the full day ‘ADate’ is defined as working time.
IsWorkingFullDay(ADate:TDateTime; var AException:TBaseDateException):Boolean
Returns true if the full day ‘ADate’ is defined as working time.
GetHours2(ADay:TDateTime; var ADayExeptionInfoArr:TDayExeptionInfoArr; var
ADayExWorkingInfoArr:TDayExWorkingInfoArr)
GetHours2 returns detailed information, it will set the ADayExceptionInfoArr and the ADayExWorkingInfoArr for
the given day ‘ADay’. Each DayException holds a unique integer ID from 0 to 255. The ADayExWorkingInfoArr does
have a length of 24 byte elements. Each element of the array holds the ID for the Exception that defines the hour.
The ADayExworkingInfoArr holds 24 boolean elements. If an element is false the corresponding hour is defined as
working time. If an element does have the value ‘true’ it is defined as a non-working hour. The first element in both
arrays represent the first hour of a day where the last element represent the last hour of a day.
1. uses ...ganttcalendar...;
2.
3. var
4. aDayException : TDayException;
5. ArrExceptions : TDayExeptionInfoArr;
6. ArrWorking : TDayExWorkingInfoArr;
7. i : integer;
8.
9. begin
10.
15.
17. for i := 0 to 23 do
18. begin
19. ArrExceptions[i] := 0;
21. end;
Gantt Control Component Developer Reference 67
Weise Software GmbH
22.
24.
25. end;
The code sample above creates a day exception for a given date (now) and defines the hours from 02.00 AM till
10.00 AM as non working times (code line 13). After that the arrays ArrException and ArrWorking are initilized and
the procedure GetHours2 is called for the given date. The array ArrException will hold the unique ID of the
exception. The array ArrWorking will return true for the element 2 up to 10 as shown below:
GetException(const ADateTime:TDateTime):TBaseDateException
Returns the exception for a specified DateTime value.
RowCalendarRepository:TGanttCalendarRepository
The gantt chart component enables the developer to define different calendars with different exceptions and apply
them to a single or a set of rows. The RowCalendarRepository is a place to hold and store the calendar objects you
want to create and define.
The image above shows a scenario where a base calendar is defined and additional a row calendar has been set up,
where the rows 2 till 6 are linked to the row calendar. The code below shows the creation process of the row
calendar object.
1. procedure DefineRowCalendar;
2. var
3. gRowCal : TGanttRowCalendar;
4. i:integer;
5. begin
6. gRowCal := GanttChart1.RowCalendarRepository.Add;
7. gRowCal.Add.AddWeekException.DeclareDayOfTheWeek('Fr,Sa,Su',5,7,false);
8. for i := 1 to 5 do
Gantt Control Component Developer Reference 68
Weise Software GmbH
9. GanttChart1.AbsoluteRow[i].RowCalendar := gRowCal;
10.
11. GanttChart1.Repaint;
12. end;
Each row object provides the function GetCalendar, that returns a reference to the calendar that is currently being
used by the component. If a RowCalendar has been assigned to a row it has a higher priority and will be used instead
of the BaseCalendar.
Critical Path
The gantt control component includes the calculation of the critical path. The calculation of the critical path
determines which tasks are critical and non-critical. When a task is critical any delay of this task will result in a delay
of the entire project. The critical path is the sequence of all critical tasks. Note that there can be more critical paths
than one.
A typical critical path contains usually a set of connected bars. As soon as the first task, that is represented by the
first bar, is delayed the second connected bar will be rescheduled, finally resulting in the rescheduling of the project
end date that is determined by the end of the last bar.
The following image displays a gantt chart that contains two critical paths (1,2,3) and (5) visualized by red framed
bars. In this example you can see that the only bar that will not reschedule the project end is bar (4) and therefore
is not part of the critical path.
In order to enable or disable the calculation of the critical path you can set the boolean UpdateCriticalPath property
of the OptionsSchedule record.
GanttChart.OptionsSchedule.UpdateCriticalPath:Boolean
The UpdateCriticalPath property will enable or disable the calculation of the underlying critical path data.
If you want to change the appearance of the critical path you can use the following properties:
GanttChart.OptionsView.CriticalPathOptions.Color:TColor
Specifies the color of the critical path.
GanttChart.OptionsView.CriticalPathOptions.PenStyle:TPenStyle
Specifies the pen style for the drawing of the critical path.
GanttChart.OptionsView.CriticalPathOptions.Visible:Boolean
Specifies whether the critical path should be visible or not.
Gantt Control Component Developer Reference 69
Weise Software GmbH
By default the calculation and the visualisation of the critical path is disabled. To decide whether a bar or a
connection is part of the critical path or not, you can access the boolean read only property
IsPartOfCriticalPath:Boolean
Furthermore the critical path includes the calculation of the earliest possible start date, the earliest possible finish
date, the latest possible start date and the latest possible end date without rescheduling any following bars. The
following properties summarizes those critical path data. Please note that you have to set the
GanttChart.OptionsSchedule.UpdateCriticalPath to true, in order to have those critical path data calculated.
TGanttBar.CPMData.EarliestStart:TDateTime
A datetime property defining the ealiest possible start time of a task/bar. The earliest starttime depends on the
connection ending at the bar. The task cannot start earlier because other tasks have to be finished/started first.
TGanttBar.CPMData.EarliestFinish:TDateTime
A datetime property defining the earliest finish time of a task. The earliest possible finish time of a task is calculated
by the earliest possible starttime and its duration.
TGanttBar.CPMData.LatestStart:TDateTime
A datetime property defining the latest possible start time of a task/bar. The latest starttime depends on the
connection starting from the bar. If the bar would be moved only one day later then the whole project ending date
would be delayed.
TGanttBar.CPMData.LatestFinish:TDateTime
A datetime property defining the latest possible finish time of a pert bar. The latest possible finish time of a task is
calculated by the latest possible start time and its duration.
TGanttBar.CPMData.LocalBuffer:TDateTime
A datetime property defining the free buffer of a task. The free buffer is the number of intermediate days etween
this bar and the earliest connected followed bar.
TGanttBar.CPMData.GlobalBuffer:TDateTime
A datetime property defining the global buffer of a task. The global buffer is the number of days that a task can
delay without influencing the final project endtime. If the global buffer is 0 then any delay of this bar/task would
extends the overall project time. If the global buffer is zero, then the according task/bar is part of the critical path.
The code below, demonstrates how to create a connection between two bars:
1. procedure MakeConnection;
2. var
3. Bar1,
4. Bar2 : TGanttBaseBar;
Gantt Control Component Developer Reference 70
Weise Software GmbH
5. Con : TBarConnection;
6. begin
7. Bar1 := GanttChart1.AbsoluteRow[0].Bar[0];
8. Bar2 := GanttChart1.AbsoluteRow[1].Bar[0];
9. // create a connection
10. GanttChart1.BeginUpdate;
11. try
14. finally
15. GanttChart1.EndUpdate;
16. end;
17. end;
Properties
The following list gives an overview of the properties of the TBarConnection object:
BarFromGUID: TGUID
Returns the GUID of the connected predecessor bar object.
BarToGUID : TGUID
Returns the GUID of the connected successor bar object.
ConnectionType : TBarConnectionType = (bcFinishToStart, bcStartToFinish, bcStartToStart, bcFinishToFinish)
Specifies the type of the connection. Basically there are four different types of connections, describing different
causal relations between two bars:
MinDistance : TDateTime
Gantt Control Component Developer Reference 71
Weise Software GmbH
HotTracked : Boolean
Returns true if the connection is currently beeing hot tracked.
Valid : Boolean
Returns true, if the two bars do not violate the causal restriction of a connection.
IsPartOfCriticalPath : Boolean
Returns true if the connection is part of the critical path.
Color : TColor
Specifies the color of the connection.
BarFrom:TGanttBaseBar
Returns the connected predecessor bar object.
BarTo:TGanttBaseBar
Returns the connected successor bar object.
Delete
Deletes the connection.
Create(AOwner:TComponent; ABarFrom, ABarTo : TGanttBaseBar; AConnectionType:TBarConnectionType)
The constructor of the TBarConnection object.
When the end user reschedules a bar in a row by horizontally dragging it to a new position, all connected bars are
automatically rescheduled immediately and the end user is able to see the resulting effects. While dragging a bar
the changes for the start, end and duration column are shown in the table for all affected bars. You can cancel the
rescheduling if you press the ‘ESC’ key at anytime.
By default all connected bars are rescheduled automatically when a bar will be repositioned. However you can
set the AutomaticScheduling property for a TGanttRow to false – in this case a bar will never be rescheduled
automatically by the component.
Pert chart
Gantt Control Component Developer Reference 72
Weise Software GmbH
Overview
The pert chart is another viewmode of the gantt chart that visualizes single tasks (rows) as pert bars. One Pert bar
represents a single row. The pert chart area does not have a time scale nor is it structured in rows. Two pert bars
can be connected with each other. The gantt chart view and the pert chart view share the same data source.
Therefore changes made in one view are represented in the other.
Within the pert chart the duration of the rows task bars as well as the earliest start date, the earliest end date, the
latest start date and the latest end date are visualized in the pert bars.
To model existing structures of a project, pert bars can be used too. Each pert bar is divided into three segments
and an optional list displaying additional items. Note: You can use the pert chart for structuring and segmenting
projects. Higher level project targets, sub ordinate project targets and work packages can be visualized and
modelled as pert bars. For example pert bars that represent working packages can be extended by a list of
responsible employees. To model relations between targets and working packages the pert chart supports
connecting pert bars with each other.
Please have a look of the following picture for an example of a hierarchical project structuring using pert bars.
Note: All pert bars shown in the example above have its PertBarType property set to pbtNoTimeSpan. If you intend
to use the pert bars for displaying critical time requirements, as the earliest start date, the earliest end date, the
latest start date and the latest end date of a task, you have to assign pbtTimeSpan for the PertBarType property.
The picture below shows pert bars displaying additional time span information.
Gantt Control Component Developer Reference 73
Weise Software GmbH
PertBarType ‘pbtNoTimeSpan’
PertBarType ‘pbtTimeSpan’
Properties / Methods
X:Integer
The x-position in pixel of the top left point of the pert bar.
Y:Integer
The y-position in pixel of the top left point of the pert bar.
Width:Integer
The width in pixel of the pert bar.
PertBarType : TPertBarSection= (pbtTimeSpan, pbtNoTimeSpan)
The type of the pert bar.
Detailed : Boolean
If detailed is set to true the additional setion of a pert bar will be shown.
Text : String
The text that is displayed in the main section of the pert bar.
TopSection : TPertBarSection
A reference to the top section of the pert bar.
MainSection: TPertBarSection
A reference to the main section of the pert bar.
BottomSection: TPertBarSection
A reference to the bottom section of the pert bar.
AdditionalSection: TPertBarSection
Gantt Control Component Developer Reference 74
Weise Software GmbH
Settings.Font: TFont
The font object for the section.
Color:TColor
The background color of the pert bars section.
Height:integer
The height in pixel of the pert bars section.
Width:integer
The width in pixel of the pert bars section.
Alignment:TAlignment
The alignment of the pert bars section.
TextAlignment:TAlignment
The text alignment of the pert bar section.
Text:String
The text of the pert bar section.
2. try
3. GanttChart1.BeginUpdate;
5. finally
6. GanttChart1.EndUpdate;
7. end;
8. ..
The code example above shows, how to add a pert bar to a row.
In order to delete a pert bar by code you may use the RemoveBar method as shown below:
1. ..
Gantt Control Component Developer Reference 75
Weise Software GmbH
2. try
3. GanttChart1.BeginUpdate;
4. GanttChart1.DataController.RemoveBar( GanttChart1.AbsoluteRow[2].PertBar );
5. finally
6. GanttChart1.EndUpdate;
7. end;
8. ..
1. ..
2. GanttChart1.DataController.AddConnection(GanttChart1.AbsoluteRow[2].PertBar,GanttChart1.Absolute
Row[3].PertBar,bcFinishToStart,false);
3. ..
GanttChart.PertChartView:TPertChartView
The gantt chart component holds several settings that are related to the pert chart view and are accessible by the
PertChartView class.
MaxWidth: Integer
The with of the pert chart area in pixel.
MaxHeight: Integer
The height of the pert chart area in pixel.
SpacingX: Integer
You can set up a pattern grid. SpacingX determines the horizontal distance between single dots of the pattern grid.
SpacingY:Integer
SpacingY determines the vertical distance between single dots of the pattern grid.
AutoCreatePertBars : Boolean
When set to true, the component will automatically add a new pert bar when a task bar is created.
AutoCreateNewRow : Boolean
When set to true, the component will automatically add a new gantt row, if the user creates a new pert bar and
there is no ‘empty’ ganttrow.
ShowPertGrid:Boolean
Determines whether the pattern grid will be shown or not.
PertGridColor:TColor
The color of the pattern grid.
PertCaption : string
A caption that is shown above the pert chart.
PertSubCaption:string
A secondary caption that is shown above the pert chart.
DragPertBarType:TCreateNewPertBarType = (nbPertBarTimeSpan, nbPertBarNoTimeSpan)
Specifies the new type of the pert bar that will be created.
Gantt Control Component Developer Reference 76
Weise Software GmbH
Print Preview
Overview
The gantt chart component comes along with a print preview component The print preview is highly adabtable and
allows the specification of lots of parameters (zoom, pagination, page title, background image…).
In addition a legend that is segmented into rows and columns can be attached to the gantt chart for printing. Each
cell can contain text or images. Furthermore the print preview provides the possibility to set up a page header and
page footer, that is segmented into three areas.
The following image gives an overview of the Print Preview and describes the most relevant parts:
Item Description
1 The tool button section including buttons for printing, setup the page, add
additional legends and images as well as navigating through the pages.
2 A section where the user can adjust the zoom factor of the print preview. This
zoom factor is only relevant for the preview itself and does not effect the printed
result.
3 Additionaly the user can save the current settings into a print profile. At this
section the user is able to load/save/delete an existing print profile.
4 The print button, that initiates the print process.
5 A section where the user can specify the printer, the page layout and the
orientation.
6 The preview of the gantt chart component. Here you can see the areas for the
page header, the title area and the page footer.You may double click directly at a
section, to edit its properties. In addition you can drag the small dotted lines and
adjust the margins for the page and for the different sections.
7 A section where thumbnails for single pages are shown.
8 A section where basic settings of the gantt chart can be adjusted to influence the
print.
9 Scaling options for the document.
10 A button that invokes a dialog where the user can specify the printable columns.
Gantt Control Component Developer Reference 77
Weise Software GmbH
In order to invoke the Print Preview you may call the statement that is shown below:
1. ..
2. GanttPrintPreview1.ShowPreview();
3. ..
If you want to print the content without having shown any preview you may call the ShowPrintDlg() method as
shown below.
4. ..
5. GanttPrintPreview1.ShowPrintDlg();
6. ..
Here you can see the selected printer, the page format and
its orientation. On the lower left the user can specify the
page borders.
On the top right section the user can specify the scaling
options, inlcuding to set a scale factor, adjust to n page
widths/ page heights or to fit the content to a single page.
At this point the page header and the page footer can be
defined. Header and footer are divided into three sections.
At the top of the dialog is a preview of the header and
footer.
For each segment of the page header and footer you can
either type in some text or load an image that is displayed
inside the segment. Also you can insert auto text fields into
single segments. Auto text fields are responsible for
displaying the current page number, the current time and
so on.
Gantt Chart
Gantt Control Component Developer Reference 79
Weise Software GmbH
The user can add images to the print preview. Images can
be fully scaled and positioned everywhere on the print
area.
For each image it may be possible to define a page corner
where the image is aligned to.
TGanttPrintPreview.PageSettings
GanttRangeStart : TDateTime
The start date of the gantt chart.
GanttRangeEnd : TDateTime
The end date of the gantt chart.
BorderColor : TColor
Specifies the color of the border.
BorderWidth : Integer
Gantt Control Component Developer Reference 80
Weise Software GmbH
If set to true the component will try to prevent breaking the content of a column when a page break occurs.
ShowTimeScaleAtBottom : Boolean
If set to true the timescale(s) will be shown below the gantt chart.
Header.LeftSection: TFooterHeaderSectionSettings
Holds properties of the left page header section.
Header.CenterSection: TFooterHeaderSectionSettings
Holds properties of the center page header section.
Header.RightSection: TFooterHeaderSectionSettings
Holds properties of the right page header section.
Footer.LeftSection: TFooterHeaderSectionSettings
Holds properties of the left page footer section.
Footer.CenterSection: TFooterHeaderSectionSettings
Holds properties of the center page footer section.
Footer.RightSection: TFooterHeaderSectionSettings
Holds properties of the right page footer section.
Title : TTitleSettings
Title properties.
Background: TBackgroundSettings
Properties defining the layout and style of the background.
ColumnsOnEachPage : TStrings
A list of columns that are displayed on each page.
HeaderOnEachPage : Boolean
Specifies whether the header should be shown on each page.
OverlayImages : TOverlayImages
Provides access to a list to overlay images.
SaveProfileOnPreviewClose : Boolean
Saves the page settings when the print preview is closed.
ProjectName : String
The project name.
ProjectNr : String
The project number.
Date : String
Current date.
TFooterHeaderSectionSettings
IsImage : Boolean
Returns true if the content of the section is an image.
HorzAlignment : TAlignment
The horizontal alignment of the content.
VertAlignment : TVerticalAlignment
The vertical alignment of the content.
Font : TFont
The font object of the page header or page footer section.
Color : TColor
Gantt Control Component Developer Reference 82
Weise Software GmbH
Legend:TGanttLegend
To display any textual and graphical information you can create a legend. The legend will be displayed below or
right next to the gantt chart. The architecture of a legend is based on a grid-like structure, including a set of rows
(#1) and cells (#2) that are added to a row as shown in the picture below.
The interface provides access to cells canvas – so it’s possible to draw some images (#3) to a cell or to draw some
textual information (#4). Please note that a row does not need to have cells at all. Also each row can own a different
amount of legend cells. Furthermore there is the possibility to assign a different horizontal alignment for each row.
Also you can define borders (#5) surrounding cells. A border can be applied to a range of legend cells that is defined
by the start row, the start cell, the end row and the end cell.
The following table shows the most relevant operations and properties of the legend.
TGanttLegendRow
Height : integer
Returns the height of a legend row.
Alignment : TGanttRowAlignment = (tgRALeft, tgRARight, tgRACenter, tgRAStretch)
The horizontal alignment of all cells within this row.
TGanttRowAlignment Alignment
tgRALeft Left justify
tgRARight Right justify
tgRACenter Center
tgRAStretch The cells are splitted; specified by the SplitAt position.
SplitAt : integer
All cells that’s ID is lesser or equal then the SplitAt property, are displayed left aligned the rest of the cell is right
aligned. You have to set tgRAStretch to the row alignment.
RowIndex : integer
Returns the row index.
Clear
Removes all cells of the row.
Width : integer
Returns the width of the row.
GetCellRect(ID:integer; ARect:TRect):TRect
Returns the cell rect of the specified cell.
AddCell:TGanttLegendCell
Adds a new cell to the row and returns a reference to it.
Cell[i:integer] : TGanttLegendCell
Provides access to the cells of a legend row.
CellCount:integer
Returns the total number of cells the row owns.
TGanttLegendCell
Width : integer
Gantt Control Component Developer Reference 84
Weise Software GmbH
The following code example demonstrates, how to create a simple legend add two new rows and add a border. The
resulting legend is shown below.
1. ...
2. GanttChart1.Legend.Clear;
3.
4. with GanttChart1.Legend.AddRow do
5. begin
6. Color := clWhite;
7. Alignment := tgRALeft;
8. with AddCell do
9. begin
12. end;
13. end;
14.
16. begin
18. SplitAt := 0;
19.
21. begin
24. end;
25.
27. begin
30. end;
31. end;
32.
34. begin
35. StartRow := 0;
36. StartCell := 0;
37. EndRow := 1;
38. EndCell := 1;
40. Thickness := 2;
41. end;
42. ...
Localization
The Gantt Control Component version 3.0 is available for the both languages German and English. The following
table shows all functions and methods defined in the ganttresources.pas unit.
If you want to localize the component for an english user interface simply add the unit ganttresources to the uses
clause of your main form and call the CreateDefaultRessources_ENG method.
Function Description
SetRessourceString(ResStringRec: Localizes a single language depentent string value.
pResStringRec; NewStr: string);
CreateDefaultRessources_GER Localizes the Gantt Control Component for the German language.
Gantt Control Component Developer Reference 86
Weise Software GmbH
CreateDefaultRessources_ENG Localizes the Gantt Control Component for the English languages.
You can overwrite any existing RessourceString element with a new translation anytime.
The following table summarizes all language dependent ressource strins and their value for the English language.
1. SetRessourceString(@grs_rownoteedit, 'Edit row note');
2. SetRessourceString(@grs_input, 'Input');
3. SetRessourceString(@grs_sort, 'Sort');
4. SetRessourceString(@grs_filter, 'Filtering');
19.
24.
27.
34.
39.
46.
49. // TfrmGanttPrintForm
51. SetRessourceString(@grs_printer,'Printer');
58.
59. // TfrmPrintProgress
61.
62. // TfrmRenameProfile
65.
66. // TfrmSaveProfil
70.
71. //TfrmColumnsSelect
74.
75. //TPageSetupDlg
102.
118.
122.
126.
139.
160.
170.
171. //TfrmGanttPrintPreview_2
190.
196.
211.
216.
221.
222. // ganttbarconnections.pas
225.
226. // ganttbarinfopanel.pas
228.
229. // ganttbasebars.pas
235.
236. //ganttcolumns.pas
238.
239. //ganttconsts.pas
241.
242. //ganttdatacontroler.pas
245. SetRessourceString(@grs_warn_downgrade, 'By downgrading, the row %s will be converted into a sum
mary row. This row already contains planed activities. Do you want to replace them with a summar
y row?');
246.
247. //ganttdrawer.pas
250.
251. // ganttprintpreview.pas
253.
Gantt Control Component Developer Reference 92
Weise Software GmbH
254. // ganttrows.pas
261.
262. //ganttsuite.pas
272. SetRessourceString(@grs_pertchart,'PERTCHARTVIEW');
274. //
276.
279. SetRessourceString(@grs_create_con1_hnt,'Click the button and move the mouse to another bar to c
reate a connection');
281. SetRessourceString(@grs_create_con2_hnt,'Click the button and move the mouse to another bar to c
reate a connection');
Events
The Gantt Control Components defines severall events that are accessible by Delphi. To access an event please
select the TGanttChart component in the delphi formular designer and press [F11] to focus the Object inspector.
After that please select the tab sheet “events”. Here you can see all the events to component provides.
The following table shows all events of the gantt chart component and a brief description.
OnAfterBarAdd(Bar: TGanttBaseBar)
The OnAfterBarAdd event is fired after a bar has been added to the component by code or per user interaction.
OnAfterBarChangeRow(Bar: TGanttBaseBar)
The event OnAfterBarChangeRow is fired when a bar has been moved vertically to a new row.
OnAfterBarDelete(Sender: TObject)
Gantt Control Component Developer Reference 93
Weise Software GmbH
The event OnAfterBarDelete will be triggered after a bar has been deleted.
OnAfterBarMove(Bar: TGanttBaseBar)
The event OnAfterBarMove will be triggered after a bar has been moved.
OnAfterBarResize(Bar: TGanttBaseBar)
The event OnAfterBarResize will be triggered after a bar has been resized.
OnAfterConnectionAdd(Connection: TBarConnection)
The event OnAfterConnectionAdd will be triggered after a connection has been added.
OnAfterConnectionDelete(Sender: TObject)
The event OnAfterConnectionDelete will be triggered after a connection has been deleted.
OnAfterDragNewBar(Bar: TGanttBaseBar)
The event OnAfterDragNewBar will be raised after the user has created and dragged a new bar.
The event OnBeforeBarResize will be raised before a bar will be resized. You can cancel the action if you set true
to the Cancel parameter.
The event OnColumnFiltered will be raised when a column filter has been applied.
OnCustomDrawBar (Bar: TGanttBaseBar; OpBar: Boolean; ACanvas: TCanvas; ARect: TRect; var ADone:
Boolean)
The event OnCustomDrawBar will be raised when a bar object is drawn by the component. You can use the
OnCustomDrawBar event to customize and implement your own drawing mechanism for bar objects. Bar holds
a reference to the bar object that is drawn. OpBar is true for the drawing of temporal bars that visualizes a
preview of modified bars. For example if you move a bar with the mouse to a new start date both a temporal
bar and the bar itself will be drawn. The ACanvas parameter provides access to the bars canvas. ARect specifies
the extension of the bar in pixel. ADone must be set to true after you have finished your own drawing routine.
OnDragOver (Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean)
The event will be raised if the user drags an object over the gantt chart component.
OnMouseWheel (Sender: TObject; Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint; var Handled:
Boolean)
The event OnMouseWhell will be raised when the mouse wheel has been scrolled/modifed.
OnMouseWheelDown (Sender: TObject; Shift: TShiftState; MousePos: TPoint; var Handled: Boolean)
The event OnMouseWheelDown will be raised when the mouse wheel will be scrolled downwards.
OnMouseWheelUp (Sender: TObject; Shift: TShiftState; MousePos: TPoint; var Handled: Boolean)
Gantt Control Component Developer Reference 98
Weise Software GmbH
The event OnMouseWheelUp will be raised when the mouse wheel will be scrolled upwards.