10119 : How can I do a container row in activeX?

Question

How can I do a container row in activeX? I´m workin in Visual foxpro ver.8.0. Please send me a example.
im working with the demo version.
Thank you.

Answer

There is, currently, no built in support for conatiner rows. You can create the time item looking like a container (set time style= tsSpan), but you need to implement the desired logic to grow and shrink based on sub nodes time items yourself. You can do this by catching the event IphGantX3.OnValueChangedGantTime, check if the time item lies under a container node, find max and min for all time items under the container and change the value if needed.

10115 : How can I show a progress by a task as it is in the Microsoft Project?

Question

Thank you for your replies, our company is in one step to buy your product! Your support are great!
One more question about phGantTimePackage:
How can I show a progress by a task as it is in the Microsoft Project?

Answer

There are two possible solutions depending on your needs.

First; Implement user draw on the time item and draw it yourself, and draw the progress bar as part of the time item.

Second solution; Add another, thinner, time item in another layer. This solution will allow you users to change the progress by click and drag, but you need to move the progress bar time item when the main time item is moved.

 

10110 : Is there a way to inhibit TimeItem Overlap.

Question

Is there a way to inhibit TimeItem Overlap. I want them to be placed side-by-side. In the onTimeCollision event how may I know wich is the Item being moved/resized and wich is the one who “suffer” the overlap?

Answer

To force time items to be placed side by side you simple turn on CollisionDetection (default on). As to how to find out who is the time item mostly suffering from a detected collision; This is really a business logic defintion, we simply cannot tell what makes most sense in all cases.

What you can do is to check the Currently selected time items, it is likely that you differ between the time item that has moved into a colliding position and the time item that has been “jumped”. Simply check the Selected flag on the time items in the oncollisiondetect event, the one selected is likely the one last moved.

10112 : Is there a way to set the hour per day to a different value than 24?

Question

Is there a way to set the hour per day to a different value than 24? I mean, I want my timeline to start at 8.00 and to stop at 18.00. So , if a timeItem starts lasting 3 hours, starts at 17.00 on monday, I would like to see in the graph a line starting at 17.00

Answer

We always do all data handling based on 24 hours per day. You can however hide certain time intervalls, or certain day types from view. We call this Time Hiding and Day Hiding.

For phGantTimePackage see IphGantX3.SetHiddenHour and IphGantX3.SetHiddenDayType in the help file.

For GTP.NET you can do like this to hide certain hours:

    private bool timeHide=false;
    private void buttonToggleHideTime_Click(object sender, System.EventArgs e)
    {
      timeHide=!timeHide;
      if (timeHide)
        dateScaler1.HideHours(new int[]{11,12,13});
      else
        dateScaler1.ShowHours(new int[]{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23});
    }

For further info look up PlexityHide.GTP.DateScaler.HideDays and PlexityHide.GTP.DateScaler.HideHours in the help file.

 

10106 : phGantTimePackage .ocx where or how can I get the cab file?

Question

I have a problem with the phGantTimePackage .ocx control and my .aspx page. I added the phGantTimePackage .ocx into my .aspx page and all works fine if I open this page on my computer. But when I try to open this page on another computer I have a problem – the ocx control doesnt show. As I understand, if I want to use ocx I need to add codebase attribute and specify the path to the cab file. But where or how can I get this cab file? Do I need to buy the phGantTimePackage product?

Answer

Yes you need a cab file, and yes you need a developer license to to be allowed to deploy the solution. You do not need a license per client of course. You can produce a cab file yourself with the standard tools provided by microsoft or you can use ours. To control licensing for IE-integrated ocx’s an lpk file is used. You need to produce this as-well from the lic file or use ours.

This would be the syntax even if this uses an older version;

<OBJECT CLASSID = “clsid:5220cb21-c88d-11cf-b347-00aa00a28331”>
   <PARAM NAME=”LPKPath” VALUE=”phGantX.lpk”>
</OBJECT>

<OBJECT
   classid=”clsid:1A9D2E1D-63A4-11D3-9EC5-5C91AD000000″
   codebase=”https://plexityhide.com/test/phGantXControl.cab#version=2.1.4.4
   width=850
   height=400
   align=center
   hspace=0
   vspace=0
   id=phGantX1
>
</OBJECT>

If you want to use our cab we can send it to, simply email support with the request (registred users only, please provide license name)

The lpk files you will find the samples/activex/asp folder.

10102 : How can I change backcolor and font for the tree columns header?

Question

phGantTimePackage: How can I change backcolor and font for the tree columns header?

Answer

You create GridLayoutProperties

  phGantX1.GridLayoutPropAdd
  phGantX1.GridLayoutPropAdd
  phGantX1.GridLayoutPropAdd

and init them to the values you want

  phGantX1.GridLayoutPropSet 0, ColorConstants.vbYellow, ColorConstants.vbBlack, “Helvetica”, 8, 20, 20, False, True, False, True, False
  phGantX1.GridLayoutPropSet 1, ColorConstants.vbRed, ColorConstants.vbBlack, “Helvetica”, 8, 20, 20, False, True, False, True, False
  phGantX1.GridLayoutPropSet 2, ColorConstants.vbBlue, ColorConstants.vbWhite, “Helvetica”, 8, 20, 20, False, True, False, True, False

Then you can use them in the header cells:

For icol = 0 To phGantX1.GridColumnCount – 1
  phGantX1.SetGridCellLayoutPropIndex icol, 0, 1 ‘ Use the no 1 LayoutProperty in all header cells (row=0)
Next icol

10105 : I am using phGanttChart ActiveX in MFC application. I wish to store the GRID column number that was clicked for sorting. That I wish to remember the last sort… How do I do that??

Question

I am using phGanttChart ActiveX in MFC application. I have a registered version v3.5.5.70. I wish to store the GRID column number that was clicked for sorting. That I wish to remember the last sort… How do I do that??

Answer

You will need to trap the click in the column head and check if the column had SortEnable=true and remember the column index.

Implement IphGantX3.OnMouseDown, check that theSubComponent==gscGrid.

Find the cell if any; You can do this with IphGantX3,GetGridCellRect(x,0, out aTop: OleVariant; out aLeft: OleVariant;
                              out aBottom: OleVariant; out aRight: OleVariant); and check if the click was inside any of the header cell rects.

10087 : Links in phGantTimePackage

Question

I add 4 Ganttimes with links.
OK  !

But …
1. How can I remove one link
2. How can I remove all links
( I mean only the links – not remove time and add time again)

3. How can I link again (without ADDTIME – only the links)

Answer

You can addlinks like this:

    phGantXControl.IphDataEntity_Link mylink;
    mylink=axphGantX1.AddLink();
    mylink.LinkOwner=time3;
    mylink.LinkedTo=time2;
    mylink.StartFinishOption=(phGantXControl.TxLinkStartFinishOption) oneoffive;

You can remove links by getting the list of all links: IphGantX3.GetLinks, this gives you an IphDataList2 that you can iterate and do all normal list actions with, like remove or Clear to remove all links…

If you put some external reference in your IphDataEntity_GantTime.UserReference, you might also consider to put a UserReference in the IphDataEntity_Link.UserReference. In that case you can find a link by IphGantX3.GetLinks.FindFromUserReference.

If you simply iterate the IphGantX3.GetLinks you can check if a link is connected to the currently selected GantTime with this code;

for i=0 to IphGantX3.GetLinks-Count-1 do
  dim alink as IphDataEntity_Link
  set alink=IphGantX3.GetLinks[i]
  if ((not alink.LinkOwner is Null) and (not alink.LinkedTo is Null) then
    if (alink.LinkOwner=Gantt1.IphGantX3.ActiveDataEntity) or (alink.LinkedTo=Gantt1.IphGantX3.ActiveDataEntity) then
      ‘ Found one, do stuff…
    endif
  endif
Next i

10089 : Is there a way to turn off the relationship between the length of a timeitem and its timeitemtext?

Question

Is there a way to turn off the relationship between the length of a timeitem and its timeitemtext?
Because now when I have a short timeitembar, my timeitemtext is too short to display the whole text

Answer

Well not really, you can fallback on UserDraw and draw the time item and text yourself.

If you are using GTP.NET you can use the TimeItemTextLayout.OutsideText property, this will  draw your text outside the time item.