10761 : Problem when placing the phGantX on windows child form .NET

Question

Hello, I am currently developing an application using your PhGantX control in visual studio 2005, when the application is run and you click on the control to either move the time bar or anything really the application locks on the section as dose not allow you to select anything on the application at all you have to select another window from the desktop to release the form. < ?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

This issue has only come up in the studio 2005 application. I previously wrote an app in vb6 and had no problems at all.

I upgraded this app into VS2005 to see if the problem would happen with this one and it did.

Answer

Although the reason for this problem is not entirly understood we know so much that it has to do with win-handles and who is owning who.

The workaround is to place a panel on the child form, and the put the Gantt on the panel…

Creating the mdiChild form is then called when you need to bring the form up:
dim GantForm as form  = new form2
GantForm.mdiparent = me
GantForm.show

 

10514 : How I can see a tool tip on a gantt item in VC++ using phGantXControl.ocx?

Question

How I can see a tool tip on a gantt item in VC++ using phGantXControl.ocx?

Answer

Every environment has it own way of controlling tooltip windows so:

There is no built in tooltip in the phGant or phSchema. But if you implement the event IphGantX3.OnHintInfo you will get all the information you normally associate with a ToolTip that might show when dragging a time item.

You need to create and control the tooltip window yourself, decide how it should look and what information etc, then use the OnHintInfo or MouseMove events to bring it up.

 

10737 : How do I add Time items to the phGant in VCL when UseGridNotTree is true?

Question

How do I add Time items to the phGant in VCL when UseGridNotTree is true?

Answer

There are several samples in the general download that shows this.

For example the sample/VCL/Native/Project1 does it like this:

  phGant1.DateScaler.LookAndFeel:=tlfBoxed;
  phGant1.DateScaler.ScrollButtons:=tsbSmall;
  phGant1.UseGridNotTree:=TRUE;

procedure TForm1.Addrow1Click(Sender: TObject);
var
  aGridTreeNode:TphDataEntity_GridTreeNode;
  aCell:TBabCell;
begin

  if Assigned(phGant1.ActiveGantRow) then
    aGridTreeNode:=phGant1.GridNode_Add(phGant1.ActiveGantRow.GridTreeNode)
  else
    aGridTreeNode:=phGant1.GridNode_Add(nil);

  aCell:=phGant1.Grid.Cell[0,aGridTreeNode.AxisContentItem.ListIndex];
  phGant1.Grid.SetText(aCell,’a new row’);

end;

procedure TForm1.Addtimeitem1Click(Sender: TObject);
var
  aTimeItem:TphDataEntity_Ganttime;
begin
  if Assigned(phGant1.Grid.FocusedCell) then
  begin
    aTimeItem:=phGant1.GridNode_AddGantTime(phGant1.Grid.AxisContentItemToGridTreeNode(phGant1.Grid.FocusedCell.AxisContentItemY),0);
    aTimeItem.Start:=phGant1.DateScaler.Start+5;
    aTimeItem.Stop:=phGant1.DateScaler.Start+15;
    aTimeItem.Color:=Random(65000);
    aTimeItem.Style:=gtsPipe;

    aTimeItem.Row.CollisionDetection:=CBCollisionDetectOnRows.Checked;
    aTimeItem.Row.IncreaseRowHeightOnCollision_SuggestedHeightPerItem:=20;
    aTimeItem.Row.IncreaseRowHeightOnCollision:=CBIncreaseRowHeightOnCollisions.Checked;

  end;
end;

 

10449 : How can I tell which nodes in my tree are visible to the user?

Question

How can I tell which nodes in my tree are visible to the user?

When the user expands a node, I would like to be able to adjust the display so that all the sub-nodes of that node are visible (without the user having to scroll up or down to see them).

Or is there a way of getting the Gant control to adjust the display automatically? I would ideally like the tree to work like the tree in Windows Explorer.

Answer

Both the phGantTimePackage and GTP.NET returns a rectangle of -1,-1,-1,-1 for the grid rect of cells that has not been drawn (because they are not currently on screen).

In phGantTimePackage you can use the IphGantRow3.GetRect method
and in GTP.NET you would use GridNode.Rect

The same applies to individual cells (that they return a -1 rect if not currently on screen).

10488 : how do I set the scaler so that it shows only the days ma/tue/ etc… and that it does not scale otherwise (no hours / minutes /weeks) or months ???

Question

how do I set the scaler so that it shows only the days ma/tue/ etc… and that it does not scale otherwise (no hours / minutes /weeks or months) ???

Answer

phGant VCL version

First you need to find a Scale that you like presentation wise. Once you have it (Check the phGantt.Scale property in runtime when you have the Gantt set the way you want).

Use the decided scale value in the DateScaler.OnLimitScaling event. Simply return false when the Scale value differs from your constant.

 

10410 : phGantTimePackage in Access??

Question

I am currently evaluating phGantTimePackage for potential use within Access applications, but I cant find any documentation or examples that show how to get events working within an access application.  Is this possible?

Answer

Yes, the phGantTimePackage works in all activex supporting development environments. (Access, VFP, PowerBuilder, Delphi, VisualStudio) .

The bulk of the ActiveX samples are made with VB6.

Disclaimer: We offer very little special knowledge about each individual environment.

10425 : Access to UserIntegerReference

Question

When i populate the gant control, i am using the UserIntegerReference property to hold the primary key value for each database record that i add to the control. As each timebar record is added to the gant, i also record the value in a cursor with its “current dates”.

When a user moves or resizes a timebar, how do I determine the UserIntegerReference value of the selected timebar? I need to take that value and lookup the assigned “UserIntegerReference” value in my database, in order to perform some validations and to show additional data.

In the OnValueChangedGantTime method, I want to use this “UserIntegerReference” to perform the lookup. But i am missing the obvious. Can you help?

Answer

The OnValueChangedGantTime gives you a parameter named theDataEntity, of the type IphdataEntity_GantTime.

If you store your db-key in the UserIntegerReference you can access it with theDataEntity.UserIntegerReference.

If you stored the key in the tree nodes UserIntegerReference you can access it like this:
((theDataEntity as IphDataEntity_GantTime2).Row as IphGantRow3).TreeNode.UserIntegerReference

10333 : Is there anyway the text can be placed outside the time object so when a print is performed the whole text can be seen?

Question

Using phGantTime and printing. We have text displayed in the time object. If the object is small then the text is truncated and cannot be seen on a printout. Is there anyway the text can be placed outside the time object so when a print is performed the whole text can be seen?

Answer

The latest patch has new functionality to render time item texts outside their time items.

You go like this to use it:

Private Sub addRow(textplacex As TxTextRectPlace, textplacey As TxTextRectPlace)
Dim de As IphDataEntity_Tree
Dim gr As IphGantRow3
Dim gt As IphDataEntity_GantTime2

If phGantX1.CurrentDataEntityTree Is Nothing Then
    Set de = phGantX1.AddRootDataEntityTree
  Else
    Set de = phGantX1.AddDataEntityTree(phGantX1.CurrentDataEntityTree)
  End If
 
  i = i + 1
  de.Text = “<new row>” + Str(i)
  Set gr = de.GantRow
  gr.TimeItems_CanChangeRow = False
  gr.TimeItems_CanMove = True
 
  Set gt = phGantX1.AddGantTime(de, 0)
  gt.Style = tsNormal
  gt.Start = Date
  gt.Stop = Date + 5
 
  gt.TimeItemsTextAdd
  gt.TimeItemsTextSetEx 0, de.Text, 2, 2, 0, textplacex, textplacey
         

End Sub

And the TxTextRectPlace type can have these values trpInside,trpOutsideNear,trpOutsideFar

 

 

10379 : Does the phGantTimePackage support the export of the GantTime to PowerPoint?

Question

Does the phGantTimePackage support the export of the GantTime to PowerPoint?

Answer

Not powerpoint directly. BUT since win32 and .NET allowes for recording of meta files by sending in a graphic context, you can use win32 features and create a meta file hdc and use the PrintToHdc. PowerPoint handles meta files (emf and wmf) and files created this way are vector based so they scale nicely.