10429 : phGantTimePackage under Borland C++ Builder 6.

Question

Hello… I am trying to install phGantTimePackage under Borland C++ Builder 6. The Delphi 6 BPL installs, but I am lacking the .hpp files to make it work. Is it possible to obtain these for use with the no-source package?

Answer

The following downloads are available for bcb6:

https://plexityhide.com/pub/bcb6dcu.zip

https://plexityhide.com/pub/codehpp.zip

 

 

10434 : Timebased Background color in TimeItemArea

Question

I am trying to color the background of the timeitemarea, with different colors for holidays, by looping all the rows in the gantt. I have viewed the article at

http://plexityhide.dyndns.org/InstantKB13/Article.aspx?id=10066 and http://plexityhide.dyndns.org/InstantKB13/article.aspx?id=10278 , but the solutions are a colored background for the same holiday throughout all the rows in the grid.

I can’t make use of the event OnDateScalerPaintBackground as I do not want the same days to be colored for the different rows in the grid. I have tried to perform coloring on the background through the event OnTimeItemAreaPaintBackground but the result obtained was only one row of colored background. Is there any property I could use to obtain the top position for each row, while looping, so that I can perform the coloring row by row? Or is there any better way to achieve what I wanted?

Answer

I think you should continue to use OnTimeItemAreaPaintBackground, loop thru the GanttRows and for each check its draw rect with IphGantRow3.GetRect

10423 : Setting the start date of Gantt_ASP

Question

while I am using GTP.NET.WEB I tried to set the start date of the DataScler using any of the following commands:
Gantt_ASPSettings1.Gantt.DateScalerProperties.LowerBound = New Date (2004, 1, 1, 0, 0, 0, 0)
or
Gantt_ASP1.Gantt.DateScaler.StartTime = StartDate
But it doesnt work!!! Any help please?

Answer

Go like this:
      if (! this.IsPostBack) // If this is not a postback then we init the datetime to Today + 15 days
      {
        Gantt_ASP1.StartTime=DateTime.Today;
        Gantt_ASP1.StopTime=DateTime.Today.AddDays(15);
      }
You need to be carefull to check that this is not a postback, otherwise the date will not change when user tries to scroll

10779 : Cannot click image with zero length

Question

I need to select a time item TimeItemStyle=image with the click mouse but the time item start and finish is equal.

No action on image

Answer

This is what we call a FixedSize time item, it has no length and is common in milestones etc.

In GTP.NET you set FixedSizeUse to true and FixedSize to a pixel value in the time item layout.

In phGantTimePackage you set IphDataEntity_GantTime2.FixedSize to the pixel value you need

10418 : I am trying to conditionally allow or prevent the moving/resizing of timebars

Question

I am trying to conditionally allow or prevent the moving/resizing of timebars on the calendar based on certain conditions. I have read the helpfile and a KB article on the topic but i still dont understand how to manipulate a time item’s move/resize properties.

The reply to the KB question reads….
_________

Answer

In phGantTimePackage this can be handled with properties on the IphGantRow3.

IphGantRow3.TimeItems_CanChangeRow=false
IphGantRow3.TimeItems_CanMove=false
IphGantRow3.TimeItems_CanResize
_____________

So this is on a ROW basis? Cant i have do this down at the timebar level??

Also, i dont understand the naming convention of “IphGantRow3.TimeItems_CanResize”. 

My code to populate the treeview and to draw timebars is shown below.  Can you show where and how in my code to allow/prevent a timebar from being moved or resized??  I was hoping to do something like the following but it DOES NOT work:

tTime.AllowMove = .t.
tTime.AllowChangeRow = .t.
tTime.AllowResizeEast = .t.
tTime.AllowResizeWest = .t.

Answer

You are correct that the “Allow” properties are set per row. This is a design limitation (or flaw) to the phGantTimePackage that has been fixed in the GTP.NET. The workaround for phGantTimePackage user to get conditional AllowResizeEast etc is to implement the IphGantX3.OnBeforeCanEditGantTime and in this event evaluate what the correct settings for the properties should be and update them on the row.

 

10648 : How can you add a link from one time object to another on double click.

Question

How can you add a link from one time object to another on double click.

I have tried using the code

Set alink = theGant.AddLink
If Not (theDataEntity Is Nothing) Then

   If alink.LinkOwner Is Nothing Then
    alink.LinkOwner = theDataEntity
  Else
    Set alink = phGantX1.AddLink
    alink.LinkedTo = theDataEntity 
  End If
End If

Answer

A link needs two time items. If you want to add a link as a result of a double click you will have one time item for sure. Namely the time item you double clicked on. But what about the other?

You can iterate thru the time items and find another selected time item (IphDataEntity_GantTime.Selected=true) or you can take the double click as the start for finding the other, by setting the component into a “link creating mode” and drag a link out to a new time item as described in this article.

The important thing to remember is to set two different time items in the link properties LinkOwner and LinkedTo, otherwise the link will not be drawn.

    Dim aLink As IphDataEntity_Link
    Set aLink = theGant.AddLink
   
    aLink.LinkOwner = theStartDataEntity
    aLink.LinkedTo = theTargetDataEntity

 

 

 

 

10644 : Im evaluating GTP.NET and YAPP, could you tell me whta is the relation between the two products?

Question

I’m evaluating GTP.NET and YAPP, could you tell me what is the relation between the two products? Can projects created in yapp be opened using GTP?

Answer

Yapp was made using the phGantTimePackage. Yapp is a standalone application that uses many of the features available in the phGantTimePackage. When .net was released we constructed GTP.NET, that stands for GanttTimePackage.Net. Now GTP.NET is a, fully managed, potent component package that in many ways surpass the phGantTimePackage.

Yapp uses a simple xml format to persist the objects within. This format could easily be interperted and read by your code to show the same data in the GTP.NET, but there are no such functions built into the GTP.NET package.

10564 : I have a problem with setting the rowheight property of the grid.

Question

I use your phGantTime package with Delphi 7.

I have a problem with setting the rowheight property of the grid. I cannot set this value less than 20 pixels. I tried to reduce the used font size too, but the rowheight is always 20. How can I resolve the problem? Our client wants to see more rows on the screen, without scrolling the gant.

For example:

phGant1.Grid.SetRowHeight(1, 15);

phGAnt.Grid.GetRowHeight(1) get 20

Thanks.

Answer

This has to do with the cellLayout that has a MinHeight property that is default set to 20. If your cell does not activly use CellLayouts the DefaultCellLayout.MinHeight is used.

Change it like this phGrid.DefaultContentLayoutProperty.MinHeight:=15.

10559 : Web deploy

Question

Whenever we are accessing phGantTimePackage 3.0 through an ASP page using ActiveX control over internet, it is giving following error:

“Object doesn’t support this property or method”

and crashes the IE though the ActiveX control is registered on the client m/c correctly. To contrast with, if we access the same page on the local network, it is executing perfectly.

Eg:

http://www.myserver.com/PTGantView.asp gives error while http://myserver/PTGantView.asp works fine (both are same m/c’s).

What can be the possible issue here? Any help would be highly appreciated.

Answer

When you want to distribute the phGantTimePackage.ocx over the web in this way you should use a cab file. You can use the cab file found here https://plexityhide.com/pub/CAB.zip further more, since the phGantTimePackage is a signed control you must use a lpk file on the web server (this does the same thing as the lic file on the local computer). The lpk files are enclose in the Cab.zip and they should be in the same folder as the cab file. The zip also contains a small htm sample page.

 

10509 : How can I access to phGantXControl enums like TxTimeStyle in VC++?

Question

How can I access to phGantXControl enums like TxTimeStyle in VC++?

I want to set the style of a GantTime, but I can’t write in my code

time->SetStyle(tsPipe);

I can only write something like this:

time->SetStyle(8);

Thanks

Answer

This really depends on how you imported the type library, but if all is somewhat standard you should find the enum definition TxTimeStyle in the created h file.

So then you would go

time->SetStyle(TxTimeStyle.tsPipe);