10579 : Can i move a Gant Time to a different row and a different time at the same movement?

Question

Can i move a Gant Time to a different row and a different time at the same movement?

I only can change row or day but not the two movements. I have programmed the two events ( OnGantTimeChangeRow and OnValueChangedGantTime) but only one of them is fired.

How can I do this?

Answer

You need to set IphGantX3.MoveInTimeWhenMoveRow=true and you will be fine.

 

10531 : Is it possible to set the language in order to change the date format?

Question

We have to insert the possibility to change language settings. Is it possible to set the language in order to change the date format?

Example: Regional settings of my PC are italian but I want dates in phGanttControl.ocx to be in English and I want to view the days of the week like this: “Sun”, “Mon”, “Thu”, ecc..

Alternatively, is it possibile to hide the days of the week when I’m zooming the control?

Answer

The settings is read from windows-locales at startup, the setting is read again as a responce to the WM_WININICHANGE message.

To change the locales settings in windows (got this from msdn):

setlocale( LC_ALL, “French_Canada.1252” );
// Set code page to French Canada ANSI default
setlocale( LC_ALL, “French_Canada.ACP” );
// Set code page to French Canada OEM default
setlocale( LC_ALL, “French_Canada.OCP” );

This is untested and we are not entirily sure that it will work. Maybe we will need to expose a method in the API to let you send in the desired culture-lcid.

You may also implement the IphGantX3.OnScalerStringShort and IphGantX3.OnScalerStringLong events and override the outputted text.

 

10525 : Change the grids columns order in runtime.

Question

We are working with the phgantTime30 control as an scheduler. I was wondering if there is any property or something that allows me to change the grid’s columns’ order in runtime.

Something like selecting the column and dragging it to another position in the grid.

Answer

When you use the phSchema: You can call  IphSchemaX3.Columns.Move to throw columns around, but there is no interaction to let the user do this implemented. You would need to do that with OnMouseDown etc yourself.

When you use the phGant and the grid within: In the activex version you need to use GridColumnInsert and GridColumnRemove. This is not ideal and the VCL version allows for much more functionality not currently exposed…

10533 : Change the date format in the top of scaler.

Question

I used the events OnScalerStringLong and OnScalerStringShort to change the date format in phGanttControl.ocx, but It remains to change this in the top of scaler. It says some like “2006 apr-mag” (in italian) but I want change this in “2006 Apr-May” (in english) programmaticaly

Answer

There is an event that allows you to override that text;  OnDateScalerInfoText.

10596 : Deleting a link

Question

We are evaluating your phGantTimePackage and we have a doubt: we want to delete a link made between 2 tasks. We’ve used the addLink method, but we have a problem when we try to delete the link. We saw a code example in your web and tried to follow it, but we encountered a problem with the types that the method GetLinks returns.

The code line is: “If ((Not alink.LinkOwner Is Nothing) And (Not alink.LinkedTo Is Nothing)) Then” and the error is: ‘the object doesn’t admit this method’.

The complete code is:

Dim alink As IphDataEntity_Link
  For i = 0 To theGant.GetLinks.Count() – 1
    Set alink = theGant.GetLinks.Items(i)
    If Not alink Is Nothing Then
      If ((Not alink.LinkOwner Is Nothing) And (Not alink.LinkedTo Is Nothing)) Then
        If (alink.LinkOwner = SomeObject of type ‘phGantXControl.IphDataEntity_GantTime’) Or (alink.LinkedTo = = SomeObject of type     ‘phGantXControl.IphDataEntity_GantTime’) Then
        End If

What is wrong? Is there any method similar to addLink for delete a link?

Answer

When you have the link object you can delete it like this:

theGant.GetLinks.Remove(alink);
or theGant.GetLinks.Delete(i);

10558 : Is there a way to make faster my gantt?

Question

I installed the Siemens version of phGantXControl.ocx but I see that it’s slower than phGantXControl.ocx of the try version.

Is there a way to make faster my gantt? I see that it exists an event called OnVirtualLoadGrid but I don’t understand how I can use it and if it is really able to improve performances of my gantt.

Answer

There is no difference in the phGant used by Siemens and the general download except maybe a version difference. You can upgrade (without any fees of course) to the latest patch.

The virtual load is an option if your loading and unloading times are noticeable, and you have many rows as root nodes.

Basically the virtual load has only the grid items shown on screen in memory, and sends events to load and unload data as you scroll in the y direction. So instead of taking all the time in the beginning it distributes the loading time. This will be a good option if your load has a small start up penalty and can deliver small amounts of data fast, but delivers large amounts of data slowly.

 

10529 : I want to set the time format on the timeline in phGantXControl.ocx.

Question

I want to set the time format on the timeline in phGantXControl.ocx.

How I can set a time format like this?

06:31:00 PM

I see that I should use the TimeFormat property, but I don’t know how I can map the ‘:’ separator and the A.M./P.M. indicator.

Answer

We use the DateTimeFormat provided by Borland. You can use DateFormat and TimeFormat properties. This is the definition:

Specifier         Displays< ?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

c                    Displays the date using the format given by the ShortDateFormat global variable, followed by the time using the format given by the LongTimeFormat global variable. The time is not displayed if the date-time value indicates midnight precisely.

d                    Displays the day as a number without a leading zero (1-31).

dd                  Displays the day as a number with a leading zero (01-31).

ddd                Displays the day as an abbreviation (Sun-Sat) using the strings given by the ShortDayNames global variable.

dddd              Displays the day as a full name (Sunday-Saturday) using the strings given by the LongDayNames global variable.

ddddd            Displays the date using the format given by the ShortDateFormat global variable.

dddddd          Displays the date using the format given by the LongDateFormat global variable.

e                    (Windows only) Displays the year in the current period/era as a number without a leading zero (Japanese, Korean and Taiwanese locales only).

ee                  (Windows only) Displays the year in the current period/era as a number with a leading zero (Japanese, Korean and Taiwanese locales only).

g                    (Windows only) Displays the period/era as an abbreviation (Japanese and Taiwanese locales only).

gg                  (Windows only) Displays the period/era as a full name. (Japanese and Taiwanese locales only).

m                   Displays the month as a number without a leading zero (1-12). If the m specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.

mm                Displays the month as a number with a leading zero (01-12). If the mm specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.

mmm              Displays the month as an abbreviation (Jan-Dec) using the strings given by the ShortMonthNames global variable.

mmmm           Displays the month as a full name (January-December) using the strings given by the LongMonthNames global variable.

yy                  Displays the year as a two-digit number (00-99).

yyyy               Displays the year as a four-digit number (0000-9999).

h                    Displays the hour without a leading zero (0-23).

hh                  Displays the hour with a leading zero (00-23).

n                    Displays the minute without a leading zero (0-59).

nn                  Displays the minute with a leading zero (00-59).

s                    Displays the second without a leading zero (0-59).

ss                   Displays the second with a leading zero (00-59).

z                    Displays the millisecond without a leading zero (0-999).

zzz                 Displays the millisecond with a leading zero (000-999).

t                     Displays the time using the format given by the ShortTimeFormat global variable.

tt                    Displays the time using the format given by the LongTimeFormat global variable.

am/pm            Uses the 12-hour clock for the preceding h or hh specifier, and displays ‘am’ for any hour before noon, and ‘pm’ for any hour after noon. The am/pm specifier can use lower, upper, or mixed case, and the result is displayed accordingly.

a/p                 Uses the 12-hour clock for the preceding h or hh specifier, and displays ‘a’ for any hour before noon, and ‘p’ for any hour after noon. The a/p specifier can use lower, upper, or mixed case, and the result is displayed accordingly.

ampm             Uses the 12-hour clock for the preceding h or hh specifier, and displays the contents of the TimeAMString global variable for any hour before noon, and the contents of the TimePMString global variable for any hour after noon.

/                     Displays the date separator character given by the DateSeparator global variable.

:                     Displays the time separator character given by the TimeSeparator global variable.

‘xx’/”xx”          Characters enclosed in single or double quotes are displayed as-is, and do not affect formatting.

 

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

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

 

 

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