2357
|
Specify the size of the Columns panel

with G2antt1 do
begin
BeginUpdate();
HeaderHeight := 24;
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
with Columns do
begin
Add('City');
(IUnknown(Add('Start')) as EXG2ANTTLib_TLB.Column).Visible := False;
(IUnknown(Add('End')) as EXG2ANTTLib_TLB.Column).Visible := False;
end;
ColumnsFloatBarRect := ',,96';
ColumnsFloatBarVisible := Integer(EXG2ANTTLib_TLB.exColumnsFloatBarVisibleAsChild) Or Integer(EXG2ANTTLib_TLB.exColumnsFloatBarVisibleIncludeCheckColumns);
EndUpdate();
end
|
2356
|
Show a vertical line between pivot and Columns panel (EBN color)

with G2antt1 do
begin
BeginUpdate();
VisualAppearance.Add(1,'gBFLBCJwBAEHhEJAAEhABRsIQAAYAQGKIYBkAKBQAGaAoDDUNQxQwAAxwfBMKgBBCLIxhEYobgmGIXRpFICQTIcBhaGIZRiAKCRTDmHwyRCNIwCLD8QxtDqBY4gOZZXh' +
'al4cJTgMaBYi+Pw3DZHcbvBRkewzHQAKgnSjoDhEMg1CTVVYTDKdOSzDyEX7sIAACpOIZQVJVEY1VT8cyxIyEZimSypWqiYJ0Ty6cQwTAIgI');
Background[EXG2ANTTLib_TLB.exColumnsFloatBackColor] := $1000000;
HeaderHeight := 24;
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
with Columns do
begin
Add('City');
(IUnknown(Add('Start')) as EXG2ANTTLib_TLB.Column).Visible := False;
(IUnknown(Add('End')) as EXG2ANTTLib_TLB.Column).Visible := False;
end;
ColumnsFloatBarVisible := Integer(EXG2ANTTLib_TLB.exColumnsFloatBarVisibleAsChild) Or Integer(EXG2ANTTLib_TLB.exColumnsFloatBarVisibleIncludeCheckColumns);
EndUpdate();
end
|
2355
|
Change the background of the Columns panel (EBN color)

with G2antt1 do
begin
BeginUpdate();
VisualAppearance.Add(1,'gBFLBCJwBAEHhEJAAEhABNoCg6AADACAxRDAMgBQKAAzQFAYahqGKGAAGOD4JhUAIIRZGMIjFDcEwxC6NIpAWLoJDCH4mSTHYxgJIMWwzDiBZgkCA4fiGEYnThCIxzTJ' +
'0aw1CKbYRAKCUKoUAJFsSnQAJIgOO4lULPMIhDDQKQTIKBahoehqIhaEQyDSJNb2DCIahhMSEbKtCooDhGFZUWzLVxTJJNawHJqJJDuOTpSjKH4+RjWFKUXR9b4BJSNA' +
'gqeCQTiSWZEVxRUS0XbGCyZLSQY7uAAMKgOVoDYzdGLwHTtOwrMa1QAsDSbKqWZ5uRpHcQ5aAGN5DPbMbqwOaqLznAaLQLtG4RTikVRPTDYaj437+OaHGyNbI6HTNPpT' +
'lWDJWjYXI8l8C4fg6GYAAEEISgGJJGHQOocgyIwYnqKhYAAIQTH2MYRjQJBRAmZptmEAYIjGU5dk8UgOFgBJUgCTQIBYBoBmCCAmAqApghgDJUDmYQFCCZoEk2OBUm+B' +
'ZPCgZgagaYZIHYHoHmGWBcm8NwiEiFJVgmYgji4Kg6GKSI2C6C5jAiRgygwIojiycINkyeJmAYPJjkiTg+g+ZAIkCdIQkyWQWDuDxkBkJhKguZAzlIRQzGQc5ODWFJlE' +
'kVhWhWZYJFYTYTmUE4yF6F5mAmBhihiZhJhYX4WmQaAUnWGpOlmNhuhuZwJkYcocmcSY4naHZlkmKhrDuJ5JnYfofmgCgGgKIJnlmXJ2h4TQKBosRokoNoOiOaQKDSd4' +
'kmiChMncPBpgoZoaiaaZKHaHonmmE5iiKJRpDicomimaoKiaKoqmqSoeiIPgogqPotiyaxKlYPA+GuCqbBMa5KnaPovmwCwGj6LgP24RIhiyCwmkqMpsksNpKD6LQLBq' +
'OIzi0SxWlaHZtAOahPssM5Wi+IYtlsXpijKbZ5lyTo5mAE4UlqOpjHOQpEjubyanKPJvEuNgVj2TY1CCao+k2G52AyP5wAwBp9DYZZ1CCaxsAABAEICA');
Background[EXG2ANTTLib_TLB.exColumnsFloatBackColor] := $1000000;
HeaderHeight := 24;
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
with Columns do
begin
Add('City');
(IUnknown(Add('Start')) as EXG2ANTTLib_TLB.Column).Visible := False;
(IUnknown(Add('End')) as EXG2ANTTLib_TLB.Column).Visible := False;
end;
ColumnsFloatBarVisible := Integer(EXG2ANTTLib_TLB.exColumnsFloatBarVisibleAsChild) Or Integer(EXG2ANTTLib_TLB.exColumnsFloatBarVisibleIncludeCheckColumns);
EndUpdate();
end
|
2354
|
Change the background of the Columns panel (solid color)

with G2antt1 do
begin
BeginUpdate();
HeaderHeight := 24;
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
with Columns do
begin
Add('City');
(IUnknown(Add('Start')) as EXG2ANTTLib_TLB.Column).Visible := False;
(IUnknown(Add('End')) as EXG2ANTTLib_TLB.Column).Visible := False;
end;
ColumnsFloatBarVisible := Integer(EXG2ANTTLib_TLB.exColumnsFloatBarVisibleAsChild) Or Integer(EXG2ANTTLib_TLB.exColumnsFloatBarVisibleIncludeCheckColumns);
Background[EXG2ANTTLib_TLB.exColumnsFloatBackColor] := $f0f0f0;
EndUpdate();
end
|
2353
|
Change the visual appearance of the Columns panel

with G2antt1 do
begin
BeginUpdate();
VisualAppearance.Add(1,'gBFLBCJwBAEHhEJAAEhABNoCg6AADACAxRDAMgBQKAAzQFAYahqGKGAAGOD4JhUAIIRZGMIjFDcEwxC6NIpAWLoJDCH4mSTHYxgJIMWwzDiBZgkCA4fiGEYnThCIxzTJ' +
'0aw1CKbYRAKCUKoUAJFsSnQAJIgOO4lULPMIhDDQKQTIKBahoehqIhaEQyDSJNb2DCIahhMSEbKtCooDhGFZUWzLVxTJJNawHJqJJDuOTpSjKH4+RjWFKUXR9b4BJSNA' +
'gqeCQTiSWZEVxRUS0XbGCyZLSQY7uAAMKgOVoDYzdGLwHTtOwrMa1QAsDSbKqWZ5uRpHcQ5aAGN5DPbMbqwOaqLznAaLQLtG4RTikVRPTDYaj437+OaHGyNbI6HTNPpT' +
'lWDJWjYXI8l8C4fg6GYAAEEISgGJJGHQOocgyIwYnqKhYAAIQTH2MYRjQJBRAmZptmEAYIjGU5dk8UgOFgBJUgCTQIBYBoBmCCAmAqApghgDJUDmYQFCCZoEk2OBUm+B' +
'ZPCgZgagaYZIHYHoHmGWBcm8NwiEiFJVgmYgji4Kg6GKSI2C6C5jAiRgygwIojiycINkyeJmAYPJjkiTg+g+ZAIkCdIQkyWQWDuDxkBkJhKguZAzlIRQzGQc5ODWFJlE' +
'kVhWhWZYJFYTYTmUE4yF6F5mAmBhihiZhJhYX4WmQaAUnWGpOlmNhuhuZwJkYcocmcSY4naHZlkmKhrDuJ5JnYfofmgCgGgKIJnlmXJ2h4TQKBosRokoNoOiOaQKDSd4' +
'kmiChMncPBpgoZoaiaaZKHaHonmmE5iiKJRpDicomimaoKiaKoqmqSoeiIPgogqPotiyaxKlYPA+GuCqbBMa5KnaPovmwCwGj6LgP24RIhiyCwmkqMpsksNpKD6LQLBq' +
'OIzi0SxWlaHZtAOahPssM5Wi+IYtlsXpijKbZ5lyTo5mAE4UlqOpjHOQpEjubyanKPJvEuNgVj2TY1CCao+k2G52AyP5wAwBp9DYZZ1CCaxsAABAEICA');
Background[EXG2ANTTLib_TLB.exColumnsFloatAppearance] := $1000000;
Background[EXG2ANTTLib_TLB.exColumnsFloatCaptionBackColor] := $f6f6f6;
BackColorHeader := $1000000;
HeaderHeight := 24;
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
with Columns do
begin
Add('City');
(IUnknown(Add('Start')) as EXG2ANTTLib_TLB.Column).Visible := False;
(IUnknown(Add('End')) as EXG2ANTTLib_TLB.Column).Visible := False;
end;
Description[EXG2ANTTLib_TLB.exColumnsFloatBar] := 'Show/Hide';
ColumnsFloatBarVisible := EXG2ANTTLib_TLB.exColumnsFloatBarVisibleIncludeCheckColumns;
EndUpdate();
end
|
2352
|
Defines the symbol used to indicate repeated captions, providing a clear visual cue for identical entries (ditto mark)

with G2antt1 do
begin
BeginUpdate();
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
HeaderHeight := 24;
DrawGridLines := EXG2ANTTLib_TLB.exRowLines;
(IUnknown(Columns.Add('Country')) as EXG2ANTTLib_TLB.Column).ShowIdem := '<fgcolor gray>〃';
with Items do
begin
AddItem('Spain');
AddItem('Spain');
AddItem('Spain');
AddItem('Spain');
AddItem('Germany');
AddItem('Germany');
AddItem('Germany');
AddItem('Germany');
end;
EndUpdate();
end
|
2351
|
Defines the symbol used to indicate repeated captions, providing a clear visual cue for identical entries (space)

with G2antt1 do
begin
BeginUpdate();
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
HeaderHeight := 24;
DrawGridLines := EXG2ANTTLib_TLB.exRowLines;
(IUnknown(Columns.Add('Country')) as EXG2ANTTLib_TLB.Column).ShowIdem := ' ';
with Items do
begin
AddItem('Spain');
AddItem('Spain');
AddItem('Spain');
AddItem('Spain');
AddItem('Germany');
AddItem('Germany');
AddItem('Germany');
AddItem('Germany');
end;
EndUpdate();
end
|
2350
|
Displays a glitch funnel for drop-down filter buttons (empty or active)

with G2antt1 do
begin
BeginUpdate();
with VisualAppearance do
begin
RenderType := -1;
Add(1,'gBFLBCJwBAEHhEJAAEhABa8IQAAYAQGKIYBkAKBQAGaAoDDUNQxQwAAxwfBMKgBBCLIxhEYobgmGIXRpFMbxCKQahLEiTIhGUYJHgmK4tRiAUgxVDkBxrECZYqjcBZOi' +
'wLQ2TxDM7DNKUCBnIoABhGOaYDh+IQNQjUFKwTRFGRxK4EIRKAyTDLQdRyGSMMbjdQpBCbMiMRqhESKRq2UwYRYCFS1NalaztO6BUAvK67YrWez/YBfF+SfwGeqDYReW' +
'APfgWERnQrGMLxbD8KwZAKTRjkGJ4XhuB41TbQMqufL9ByXHKSSDpGjaXjeO5VVjYNAvS69UzXNq3bhtQAOXCMEwCgI=');
Add(2,'CP:1 -2 0 0 0');
end;
DrawGridLines := EXG2ANTTLib_TLB.exAllLines;
GridLineStyle := EXG2ANTTLib_TLB.exGridLinesGeometric;
ShowFocusRect := False;
Background[EXG2ANTTLib_TLB.exHeaderFilterBarButton] := $2000000;
Background[EXG2ANTTLib_TLB.exHeaderFilterBarActive] := $2000001;
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
BackColorHeader := RGB(255,255,255);
HeaderHeight := 24;
HeaderVisible := EXG2ANTTLib_TLB.exHeaderVisibleExtendLevels;
with (IUnknown(Columns.Add('1st col')) as EXG2ANTTLib_TLB.Column) do
begin
DisplayFilterButton := True;
DisplayFilterPattern := False;
Filter := 'Item B';
FilterType := EXG2ANTTLib_TLB.exFilter;
end;
Columns.Add('2nd col');
with Items do
begin
AddItem('Item A');
AddItem('Item B');
AddItem('Item C');
end;
ApplyFilter();
EndUpdate();
end
|
2349
|
Stack vs Cascade

with G2antt1 do
begin
BeginUpdate();
ScrollBySingleLine := True;
HeaderAppearance := EXG2ANTTLib_TLB.Flat;
Columns.Add('Type');
BackColorAlternate := RGB(240,240,240);
with Chart do
begin
LevelCount := 2;
AllowCreateBar := EXG2ANTTLib_TLB.exCreateBarAuto;
AllowLinkBars := False;
ResizeUnitScale := EXG2ANTTLib_TLB.exHour;
PaneWidth[False] := 128;
FirstVisibleDate := '1/1/2001';
with Bars.Copy('Task','T1') do
begin
OverlaidType := EXG2ANTTLib_TLB.exOverlaidBarsCascade;
Def[EXG2ANTTLib_TLB.exBarCaption] := '<%=%9%>';
end;
with Bars.Copy('Task','T2') do
begin
OverlaidType := Integer(EXG2ANTTLib_TLB.exOverlaidBarsStackAutoArrange) Or Integer(EXG2ANTTLib_TLB.exOverlaidBarsStack);
Def[EXG2ANTTLib_TLB.exBarCaption] := '<%=%9%>';
end;
end;
with Items do
begin
h := AddItem('Cascade');
AddBar(h,'T1','1/2/2001','1/4/2001','A1',Null);
AddBar(h,'T1','1/3/2001','1/5/2001','A2',Null);
AddBar(h,'T1','1/4/2001','1/7/2001','A3',Null);
AddBar(h,'T1','1/2/2001','1/7/2001','A4',Null);
AddBar(h,'T1','1/8/2001','1/12/2001','A5',Null);
AddBar(h,'T1','1/8/2001','1/12/2001','A6',Null);
AddBar(h,'T1','1/8/2001','1/12/2001','A7',Null);
AddBar(h,'T1','1/8/2001','1/12/2001','A8',Null);
AddBar(h,'T1','1/8/2001','1/12/2001','A9',Null);
AddBar(h,'T1','1/8/2001','1/12/2001','AA',Null);
h := AddItem('Stack-AutoArrange');
AddBar(h,'T2','1/2/2001','1/4/2001','A1',Null);
AddBar(h,'T2','1/3/2001','1/5/2001','A2',Null);
AddBar(h,'T2','1/4/2001','1/7/2001','A3',Null);
AddBar(h,'T2','1/2/2001','1/7/2001','A4',Null);
AddBar(h,'T2','1/8/2001','1/12/2001','A5',Null);
AddBar(h,'T2','1/8/2001','1/12/2001','A6',Null);
AddBar(h,'T2','1/8/2001','1/12/2001','A7',Null);
AddBar(h,'T2','1/8/2001','1/12/2001','A8',Null);
AddBar(h,'T2','1/8/2001','1/12/2001','A9',Null);
AddBar(h,'T2','1/8/2001','1/12/2001','AA',Null);
end;
EndUpdate();
end
|
2348
|
Horizontally(left) align the multi-line caption of the bar

with G2antt1 do
begin
BeginUpdate();
Columns.Add('Task');
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
with Chart do
begin
FirstVisibleDate := '1/1/2001';
PaneWidth[False] := 128;
LevelCount := 2;
end;
with Items do
begin
SelectableItem[AddItem(Null)] := False;
h := AddItem('Task 1');
ItemHeight[h] := 42;
AddBar(h,'Task','1/2/2001','1/7/2001','K1','This is a bit of 1''st line<br>2''nd line<br>3''rd line');
ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(0);
end;
EndUpdate();
end
|
2347
|
Defines the colors, to display overlapping links

with G2antt1 do
begin
BeginUpdate();
Columns.Add('Name');
AntiAliasing := True;
OverlapLinksColors := 'black,gray,lightgray';
with Chart do
begin
LevelCount := 2;
FirstVisibleDate := '12/28/2000';
PaneWidth[False] := 64;
ShowLinks := Integer(EXG2ANTTLib_TLB.exChangeColorOnOverlap) Or Integer(EXG2ANTTLib_TLB.exPreventOverlapMixt) Or Integer(EXG2ANTTLib_TLB.exShowDefaultLinks);
NonworkingDays := 0;
LinksStyle := EXG2ANTTLib_TLB.exLinkSolid;
end;
with Items do
begin
AddItem('');
h1 := AddItem('Item 1');
AddBar(h1,'Task','1/3/2001','1/6/2001','A',Null);
AddBar(h1,'Task','1/8/2001','1/11/2001','B',Null);
AddBar(h1,'Task','1/13/2001','1/16/2001','C',Null);
AddBar(h1,'Task','1/18/2001','1/21/2001','D',Null);
AddLink('Link1',h1,'D',h1,'A');
AddLink('Link2',h1,'C',h1,'B');
end;
EndUpdate();
end
|
2346
|
The exPreventOverlapMixt option can be combined with the exChangeColorOnOverlap flag, allowing overlapping links to alternately adjust their width while also changing colors

with G2antt1 do
begin
BeginUpdate();
Columns.Add('Name');
AntiAliasing := True;
with Chart do
begin
LevelCount := 2;
FirstVisibleDate := '12/28/2000';
PaneWidth[False] := 64;
ShowLinks := Integer(EXG2ANTTLib_TLB.exChangeColorOnOverlap) Or Integer(EXG2ANTTLib_TLB.exPreventOverlapMixt) Or Integer(EXG2ANTTLib_TLB.exShowDefaultLinks);
NonworkingDays := 0;
LinksStyle := EXG2ANTTLib_TLB.exLinkSolid;
end;
with Items do
begin
AddItem('');
h1 := AddItem('Item 1');
AddBar(h1,'Task','1/3/2001','1/6/2001','A',Null);
AddBar(h1,'Task','1/8/2001','1/11/2001','B',Null);
AddBar(h1,'Task','1/13/2001','1/16/2001','C',Null);
AddBar(h1,'Task','1/18/2001','1/21/2001','D',Null);
AddLink('Link1',h1,'D',h1,'A');
AddLink('Link2',h1,'C',h1,'B');
end;
EndUpdate();
end
|
2345
|
The exChangeColorOnOverlap flag changes the color for links in areas where they overlap with other links, enhancing clarity and distinction between them

with G2antt1 do
begin
BeginUpdate();
AntiAliasing := True;
Columns.Add('Name');
with Chart do
begin
LevelCount := 2;
FirstVisibleDate := '12/28/2000';
PaneWidth[False] := 64;
ShowLinks := Integer(EXG2ANTTLib_TLB.exChangeColorOnOverlap) Or Integer(EXG2ANTTLib_TLB.exShowDefaultLinks);
NonworkingDays := 0;
LinksStyle := EXG2ANTTLib_TLB.exLinkSolid;
end;
with Items do
begin
AddItem('');
h1 := AddItem('Item 1');
AddBar(h1,'Task','1/3/2001','1/6/2001','A',Null);
AddBar(h1,'Task','1/8/2001','1/11/2001','B',Null);
AddBar(h1,'Task','1/13/2001','1/16/2001','C',Null);
AddBar(h1,'Task','1/18/2001','1/21/2001','D',Null);
AddLink('Link1',h1,'D',h1,'A');
AddLink('Link2',h1,'C',h1,'B');
end;
EndUpdate();
end
|
2344
|
How can I assign a multiple-lines caption to an bar

with G2antt1 do
begin
BeginUpdate();
Columns.Add('Task');
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
with Chart do
begin
FirstVisibleDate := '1/1/2001';
PaneWidth[False] := 128;
LevelCount := 2;
end;
with Items do
begin
SelectableItem[AddItem(Null)] := False;
h := AddItem('Task 1');
ItemHeight[h] := 42;
AddBar(h,'Task','1/2/2001','1/7/2001','K1',Null);
ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarCaption] := 'This is a bit of 1''st line<br>2''nd line<br>3''rd line';
end;
EndUpdate();
end
|
2343
|
The text on the chart overlap the rest of the bars, while using OverlaidType property on exOverlaidBarsStack

with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
PaneWidth[False] := 48;
FirstVisibleDate := '1/3/2002';
LevelCount := 2;
FirstWeekDay := EXG2ANTTLib_TLB.exMonday;
Bars.Add('Text').Def[EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(0);
with Bars.Item['Task'] do
begin
Def[EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(0);
OverlaidType := Integer(EXG2ANTTLib_TLB.exOverlaidBarsIncludeCaption) Or Integer(EXG2ANTTLib_TLB.exOverlaidBarsStackAutoArrange) Or Integer(EXG2ANTTLib_TLB.exOverlaidBarsStack);
OverlaidGroup := 'Text,Task';
end;
end;
Columns.Add('Task');
with Items do
begin
h := AddItem('Default');
AddBar(h,'Text','1/4/2002','1/4/2002','','This is another text');
AddBar(h,'Task','1/6/2002','1/8/2002','A','This is a bit of text');
end;
EndUpdate();
end
|
2342
|
We are running our application on an Azure server using RDP, with the server language set to English. However, my client has their national language set to Swedish, but the tooltip is displaying dates in the English format (mm/dd/yyyy) instead of the Swedish format (yyyy-mm-dd) (method 2)

with G2antt1 do
begin
BeginUpdate();
Columns.Add('Def');
with Chart do
begin
AllowCreateBar := EXG2ANTTLib_TLB.exNoCreateBar;
PaneWidth[False] := 64;
LevelCount := 2;
FirstVisibleDate := '1/1/2010';
Bars.Item['Task'].Def[EXG2ANTTLib_TLB.exBarToolTip] := '<%=`Start: ` + (date(%1) format `yyyy-MM-dd` )%>';
end;
with Items do
begin
h := AddItem('Task');
AddBar(h,'Task','1/2/2010','1/5/2010','A','A');
AddBar(h,'Task','1/5/2010','1/8/2010','B','B');
end;
EndUpdate();
end
|
2341
|
We are running our application on an Azure server using RDP, with the server language set to English. However, my client has their national language set to Swedish, but the tooltip is displaying dates in the English format (mm/dd/yyyy) instead of the Swedish format (yyyy-mm-dd) (method 1)

with G2antt1 do
begin
BeginUpdate();
Columns.Add('Def');
with Chart do
begin
AllowCreateBar := EXG2ANTTLib_TLB.exNoCreateBar;
PaneWidth[False] := 64;
LevelCount := 2;
FirstVisibleDate := '1/1/2010';
Bars.Item['Task'].Def[EXG2ANTTLib_TLB.exBarToolTip] := '<%=`Start: ` + year(%1) + `-` + (month(%1) lpad `00`) + `-` + (day(%1) lpad `00`)%>';
end;
with Items do
begin
h := AddItem('Task');
AddBar(h,'Task','1/2/2010','1/5/2010','A','A');
AddBar(h,'Task','1/5/2010','1/8/2010','B','B');
end;
EndUpdate();
end
|
2340
|
How can I replace or add an icon at runtime

with G2antt1 do
begin
BeginUpdate();
ReplaceIcon('gAAAABgYACEHgUJFEEAAWhUJCEJEEJggEhMCYEXjUbjkJQECj8gj8hAEjkshYEpk8kf8ClsulsvAExmcvf83js5nU7nkCeEcn8boMaocXosCB9Hn09pkzcEuoL/fE+Ok' +
'YB0gB9YhIHrddgVcr9aktZADAD8+P8CgIA==',Null);
ReplaceIcon('C:\images\favicon.ico',OleVariant(0));
Columns.Add('Task');
with Chart do
begin
FirstVisibleDate := '1/1/2001';
PaneWidth[False] := 128;
LevelCount := 2;
end;
with Items do
begin
h := AddItem('Task 1');
AddBar(h,'Task','1/2/2001','1/6/2001','K1',Null);
ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarCaption] := '<img>1</img>';
end;
EndUpdate();
end
|
2339
|
How can I define the sensitivity for link selection when the user clicks or selects a link
// MouseMove event - Occurs when the user moves the mouse.
procedure TForm1.G2antt1MouseMove(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer);
begin
with G2antt1 do
begin
OutputDebugString( Chart.LinkFromPoint[-1,-1] );
end
end;
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Task');
with Chart do
begin
FirstVisibleDate := '12/29/2000';
PaneWidth[False] := 64;
LevelCount := 2;
LinksWidth := 1026;
end;
with Items do
begin
h1 := AddItem('Task 1');
AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null);
AddItem(Null);
h2 := AddItem('Task 2');
AddBar(h2,'Task','1/8/2001','1/10/2001','K2',Null);
AddLink('L1',h1,'K1',h2,'K2');
AddItem(Null);
h3 := AddItem('Task 3');
AddBar(h3,'Task','1/14/2001','1/16/2001','K3',Null);
AddLink('L2',h2,'K2',h3,'K3');
end;
EndUpdate();
end
|
2338
|
How can I let the user to create task-bars for leaf0-items only, when AllowCreateBar is exCreateBarAuto
// CreateBar event - Fired when the user creates a new bar.
procedure TForm1.G2antt1CreateBar(ASender: TObject; Item : HITEM;DateStart : TDateTime;DateEnd : TDateTime);
begin
with G2antt1 do
begin
with Items do
begin
OutputDebugString( 'Call RemoveBar if the ChildCount property returns a non-zero value' );
OutputDebugString( ChildCount[Item] );
RemoveBar(Item,'newbar');
end;
end
end;
with G2antt1 do
begin
BeginUpdate();
LinesAtRoot := EXG2ANTTLib_TLB.exLinesAtRoot;
HeaderVisible := EXG2ANTTLib_TLB.exHeaderVisibleExtendLevels;
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
with Chart do
begin
AllowCreateBar := EXG2ANTTLib_TLB.exCreateBarAuto;
LevelCount := 2;
PaneWidth[False] := 128;
end;
Columns.Add('Task');
with Items do
begin
h := AddItem('Root');
InsertItem(h,Null,'Child 1');
InsertItem(h,Null,'Child 2');
ExpandItem[h] := True;
end;
EndUpdate();
end
|
2337
|
How can I convert the exBarStart/exBarEnd property to a string (by default it returns as VARIANT/VT_DATE type, method 3)

// BarResizing event - Occurs when a bar is moving or resizing.
procedure TForm1.G2antt1BarResizing(ASender: TObject; Item : HITEM;Key : OleVariant);
begin
with G2antt1 do
begin
OutputDebugString( 'Start' );
OutputDebugString( Key );
OutputDebugString( Items.ItemBar[Item,OleVariant(Key),EXG2ANTTLib_TLB.exBarStartStr] );
OutputDebugString( 'End' );
OutputDebugString( Key );
OutputDebugString( Items.ItemBar[Item,OleVariant(Key),EXG2ANTTLib_TLB.exBarEndStr] );
end
end;
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Tasks');
Debug := True;
with Chart do
begin
FirstVisibleDate := '9/20/2006';
LevelCount := 2;
PaneWidth[False] := 96;
ResizeUnitScale := EXG2ANTTLib_TLB.exMinute;
end;
with Items do
begin
AddBar(AddItem('Task 1'),'Task','9/21/2006','9/24/2006','K1',Null);
AddBar(AddItem('Task 2'),'Task','9/22/2006','9/25/2006','K2',Null);
AddBar(AddItem('Task 3'),'Task','9/23/2006','9/26/2006','K3',Null);
end;
EndUpdate();
end
|
2336
|
How can I convert the exBarStart/exBarEnd property to a string (by default it returns as VARIANT/VT_DATE type, method 2)

// BarResizing event - Occurs when a bar is moving or resizing.
procedure TForm1.G2antt1BarResizing(ASender: TObject; Item : HITEM;Key : OleVariant);
begin
with G2antt1 do
begin
OutputDebugString( 'Start' );
OutputDebugString( Key );
OutputDebugString( FormatABC('dateF(value)',Items.ItemBar[Item,OleVariant(Key),EXG2ANTTLib_TLB.exBarStart],Null,Null) );
OutputDebugString( 'End' );
OutputDebugString( Key );
OutputDebugString( FormatABC('dateF(value)',Items.ItemBar[Item,OleVariant(Key),EXG2ANTTLib_TLB.exBarEnd],Null,Null) );
end
end;
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Tasks');
Debug := True;
with Chart do
begin
FirstVisibleDate := '9/20/2006';
LevelCount := 2;
PaneWidth[False] := 96;
ResizeUnitScale := EXG2ANTTLib_TLB.exMinute;
end;
with Items do
begin
AddBar(AddItem('Task 1'),'Task','9/21/2006','9/24/2006','K1',Null);
AddBar(AddItem('Task 2'),'Task','9/22/2006','9/25/2006','K2',Null);
AddBar(AddItem('Task 3'),'Task','9/23/2006','9/26/2006','K3',Null);
end;
EndUpdate();
end
|
2335
|
How can I convert the exBarStart/exBarEnd property to a string (by default it returns as VARIANT/VT_DATE type, method 1)

// BarResizing event - Occurs when a bar is moving or resizing.
procedure TForm1.G2antt1BarResizing(ASender: TObject; Item : HITEM;Key : OleVariant);
begin
with G2antt1 do
begin
OutputDebugString( 'Start' );
OutputDebugString( Key );
OutputDebugString( FormatABC('date(value) format `MM/dd/yyyy HH:mm:ss`',Items.ItemBar[Item,OleVariant(Key),EXG2ANTTLib_TLB.exBarStart],Null,Null) );
OutputDebugString( 'End' );
OutputDebugString( Key );
OutputDebugString( FormatABC('date(value) format `MM/dd/yyyy HH:mm:ss`',Items.ItemBar[Item,OleVariant(Key),EXG2ANTTLib_TLB.exBarEnd],Null,Null) );
end
end;
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Tasks');
Debug := True;
with Chart do
begin
FirstVisibleDate := '9/20/2006';
LevelCount := 2;
PaneWidth[False] := 96;
ResizeUnitScale := EXG2ANTTLib_TLB.exMinute;
end;
with Items do
begin
AddBar(AddItem('Task 1'),'Task','9/21/2006','9/24/2006','K1',Null);
AddBar(AddItem('Task 2'),'Task','9/22/2006','9/25/2006','K2',Null);
AddBar(AddItem('Task 3'),'Task','9/23/2006','9/26/2006','K3',Null);
end;
EndUpdate();
end
|
2334
|
Add/Remove/Updates the item-bar's resources

// Click event - Occurs when the user presses and then releases the left mouse button over the tree control.
procedure TForm1.G2antt1Click(ASender: TObject; );
begin
with G2antt1 do
begin
with Items do
begin
h := SelectedItem[0];
ItemBar[h,FirstItemBar[h],EXG2ANTTLib_TLB.exBarResources] := '+R4[10%]';
end;
end
end;
with G2antt1 do
begin
BeginUpdate();
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
HeaderHeight := 24;
with Chart do
begin
PaneWidth[False] := 96;
LevelCount := 2;
FirstVisibleDate := '1/1/2001';
with Bars.Item['Task'] do
begin
Def[EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(18);
Def[EXG2ANTTLib_TLB.exBarCaption] := '<%=%49%>';
end;
end;
Columns.Add('Machines');
with Items do
begin
h := AddItem('Machine 1');
AddBar(h,'Task','1/6/2001','1/12/2001','K1',Null);
ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarResources] := 'R1,R2';
h := AddItem('Machine 2');
AddBar(h,'Task','1/4/2001','1/14/2001','K2',Null);
ItemBar[h,'K2',EXG2ANTTLib_TLB.exBarResources] := 'R2[75%],R3';
end;
EndUpdate();
end
|
2333
|
Distributes resources to a bar

with G2antt1 do
begin
BeginUpdate();
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
HeaderHeight := 24;
with Chart do
begin
PaneWidth[False] := 96;
LevelCount := 2;
FirstVisibleDate := '1/1/2001';
with Bars.Item['Task'] do
begin
Def[EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(18);
Def[EXG2ANTTLib_TLB.exBarCaption] := '<%=%49%>';
end;
end;
Columns.Add('Machines');
with Items do
begin
h := AddItem('Machine 1');
AddBar(h,'Task','1/6/2001','1/12/2001','K1',Null);
ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarResources] := 'R1,R2';
h := AddItem('Machine 2');
AddBar(h,'Task','1/4/2001','1/14/2001','K2',Null);
ItemBar[h,'K2',EXG2ANTTLib_TLB.exBarResources] := 'R2[75%],R3';
end;
EndUpdate();
end
|
2332
|
How can I display additional information about a time zone when the user clicks on it (expandable)

with G2antt1 do
begin
with Chart do
begin
PaneWidth[False] := 0;
LevelCount := 2;
FirstVisibleDate := '12/20/2009';
MarkTimeZone('TZ','1/1/2010','1/3/2010',OleVariant(65280),'1;;<c>TimeZone<b><off -4><a ;exp=just more info about>*</a></b>;1');
end;
end
|
2331
|
How can I have a tooltip for a marked TimeZone

// MouseMove event - Occurs when the user moves the mouse.
procedure TForm1.G2antt1MouseMove(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer);
begin
with G2antt1 do
begin
ShowToolTip(Chart.TimeZoneFromPoint[-1,-1],'',Null,'+8',Null);
end
end;
with G2antt1 do
begin
with Chart do
begin
PaneWidth[False] := 0;
LevelCount := 2;
FirstVisibleDate := '12/28/2009';
MarkTimeZone('Top','1/1/2010','1/5/2010',OleVariant(16711680),'1;;<fgcolor=FFFFFF>Top;1');
MarkTimeZone('Partial','1/8/2010','1/12/2010',OleVariant(16711680),'50;;<fgcolor=FFFFFF>Partial;1');
MarkTimeZone('Default','1/15/2010','1/19/2010',OleVariant(16711680),';;<fgcolor=FFFFFF>Default;1');
end;
end
|
2330
|
Can I set a filter that automatically adds a * before and after the word, so the user can just search for 'cat' and it becomes '*cat*' automatically

with G2antt1 do
begin
BeginUpdate();
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
HeaderHeight := 24;
LinesAtRoot := EXG2ANTTLib_TLB.exLinesAtRoot;
with (IUnknown(Columns.Add('Items')) as EXG2ANTTLib_TLB.Column) do
begin
DisplayFilterButton := True;
DisplayFilterPattern := True;
Def[EXG2ANTTLib_TLB.exFilterPatternTemplate] := '*<%filter%>*';
FilterType := EXG2ANTTLib_TLB.exPattern;
Filter := '1';
end;
with Items do
begin
h := AddItem('Root 1');
InsertItem(h,Null,'Child 1');
InsertItem(h,Null,'Child 2');
ExpandItem[h] := True;
h := AddItem('Root 2');
InsertItem(h,Null,'Child 1');
InsertItem(h,Null,'Child 2');
end;
ApplyFilter();
EndUpdate();
end
|
2329
|
The fine dotted lines in the control appear much thicker than the standard ones we've been using. How can we fix this

with G2antt1 do
begin
BeginUpdate();
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
HeaderHeight := 24;
DrawGridLines := EXG2ANTTLib_TLB.exAllLines;
GridLineStyle := EXG2ANTTLib_TLB.exGridLinesGeometric;
with Chart do
begin
GridLineStyle := EXG2ANTTLib_TLB.exGridLinesGeometric;
DrawGridLines := EXG2ANTTLib_TLB.exAllLines;
end;
ColumnAutoResize := False;
Columns.Add('Column 1');
Columns.Add('Column 2');
Columns.Add('Column 3');
Columns.Add('Column 4');
EndUpdate();
end
|
2328
|
Load data as a tree using a parent-id relationship

with G2antt1 do
begin
BeginUpdate();
ColumnAutoResize := False;
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
HeaderHeight := 24;
DrawGridLines := EXG2ANTTLib_TLB.exVLines;
LinesAtRoot := EXG2ANTTLib_TLB.exLinesAtRoot;
rs := (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('ADODB.Recordset'))) as ADODB_TLB.Recordset);
with rs do
begin
Open('Select * FROM Employees WHERE 1=0','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.mdb',3,3,Null);
end;
DataSource := (IUnknown(rs) as ADODB_TLB.Recordset);
Columns.Item[OleVariant(0)].Width := 128;
rs := (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('ADODB.Recordset'))) as ADODB_TLB.Recordset);
with rs do
begin
Open('Employees','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.mdb',3,3,Null);
end;
PutItems(rs.GetRows(Null,Null,Null),';0;17');
Items.ExpandItem[0] := True;
EndUpdate();
end
|
2327
|
Is there a way to change the contents of the drop down editor based on a value in another column

// AddItem event - Occurs after a new Item has been inserted to Items collection.
procedure TForm1.G2antt1AddItem(ASender: TObject; Item : HITEM);
begin
with G2antt1 do
begin
Items.CellEditorVisible[OleVariant(Item),OleVariant(0)] := EXG2ANTTLib_TLB.exEditorVisible;
Items.CellEditorVisible[OleVariant(Item),OleVariant(1)] := EXG2ANTTLib_TLB.exEditorVisible;
end
end;
// EditOpen event - Occurs when the edit operation starts.
procedure TForm1.G2antt1EditOpen(ASender: TObject; );
begin
with G2antt1 do
begin
with Items do
begin
v := CellValue[OleVariant(FocusItem),OleVariant(0)];
c := CellCaption[OleVariant(FocusItem),OleVariant(0)];
end;
with Columns.Item[OleVariant(1)].Editor do
begin
ClearItems();
AddItem(v,c,Null);
end;
end
end;
with G2antt1 do
begin
BeginUpdate();
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
HeaderHeight := 24;
GridLineStyle := EXG2ANTTLib_TLB.exGridLinesGeometric;
with (IUnknown(Columns.Add('DropDownList')) as EXG2ANTTLib_TLB.Column) do
begin
with Editor do
begin
EditType := EXG2ANTTLib_TLB.DropDownListType;
AddItem(1,'First',Null);
AddItem(2,'Second',Null);
AddItem(3,'Third',Null);
end;
end;
DrawGridLines := EXG2ANTTLib_TLB.exAllLines;
(IUnknown(Columns.Add('DropDownList-Related')) as EXG2ANTTLib_TLB.Column).Editor.EditType := EXG2ANTTLib_TLB.DropDownListType;
with Items do
begin
CellValue[OleVariant(AddItem(OleVariant(1))),OleVariant(1)] := OleVariant(-1);
CellValue[OleVariant(AddItem(OleVariant(2))),OleVariant(1)] := OleVariant(-1);
CellValue[OleVariant(AddItem(OleVariant(3))),OleVariant(1)] := OleVariant(-1);
LockedItemCount[EXG2ANTTLib_TLB.exBottom] := 1;
h := LockedItem[EXG2ANTTLib_TLB.exBottom,0];
ItemDivider[h] := 0;
ItemDividerLineAlignment[h] := EXG2ANTTLib_TLB.DividerTop;
CellEditorVisible[OleVariant(h),OleVariant(0)] := EXG2ANTTLib_TLB.exEditorHidden;
CellSingleLine[OleVariant(h),OleVariant(0)] := EXG2ANTTLib_TLB.exCaptionWordWrap;
CellValueFormat[OleVariant(h),OleVariant(0)] := EXG2ANTTLib_TLB.exHTML;
CellValue[OleVariant(h),OleVariant(0)] := 'The drop down editor in the second column is filled during the <b>EditOpen event</b>, and the values are based on the selection ' +
'on the first column.';
end;
EndUpdate();
end
|
2326
|
Highlight the editable fields

// Change event - Occurs when the user changes the cell's content.
procedure TForm1.G2antt1Change(ASender: TObject; Item : HITEM;ColIndex : Integer;var NewValue : OleVariant);
begin
with G2antt1 do
begin
Refresh();
end
end;
with G2antt1 do
begin
FreezeEvents(True);
BeginUpdate();
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
HeaderHeight := 24;
LinesAtRoot := EXG2ANTTLib_TLB.exLinesAtRoot;
with ConditionalFormats do
begin
with Add('%CE1',Null) do
begin
Bold := True;
BackColor := $f5f5f5;
ApplyTo := EXG2ANTTLib_TLB.FormatApplyToEnum($1);
end;
with Add('%CE2',Null) do
begin
Bold := True;
BackColor := $f5f5f5;
ApplyTo := EXG2ANTTLib_TLB.FormatApplyToEnum($2);
end;
with Add('%CE3',Null) do
begin
Bold := True;
BackColor := $f5f5f5;
ApplyTo := EXG2ANTTLib_TLB.FormatApplyToEnum($3);
end;
end;
with Columns do
begin
Add('Description');
with (IUnknown(Add('Qty')) as EXG2ANTTLib_TLB.Column) do
begin
Editor.EditType := EXG2ANTTLib_TLB.SpinType;
Def[EXG2ANTTLib_TLB.exTotalColumn] := 'sum(current,rec,%1)';
end;
with (IUnknown(Add('Price')) as EXG2ANTTLib_TLB.Column) do
begin
Def[EXG2ANTTLib_TLB.exTotalColumn] := 'avg(current,rec,%2)';
Editor.EditType := EXG2ANTTLib_TLB.SpinType;
end;
with (IUnknown(Add('Amount')) as EXG2ANTTLib_TLB.Column) do
begin
ComputedField := '%1 * %2';
Def[EXG2ANTTLib_TLB.exTotalColumn] := 'sum(current,rec,%3)';
end;
end;
with Items do
begin
r := AddItem('Root');
g1 := InsertItem(r,Null,'Group 1');
h := InsertItem(g1,Null,'Item 1');
CellValue[OleVariant(h),OleVariant(1)] := OleVariant(1);
CellValue[OleVariant(h),OleVariant(2)] := OleVariant(10);
h := InsertItem(g1,Null,'Item 2');
CellValue[OleVariant(h),OleVariant(1)] := OleVariant(2);
CellValue[OleVariant(h),OleVariant(2)] := OleVariant(11);
g2 := InsertItem(r,Null,'Group 2');
h := InsertItem(g2,Null,'Item 1');
CellValue[OleVariant(h),OleVariant(1)] := OleVariant(3);
CellValue[OleVariant(h),OleVariant(2)] := OleVariant(12);
h := InsertItem(g2,Null,'Item 2');
CellValue[OleVariant(h),OleVariant(1)] := OleVariant(4);
CellValue[OleVariant(h),OleVariant(2)] := OleVariant(13);
ExpandItem[0] := True;
end;
EndUpdate();
FreezeEvents(False);
end
|
2325
|
Highlight the total fields

// Change event - Occurs when the user changes the cell's content.
procedure TForm1.G2antt1Change(ASender: TObject; Item : HITEM;ColIndex : Integer;var NewValue : OleVariant);
begin
with G2antt1 do
begin
Refresh();
end
end;
with G2antt1 do
begin
FreezeEvents(True);
BeginUpdate();
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
HeaderHeight := 24;
LinesAtRoot := EXG2ANTTLib_TLB.exLinesAtRoot;
with ConditionalFormats do
begin
with Add('%CT1',Null) do
begin
ForeColor := $808080;
ApplyTo := EXG2ANTTLib_TLB.FormatApplyToEnum($1);
end;
with Add('%CT2',Null) do
begin
ForeColor := $808080;
ApplyTo := EXG2ANTTLib_TLB.FormatApplyToEnum($2);
end;
with Add('%CT3',Null) do
begin
ForeColor := $808080;
ApplyTo := EXG2ANTTLib_TLB.FormatApplyToEnum($3);
end;
end;
with Columns do
begin
Add('Description');
with (IUnknown(Add('Qty')) as EXG2ANTTLib_TLB.Column) do
begin
Editor.EditType := EXG2ANTTLib_TLB.SpinType;
Def[EXG2ANTTLib_TLB.exTotalColumn] := 'sum(current,rec,%1)';
end;
with (IUnknown(Add('Price')) as EXG2ANTTLib_TLB.Column) do
begin
Def[EXG2ANTTLib_TLB.exTotalColumn] := 'avg(current,rec,%2)';
Editor.EditType := EXG2ANTTLib_TLB.SpinType;
end;
with (IUnknown(Add('Amount')) as EXG2ANTTLib_TLB.Column) do
begin
ComputedField := '%1 * %2';
Def[EXG2ANTTLib_TLB.exTotalColumn] := 'sum(current,rec,%3)';
end;
end;
with Items do
begin
r := AddItem('Root');
g1 := InsertItem(r,Null,'Group 1');
h := InsertItem(g1,Null,'Item 1');
CellValue[OleVariant(h),OleVariant(1)] := OleVariant(1);
CellValue[OleVariant(h),OleVariant(2)] := OleVariant(10);
h := InsertItem(g1,Null,'Item 2');
CellValue[OleVariant(h),OleVariant(1)] := OleVariant(2);
CellValue[OleVariant(h),OleVariant(2)] := OleVariant(11);
g2 := InsertItem(r,Null,'Group 2');
h := InsertItem(g2,Null,'Item 1');
CellValue[OleVariant(h),OleVariant(1)] := OleVariant(3);
CellValue[OleVariant(h),OleVariant(2)] := OleVariant(12);
h := InsertItem(g2,Null,'Item 2');
CellValue[OleVariant(h),OleVariant(1)] := OleVariant(4);
CellValue[OleVariant(h),OleVariant(2)] := OleVariant(13);
ExpandItem[0] := True;
end;
EndUpdate();
FreezeEvents(False);
end
|
2324
|
Highlight the leaf items

with G2antt1 do
begin
BeginUpdate();
ConditionalFormats.Add('%CC0=0',Null).ForeColor := $808080;
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
HeaderHeight := 24;
LinesAtRoot := EXG2ANTTLib_TLB.exLinesAtRoot;
with Columns do
begin
(IUnknown(Add('Item')) as EXG2ANTTLib_TLB.Column).Width := 16;
Add('Desc');
end;
with Items do
begin
hR := AddItem('Root');
CellValue[OleVariant(hR),OleVariant(1)] := 'The root directory /';
ExpandItem[hR] := True;
h := InsertItem(hR,Null,'Home');
CellValue[OleVariant(h),OleVariant(1)] := 'The home directory with user directories Alice and Bob';
InsertItem(h,Null,'Alice');
InsertItem(h,Null,'Bob');
ExpandItem[h] := True;
h := InsertItem(hR,Null,'Etc');
CellValue[OleVariant(h),OleVariant(1)] := 'The etc directory with one configuration file';
h := InsertItem(h,Null,'nginx.conf');
CellValue[OleVariant(InsertItem(hR,Null,'Var')),OleVariant(1)] := 'The var directory';
end;
EndUpdate();
end
|
2323
|
Highlight the parent items

with G2antt1 do
begin
BeginUpdate();
ConditionalFormats.Add('%CC0',Null).ForeColor := $ff;
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
HeaderHeight := 24;
LinesAtRoot := EXG2ANTTLib_TLB.exLinesAtRoot;
with Columns do
begin
(IUnknown(Add('Item')) as EXG2ANTTLib_TLB.Column).Width := 16;
Add('Desc');
end;
with Items do
begin
hR := AddItem('Root');
CellValue[OleVariant(hR),OleVariant(1)] := 'The root directory /';
ExpandItem[hR] := True;
h := InsertItem(hR,Null,'Home');
CellValue[OleVariant(h),OleVariant(1)] := 'The home directory with user directories Alice and Bob';
InsertItem(h,Null,'Alice');
InsertItem(h,Null,'Bob');
ExpandItem[h] := True;
h := InsertItem(hR,Null,'Etc');
CellValue[OleVariant(h),OleVariant(1)] := 'The etc directory with one configuration file';
h := InsertItem(h,Null,'nginx.conf');
CellValue[OleVariant(InsertItem(hR,Null,'Var')),OleVariant(1)] := 'The var directory';
end;
EndUpdate();
end
|
2322
|
Highlight the item being expanded or collapsed

with G2antt1 do
begin
BeginUpdate();
ConditionalFormats.Add('%CX0',Null).Bold := True;
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
HeaderHeight := 24;
LinesAtRoot := EXG2ANTTLib_TLB.exLinesAtRoot;
with Columns do
begin
(IUnknown(Add('Item')) as EXG2ANTTLib_TLB.Column).Width := 16;
Add('Desc');
end;
with Items do
begin
hR := AddItem('Root');
CellValue[OleVariant(hR),OleVariant(1)] := 'The root directory /';
ExpandItem[hR] := True;
h := InsertItem(hR,Null,'Home');
CellValue[OleVariant(h),OleVariant(1)] := 'The home directory with user directories Alice and Bob';
InsertItem(h,Null,'Alice');
InsertItem(h,Null,'Bob');
ExpandItem[h] := True;
h := InsertItem(hR,Null,'Etc');
CellValue[OleVariant(h),OleVariant(1)] := 'The etc directory with one configuration file';
h := InsertItem(h,Null,'nginx.conf');
CellValue[OleVariant(InsertItem(hR,Null,'Var')),OleVariant(1)] := 'The var directory';
end;
EndUpdate();
end
|
2321
|
I am using exTotalColumn. Is there an option to exclude specific cells to display the total

// Change event - Occurs when the user changes the cell's content.
procedure TForm1.G2antt1Change(ASender: TObject; Item : HITEM;ColIndex : Integer;var NewValue : OleVariant);
begin
with G2antt1 do
begin
Refresh();
end
end;
with G2antt1 do
begin
FreezeEvents(True);
BeginUpdate();
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
HeaderHeight := 24;
LinesAtRoot := EXG2ANTTLib_TLB.exLinesAtRoot;
with Columns do
begin
Add('Description');
with (IUnknown(Add('Qty')) as EXG2ANTTLib_TLB.Column) do
begin
Editor.EditType := EXG2ANTTLib_TLB.SpinType;
Def[EXG2ANTTLib_TLB.exTotalColumn] := 'sum(current,rec,%1)';
end;
with (IUnknown(Add('Price')) as EXG2ANTTLib_TLB.Column) do
begin
Def[EXG2ANTTLib_TLB.exTotalColumn] := 'avg(current,rec,%2)';
Editor.EditType := EXG2ANTTLib_TLB.SpinType;
end;
with (IUnknown(Add('Amount')) as EXG2ANTTLib_TLB.Column) do
begin
ComputedField := '%1 * %2';
Def[EXG2ANTTLib_TLB.exTotalColumn] := 'sum(current,rec,%3)';
end;
end;
with Items do
begin
r := AddItem('Root');
g1 := InsertItem(r,Null,'Group 1');
FormatCell[OleVariant(g1),OleVariant(2)] := '`<average missing>`';
CellEditorVisible[OleVariant(g1),OleVariant(2)] := EXG2ANTTLib_TLB.exEditorHidden;
CellBold[OleVariant(g1),OleVariant(2)] := True;
CellForeColor[OleVariant(g1),OleVariant(2)] := $ff;
h := InsertItem(g1,Null,'Item 1');
CellValue[OleVariant(h),OleVariant(1)] := OleVariant(1);
CellValue[OleVariant(h),OleVariant(2)] := OleVariant(10);
h := InsertItem(g1,Null,'Item 2');
CellValue[OleVariant(h),OleVariant(1)] := OleVariant(2);
CellValue[OleVariant(h),OleVariant(2)] := OleVariant(11);
g2 := InsertItem(r,Null,'Group 2');
h := InsertItem(g2,Null,'Item 1');
CellValue[OleVariant(h),OleVariant(1)] := OleVariant(3);
CellValue[OleVariant(h),OleVariant(2)] := OleVariant(12);
h := InsertItem(g2,Null,'Item 2');
CellValue[OleVariant(h),OleVariant(1)] := OleVariant(4);
CellValue[OleVariant(h),OleVariant(2)] := OleVariant(13);
ExpandItem[0] := True;
end;
EndUpdate();
FreezeEvents(False);
end
|
2320
|
How can I add a total column

// Change event - Occurs when the user changes the cell's content.
procedure TForm1.G2antt1Change(ASender: TObject; Item : HITEM;ColIndex : Integer;var NewValue : OleVariant);
begin
with G2antt1 do
begin
Refresh();
end
end;
with G2antt1 do
begin
FreezeEvents(True);
BeginUpdate();
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
HeaderHeight := 24;
LinesAtRoot := EXG2ANTTLib_TLB.exLinesAtRoot;
with Columns do
begin
Add('Description');
with (IUnknown(Add('Qty')) as EXG2ANTTLib_TLB.Column) do
begin
Editor.EditType := EXG2ANTTLib_TLB.SpinType;
Def[EXG2ANTTLib_TLB.exTotalColumn] := 'sum(current,rec,%1)';
end;
with (IUnknown(Add('Price')) as EXG2ANTTLib_TLB.Column) do
begin
Def[EXG2ANTTLib_TLB.exTotalColumn] := 'avg(current,rec,%2)';
Editor.EditType := EXG2ANTTLib_TLB.SpinType;
end;
with (IUnknown(Add('Amount')) as EXG2ANTTLib_TLB.Column) do
begin
ComputedField := '%1 * %2';
Def[EXG2ANTTLib_TLB.exTotalColumn] := 'sum(current,rec,%3)';
end;
end;
with Items do
begin
r := AddItem('Root');
g1 := InsertItem(r,Null,'Group 1');
h := InsertItem(g1,Null,'Item 1');
CellValue[OleVariant(h),OleVariant(1)] := OleVariant(1);
CellValue[OleVariant(h),OleVariant(2)] := OleVariant(10);
h := InsertItem(g1,Null,'Item 2');
CellValue[OleVariant(h),OleVariant(1)] := OleVariant(2);
CellValue[OleVariant(h),OleVariant(2)] := OleVariant(11);
g2 := InsertItem(r,Null,'Group 2');
h := InsertItem(g2,Null,'Item 1');
CellValue[OleVariant(h),OleVariant(1)] := OleVariant(3);
CellValue[OleVariant(h),OleVariant(2)] := OleVariant(12);
h := InsertItem(g2,Null,'Item 2');
CellValue[OleVariant(h),OleVariant(1)] := OleVariant(4);
CellValue[OleVariant(h),OleVariant(2)] := OleVariant(13);
ExpandItem[0] := True;
end;
EndUpdate();
FreezeEvents(False);
end
|
2319
|
Is it possible when I move the horizontal scroll bar, that the whole chart scrolls live during move the horizontal scroll bar. Not it scrolls just when I release the left mouse, not during change the horizontal scroll position
with G2antt1 do
begin
with Chart do
begin
PaneWidth[False] := 0;
LevelCount := 2;
ToolTip := '';
end;
end
|
2318
|
The exLinkStyle is not valid (the style of the link is still solid) if the link's width is greater than 1. What can be done
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Task');
with Chart do
begin
FirstVisibleDate := '1/1/2001';
PaneWidth[False] := 128;
end;
AntiAliasing := True;
with Items do
begin
h1 := AddItem('Task 1');
AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null);
h2 := AddItem('Task 2');
AddBar(h2,'Task','1/5/2001','1/7/2001','K2',Null);
AddLink('L1',h1,'K1',h2,'K2');
Link['L1',EXG2ANTTLib_TLB.exLinkStyle] := OleVariant(2);
Link['L1',EXG2ANTTLib_TLB.exLinkWidth] := OleVariant(2);
h3 := AddItem('Task 4');
AddBar(h3,'Task','1/8/2001','1/10/2001','K3',Null);
AddLink('L2',h2,'K2',h3,'K3');
Link['L2',EXG2ANTTLib_TLB.exLinkStyle] := OleVariant(1);
Link['L2',EXG2ANTTLib_TLB.exLinkWidth] := OleVariant(2);
end;
EndUpdate();
end
|
2317
|
How can I change the tooltip's margins (method 2)

// MouseMove event - Occurs when the user moves the mouse.
procedure TForm1.G2antt1MouseMove(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer);
begin
with G2antt1 do
begin
ShowToolTip(Chart.BarFromPoint[-1,-1],Null,Null,Null,Null);
end
end;
with G2antt1 do
begin
BeginUpdate();
ToolTipMargin := '16,8';
Columns.Add('Def');
with Chart do
begin
AllowCreateBar := EXG2ANTTLib_TLB.exNoCreateBar;
PaneWidth[False] := 64;
LevelCount := 2;
FirstVisibleDate := '1/1/2010';
Bars.Item['Task'].Def[EXG2ANTTLib_TLB.exBarToolTip] := '...';
end;
with Items do
begin
h := AddItem('Task');
AddBar(h,'Task','1/2/2010','1/5/2010','A','A');
AddBar(h,'Task','1/5/2010','1/8/2010','B','B');
end;
EndUpdate();
end
|
2316
|
Are there any properties to set text margins at tooltip, like Margins="5,5" (method 1). Margins is used to get some space between text and the tooltips border

// MouseMove event - Occurs when the user moves the mouse.
procedure TForm1.G2antt1MouseMove(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer);
begin
with G2antt1 do
begin
ShowToolTip(Chart.BarFromPoint[-1,-1],Null,Null,Null,Null);
end
end;
with G2antt1 do
begin
BeginUpdate();
ToolTipMargin := '16,8';
Columns.Add('Def');
with Chart do
begin
AllowCreateBar := EXG2ANTTLib_TLB.exNoCreateBar;
PaneWidth[False] := 64;
LevelCount := 2;
FirstVisibleDate := '1/1/2010';
Bars.Item['Task'].Def[EXG2ANTTLib_TLB.exBarToolTip] := '...';
end;
with Items do
begin
h := AddItem('Task');
AddBar(h,'Task','1/2/2010','1/5/2010','A','A');
AddBar(h,'Task','1/5/2010','1/8/2010','B','B');
end;
EndUpdate();
end
|
2315
|
exShowExtendedLinks

with G2antt1 do
begin
BeginUpdate();
DefaultItemHeight := 24;
HeaderHeight := 20;
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
AntiAliasing := True;
Columns.Add('Task');
with Chart do
begin
PaneWidth[False] := 48;
LevelCount := 2;
UnitScale := EXG2ANTTLib_TLB.exHour;
FirstVisibleDate := '1/10/2024';
with Level[1] do
begin
DrawTickLines := EXG2ANTTLib_TLB.exLevelNoLine;
DrawTickLinesFrom(0,EXG2ANTTLib_TLB.exLevelDotLine);
end;
AllowResizeChart := EXG2ANTTLib_TLB.ResizeChartEnum($fffffef9 Or Integer(EXG2ANTTLib_TLB.exAllowChangeUnitScale) Or Integer(EXG2ANTTLib_TLB.exAllowResizeChartMiddle) Or Integer(EXG2ANTTLib_TLB.exAllowResizeChartHeader));
ShowLinks := EXG2ANTTLib_TLB.exShowExtendedLinks;
end;
with Items do
begin
AddBar(AddItem('T1'),'Task','1/10/2024 10:00:00 AM','1/10/2024 10:20:00 AM','T1',Null);
AddBar(AddItem('T2'),'Task','1/10/2024 9:00:00 AM','1/10/2024 12:00:00 PM','T2',Null);
AddBar(AddItem('T3'),'Task','1/10/2024 8:00:00 AM','1/10/2024 8:30:00 AM','T3',Null);
AddBar(AddItem('T4'),'Task','1/10/2024 8:00:00 AM','1/10/2024 8:30:00 AM','T4',Null);
AddLink('L13',ItemByIndex[0],'T1',ItemByIndex[2],'T3');
AddLink('L14',ItemByIndex[0],'T1',ItemByIndex[3],'T4');
AddLink('L24',ItemByIndex[1],'T2',ItemByIndex[3],'T4');
end;
EndUpdate();
end
|
2314
|
According to the documentation of the ShowExtendedLinksEnum value exShowExtendedLinks (1) it is possible to distinctly visualise links (rather than showing them one over another) when two or more links start or end on the same bar

with G2antt1 do
begin
BeginUpdate();
DefaultItemHeight := 24;
HeaderHeight := 20;
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
AntiAliasing := True;
Columns.Add('Task');
with Chart do
begin
PaneWidth[False] := 48;
LevelCount := 2;
UnitScale := EXG2ANTTLib_TLB.exHour;
FirstVisibleDate := '1/10/2024';
with Level[1] do
begin
DrawTickLines := EXG2ANTTLib_TLB.exLevelNoLine;
DrawTickLinesFrom(0,EXG2ANTTLib_TLB.exLevelDotLine);
end;
AllowResizeChart := EXG2ANTTLib_TLB.ResizeChartEnum($fffffef9 Or Integer(EXG2ANTTLib_TLB.exAllowChangeUnitScale) Or Integer(EXG2ANTTLib_TLB.exAllowResizeChartMiddle) Or Integer(EXG2ANTTLib_TLB.exAllowResizeChartHeader));
end;
with Items do
begin
AddBar(AddItem('T1'),'Task','1/10/2024 10:00:00 AM','1/10/2024 10:20:00 AM','T1',Null);
AddBar(AddItem('T2'),'Task','1/10/2024 9:00:00 AM','1/10/2024 12:00:00 PM','T2',Null);
AddBar(AddItem('T3'),'Task','1/10/2024 8:00:00 AM','1/10/2024 8:30:00 AM','T3',Null);
AddBar(AddItem('T4'),'Task','1/10/2024 8:00:00 AM','1/10/2024 8:30:00 AM','T4',Null);
AddLink('L1',ItemByIndex[0],'T1',ItemByIndex[2],'T3');
AddLink('L2',ItemByIndex[1],'T2',ItemByIndex[3],'T4');
Link['L2',EXG2ANTTLib_TLB.exLinkShowRound] := OleVariant(4);
end;
EndUpdate();
end
|
2313
|
How to use arrows key left/right to move the cursor left/right inside the text
with G2antt1 do
begin
BeginUpdate();
with (IUnknown(Columns.Add('Edit')) as EXG2ANTTLib_TLB.Column).Editor do
begin
EditType := EXG2ANTTLib_TLB.EditType;
Option[EXG2ANTTLib_TLB.exLeftArrow] := OleVariant(False);
Option[EXG2ANTTLib_TLB.exRightArrow] := OleVariant(False);
end;
with Items do
begin
AddItem('000');
AddItem('111');
AddItem('222');
end;
EndUpdate();
end
|
2312
|
How can I force the cursor to jump to the end of the editor once the user clicks the cell
with G2antt1 do
begin
BeginUpdate();
SelBackColor := BackColor;
SelForeColor := ForeColor;
with (IUnknown(Columns.Add('Edit')) as EXG2ANTTLib_TLB.Column).Editor do
begin
EditType := EXG2ANTTLib_TLB.EditType;
Option[EXG2ANTTLib_TLB.exEditSelStart] := OleVariant(-1);
end;
with Items do
begin
AddItem('000');
AddItem('111');
AddItem('222');
end;
EndUpdate();
end
|
2311
|
How can I show the overview with a different color except or outside the selection

with G2antt1 do
begin
BeginUpdate();
VisualAppearance.Add(1,'gBFLBCJwBAEHhEJAAEhABVIDg6AADACAxRDAMgBQKAAzAJBIYhiGgcYCgMZBSDeCYXABCEYRXBIZQ7BKNIxjSJwFgmEgADE2YAoJDUN4nDKMMDybBkRxtDCPIDnGQoDi' +
'GI4nSbKIzSCKMQhrEKZZrnaLJFgOTY8ABLEBvfSgASof6MKBlKhKGoiUo2SCFEaBTBNHxDL6raqqWJ5HDINQlWzbcjjKKFYRbOqTZDkGj4XqKTo3YBAdZSXJsXwTGKkj' +
'i3ZgMOR3HaQaTjOgINpuDZdRzkUYZUDFSwSDqQIRtCpbJqzFZDZbLNbYBYME47AayID0CbdCgmaalSZHNxbVa0BzpXrFLw1TLoDy8AJ+ABseKzfo9PxdIygZRzKJ8aof' +
'E+YxynIfJcC8QgbCmL5eiEPIKH6RABlibJpicW4/FcAx/HOYRGmud4+CcHxdmiDhkGEIIIEkQJSGMHQHFGSBlFEUITEmewAAQIQ2AYRpDGQJAoEIXhXCkCB5kmSAdmgV' +
'ZPmgZJ8gaT4oHSeIHk8aIEnWCJiEiFgmgmYoIiYJIIE8aB8niB0pmyfIGE+ZYmDQPpjgOUg6DqY5DgYPg2mQAxqEKEJkEkFhGhGZIJA4QA2mOY4GDwOsumCe4NAACJKD' +
'oPQOFkZJThaSoZHSGYXmYCYGGKGJmEmFhmCsJoDFYag5iaSISDIAAjAkPJLhyS4JlYbA5iSeZmHqHpnkmdh+hOZx5lSOAzGgSQ+DAAAimkNIkiKTh6DSbIjmkChGhKJJ' +
'pEoVoWiSaJThyKImmSWI4ACCwNkqBhgDsahKhaJopmqComiqKpqkqEhghKYpAAIJIQmYA46jaLZrgqZo6i6a5KnaPotiZRQkiyIg6lIXw7myCwmkqMpsksNpOjObQLCK' +
'QYQiwOpOEKGAPAsZpajabZLHaXo3m4C4GlmNJNisVpFjWZZzkaao6m6S42m6O5vAuRpyjqLhLhidYxgmE5KnqPpvkudp+j+cAMAcAo+i8WIOkSPZuguZwDkKcJMDafpB' +
'E8XAengPJxEwVwWkWcYMGcGpGnGTBTBCRIwhkXwikichMhcJpJnKDIPB+NYNimAgqkucwMkcMoInKO4fC2F5ikyZw6k6c5MncPpPnOLJXAiTZJhOXxGlGdINCcSpSnST' +
'Q3E6UY0CuYgulSdRNFcVpVnWDRnFSVBwh0axeledgNFsXJRA+HYXGaWZ2g2JxqlqdpNjcZZYmYCJDHKXJ3E2K4doux3gbE8OEF4ygtjuH6L8eAHAHgFGCO8bY2QZgZDi' +
'BwJ4FRijxE4G8DoxBxj6B6EINwTADjvBaMseYHBng1GaPMTg7wepxA4J4Rx8RjgfCYFMeoEQ6BpGqPUTob2MD2A6IQLoNAKiHAuG0WYAAJCVBCCETAHR3DMFWPgDwD29' +
'j4E8CoV4sw7imAIIcJASggAHBeBIJw5grikCmHoSYNxWjrH2BMAoNgqAZE8O0GYEg5DgAIG8DgxwjhXGaCYZIcgnxBGSDILgmwTjKHkJMNwqgjCREoGEC4RRMifHqJcY' +
'okQ6BgEYJEUIaQOhlHIIESAECAg=');
BackColorLevelHeader := BackColor;
Background[EXG2ANTTLib_TLB.exOverviewSelResize] := $1;
Background[EXG2ANTTLib_TLB.exOverviewSelOut] := $f0f0f0;
Chart.OverviewSelBackColor := $ffffff;
Background[EXG2ANTTLib_TLB.exOverviewSelUnit] := $1000000;
with Chart do
begin
FirstVisibleDate := '6/21/2001';
PaneWidth[False] := 48;
OverviewVisible := EXG2ANTTLib_TLB.OverviewVisibleEnum($400 Or Integer(EXG2ANTTLib_TLB.exOverviewShowSelMargins) Or Integer(EXG2ANTTLib_TLB.exOverviewShowMargins) Or Integer(EXG2ANTTLib_TLB.exOverviewShowDateTimeScaleBottom) Or Integer(EXG2ANTTLib_TLB.exOverviewShowAllVisible));
OverviewHeight := 64;
LevelCount := 2;
UnitScale := EXG2ANTTLib_TLB.exDay;
Label[EXG2ANTTLib_TLB.exHour] := '';
Label[EXG2ANTTLib_TLB.exMinute] := '';
Label[EXG2ANTTLib_TLB.exSecond] := '';
AllowOverviewZoom := EXG2ANTTLib_TLB.exAlwaysZoom;
end;
Columns.Add('Column');
with Items do
begin
AddBar(AddItem('Item 1'),'Task','1/2/2001','1/11/2001',Null,Null);
AddBar(AddItem('Item 2'),'Task','7/2/2001','7/11/2001',Null,Null);
AddBar(AddItem('Item 3'),'Task','11/2/2001','11/11/2001',Null,Null);
end;
EndUpdate();
end
|
2310
|
Resize the chart using the overview's selection left and right margins (blue)

with G2antt1 do
begin
BeginUpdate();
BackColorLevelHeader := BackColor;
Background[EXG2ANTTLib_TLB.exOverviewSelResize] := $ff0000;
with Chart do
begin
FirstVisibleDate := '6/21/2001';
PaneWidth[False] := 48;
OverviewVisible := EXG2ANTTLib_TLB.OverviewVisibleEnum($400 Or Integer(EXG2ANTTLib_TLB.exOverviewShowSelMargins) Or Integer(EXG2ANTTLib_TLB.exOverviewShowMargins) Or Integer(EXG2ANTTLib_TLB.exOverviewShowDateTimeScaleBottom) Or Integer(EXG2ANTTLib_TLB.exOverviewShowAllVisible));
OverviewHeight := 64;
LevelCount := 2;
UnitScale := EXG2ANTTLib_TLB.exDay;
end;
Columns.Add('Column');
with Items do
begin
AddBar(AddItem('Item 1'),'Task','1/2/2001','1/11/2001',Null,Null);
AddBar(AddItem('Item 2'),'Task','7/2/2001','7/11/2001',Null,Null);
AddBar(AddItem('Item 3'),'Task','11/2/2001','11/11/2001',Null,Null);
end;
EndUpdate();
end
|
2309
|
Resize the chart using the overview's selection left and right margins (black)

with G2antt1 do
begin
BeginUpdate();
BackColorLevelHeader := BackColor;
Background[EXG2ANTTLib_TLB.exOverviewSelResize] := $1;
with Chart do
begin
FirstVisibleDate := '6/21/2001';
PaneWidth[False] := 48;
OverviewVisible := EXG2ANTTLib_TLB.OverviewVisibleEnum($400 Or Integer(EXG2ANTTLib_TLB.exOverviewShowSelMargins) Or Integer(EXG2ANTTLib_TLB.exOverviewShowMargins) Or Integer(EXG2ANTTLib_TLB.exOverviewShowDateTimeScaleBottom) Or Integer(EXG2ANTTLib_TLB.exOverviewShowAllVisible));
OverviewHeight := 64;
LevelCount := 2;
UnitScale := EXG2ANTTLib_TLB.exDay;
end;
Columns.Add('Column');
with Items do
begin
AddBar(AddItem('Item 1'),'Task','1/2/2001','1/11/2001',Null,Null);
AddBar(AddItem('Item 2'),'Task','7/2/2001','7/11/2001',Null,Null);
AddBar(AddItem('Item 3'),'Task','11/2/2001','11/11/2001',Null,Null);
end;
EndUpdate();
end
|
2308
|
Disable temporarily the column's sort, resize and drag and drop

with G2antt1 do
begin
BeginUpdate();
OnResizeControl := EXG2ANTTLib_TLB.exResizeChart;
SortBarVisible := True;
SortBarCaption := '<fgcolor 808080><c>the header and the sort-bar are disabled (no drag and drop is allowed)';
AllowGroupBy := True;
HeaderEnabled := False;
HeaderAppearance := EXG2ANTTLib_TLB.Etched;
(IUnknown(Columns.Add('Index')) as EXG2ANTTLib_TLB.Column).FormatColumn := '1 index ``';
(IUnknown(Columns.Add('Pos')) as EXG2ANTTLib_TLB.Column).FormatColumn := '1 apos ``';
(IUnknown(Columns.Add('Edit')) as EXG2ANTTLib_TLB.Column).Editor.EditType := EXG2ANTTLib_TLB.EditType;
GridLineStyle := EXG2ANTTLib_TLB.exGridLinesGeometric;
DrawGridLines := EXG2ANTTLib_TLB.exVLines;
GridLineColor := RGB(224,224,224);
with Chart do
begin
AllowCreateBar := EXG2ANTTLib_TLB.exCreateBarAuto;
LevelCount := 2;
FirstVisibleDate := '12/28/2000';
PaneWidth[False] := 196;
GridLineStyle := EXG2ANTTLib_TLB.exGridLinesGeometric;
DrawGridLines := EXG2ANTTLib_TLB.exAllLines;
with Level[1] do
begin
DrawGridLines := True;
GridLineColor := G2antt1.GridLineColor;
end;
end;
EndUpdate();
end
|
2307
|
Adds a Finish-Start(FS) link (method 3)

with G2antt1 do
begin
BeginUpdate();
Columns.Add('Name');
with Chart do
begin
LevelCount := 2;
FirstVisibleDate := '12/28/2000';
PaneWidth[False] := 64;
end;
with Items do
begin
h1 := AddItem('Item 1');
AddBar(h1,'Task','1/3/2001','1/6/2001',Null,Null);
h2 := AddItem('Item 2');
AddBar(h2,'Task','1/3/2001','1/6/2001',Null,Null);
AddLink('Link1',h1,'',h2,'');
SchedulePDM(0,'');
end;
EndUpdate();
end
|
2306
|
Adds a Start-Start(SS) link (method 3)

with G2antt1 do
begin
BeginUpdate();
Columns.Add('Name');
with Chart do
begin
LevelCount := 2;
FirstVisibleDate := '12/28/2000';
PaneWidth[False] := 64;
end;
with Items do
begin
h1 := AddItem('Item 1');
AddBar(h1,'Task','1/3/2001','1/6/2001',Null,Null);
h2 := AddItem('Item 2');
AddBar(h2,'Task','1/3/2001','1/6/2001',Null,Null);
AddLink('Link1',h1,'',h2,'');
Link['Link1',EXG2ANTTLib_TLB.exLinkStartPos] := OleVariant(0);
Link['Link1',EXG2ANTTLib_TLB.exLinkEndPos] := OleVariant(0);
SchedulePDM(0,'');
end;
EndUpdate();
end
|
2305
|
Adds a Finish-Finish(FF) link (method 3)

with G2antt1 do
begin
BeginUpdate();
Columns.Add('Name');
with Chart do
begin
LevelCount := 2;
FirstVisibleDate := '12/28/2000';
PaneWidth[False] := 64;
end;
with Items do
begin
h1 := AddItem('Item 1');
AddBar(h1,'Task','1/3/2001','1/6/2001',Null,Null);
h2 := AddItem('Item 2');
AddBar(h2,'Task','1/3/2001','1/6/2001',Null,Null);
AddLink('Link1',h1,'',h2,'');
Link['Link1',EXG2ANTTLib_TLB.exLinkStartPos] := OleVariant(2);
Link['Link1',EXG2ANTTLib_TLB.exLinkEndPos] := OleVariant(2);
SchedulePDM(0,'');
end;
EndUpdate();
end
|
2304
|
Adds a Start-Finish(SF) link (method 3)

with G2antt1 do
begin
BeginUpdate();
Columns.Add('Name');
with Chart do
begin
LevelCount := 2;
FirstVisibleDate := '12/28/2000';
PaneWidth[False] := 64;
end;
with Items do
begin
h1 := AddItem('Item 1');
AddBar(h1,'Task','1/3/2001','1/6/2001',Null,Null);
h2 := AddItem('Item 2');
AddBar(h2,'Task','1/3/2001','1/6/2001',Null,Null);
AddLink('Link1',h1,'',h2,'');
Link['Link1',EXG2ANTTLib_TLB.exLinkStartPos] := OleVariant(0);
Link['Link1',EXG2ANTTLib_TLB.exLinkEndPos] := OleVariant(2);
SchedulePDM(0,'');
end;
EndUpdate();
end
|
2303
|
Adds a Finish-Start(FS) link (method 2)

with G2antt1 do
begin
BeginUpdate();
Columns.Add('Name');
with Chart do
begin
LevelCount := 2;
FirstVisibleDate := '12/28/2000';
PaneWidth[False] := 64;
end;
with Items do
begin
h1 := AddItem('Item 1');
AddBar(h1,'Task','1/3/2001','1/6/2001',Null,Null);
h2 := AddItem('Item 2');
AddBar(h2,'Task','1/3/2001','1/6/2001',Null,Null);
ItemBar[h2,'',EXG2ANTTLib_TLB.exBarPredecessor] := '1FS';
SchedulePDM(0,'');
end;
EndUpdate();
end
|
2302
|
Adds a Start-Start(SS) link (method 2)

with G2antt1 do
begin
BeginUpdate();
Columns.Add('Name');
with Chart do
begin
LevelCount := 2;
FirstVisibleDate := '12/28/2000';
PaneWidth[False] := 64;
end;
with Items do
begin
h1 := AddItem('Item 1');
AddBar(h1,'Task','1/3/2001','1/6/2001',Null,Null);
h2 := AddItem('Item 2');
AddBar(h2,'Task','1/3/2001','1/6/2001',Null,Null);
ItemBar[h2,'',EXG2ANTTLib_TLB.exBarPredecessor] := '1SS';
SchedulePDM(0,'');
end;
EndUpdate();
end
|
2301
|
Adds a Finish-Finish(FF) link (method 2)

with G2antt1 do
begin
BeginUpdate();
Columns.Add('Name');
with Chart do
begin
LevelCount := 2;
FirstVisibleDate := '12/28/2000';
PaneWidth[False] := 64;
end;
with Items do
begin
h1 := AddItem('Item 1');
AddBar(h1,'Task','1/3/2001','1/6/2001',Null,Null);
h2 := AddItem('Item 2');
AddBar(h2,'Task','1/3/2001','1/6/2001',Null,Null);
ItemBar[h2,'',EXG2ANTTLib_TLB.exBarPredecessor] := '1FF';
SchedulePDM(0,'');
end;
EndUpdate();
end
|