10244 : What events are triggered on Drag drop

Question

I am developing a Microsoft Access program (VBA/DAO). Have inserted the phGantX object on a form. The tree object displays names of scheduled events. Rows on the Gantt object display an icon for the specific day the event occurs. When I drag and drop the icon on the Gantt object, I would like to update the database with the new date. What events are triggered when I click on/drag/drop the icon on the Gantt object. I have tried multiple ways and can’t figure it out. Please help.

Answer

When you drag something in Access to the Gantt the events that come into play are these:
IphGantX3.OnOLEDrop
IphGantX3.OnOLEDragOver
IphGantX3.OnOLEDragLeave
IphGantX3.OnOLEDragEnter

You need to translate the DD-coordinates to local before you send them in to any Gantt specific function.

10236 : Time item will not change row?

Question
Hello,
 
Can you tell me..is it possible for the Gant Times to visually move to a different Gant Row when dropped?  I set the option for the tree.CanChangeRows to true which allows for dragging the GantTime to a new row but when I let go of the block, nothing happens — it doesn’t move to the new Row where dropped or change in time.  (If I just drag to a different time then it moves to the new time fine.) 
 
I’m using the ActiveX version.
 
Thanks for any help you can offer!
 
Answer
Yes, but you must implement the IphGantX3.OnGantTimeChangeRow event to that is fired when the user drops a time item on another row.
 
Like this in VB6:
Private Sub phGantX1_OnGantTimeChangeRow(ByVal theGant As phGantXControl.IphGantX, ByVal theDataEntity As phGantXControl.IphDataEntity_GantTime, ByVal theOldRow As phGantXControl.IGantRow, ByVal theNewRow As phGantXControl.IGantRow)
Dim aList As IphDataList
    Set aList = theNewRow.DataLists.DataList(0)
    
    theDataEntity.ChangeOwner aList, 0
End Sub

10246 : 24 hour period and vertically 7 days with no date involved

Question

Basically I need to show horizontally a 24 hour period and vertically 7 days with no date involved. How?

Answer

It sure sounds like you want to use the phSchemaX component. This component can be viewed vertically, looking like a schedule or viewed horizontally looking more like the Gantt. Simply set the property FlipView to true or false.

You add columns, one for each day of the week and for each column you set the IphDataEntity_SchemaColumn.OffsetDate…

So if you choose to start from time zero (1899), Monday OffsetDate=0, Tuesday OffsetDate=1 etc…

You then set the ScalerStart and ScalerStop datetimes of the phSchema to show only a day.

10215 : Does the phGantX have its own mouse pointer property?

Question

Mouse pointer: does the Gantt have its own mouse pointer property e.g. IphGantX3.MousePointer = VBHourGlass?

Answer

In phGantTimePackage we call the mouse pointer for Cursor. These are the properties that you can use to set and get the Cursor on particular sub components in the phGantX:

DragCursorTree ; both tree and grid
CursorTree ; both tree and grid
Cursor ; same as Cursor tree
CursorScaler
CursorGantArea

All properties takes an int, that maps to the standard cursor in the system, you can create new cursors and add their handles with this method in phGantX:

AddCursor(aCursorHandle: Integer; aIndex: Integer)

10207 : How do I apply my custom sort on particular column?

Question

I am using registered copy of phGantXControl.ocx v3.5.4.67 ActiveX control in my MFC application. How do I apply my custom sort on particular column?

Answer

Currently we have no event to handle custom sort from the ActiveX Version. You might think that this is an oversight and that we should have such an event… And I kind of agree, but we do not. Contact support@plexityhidemainsite.azurewebsites.net , we can extend the current product.

Update from support: A new event has been added to handle custom sort. It is available in the latest service release…

10202 : I just need to know how I identify which time items are owned by a column and then how to them.

Question

I just need to know how I identify which time items are owned by a column and then how to delete them.

Answer

For i = 0 To phSchemaX1.Layers.Count – 1
  Set layer = phSchemaX1.Layers.DataList(i)
  For ii = layer.Count – 1 To 0 step by -1 ‘ Since I am removing items I must step backwards in order to avoid messing up indices
    Set aSchemaTime = layer.Items(ii)
    IF aSchemaTime.Col=aColumnIndexThatIWantToRemoveAllTimesFrom then
      phSchemaX1.RemoveSchemaTime(aSchemaTime)
    end if
  Next ii
Next i

10200 : OnSchemaHitInfo event

Question

Is it at least possible to get the text and the Index of the column on which the nodes are added in the OnSchemaHitInfo event.

Answer

Private Sub ganCapacity_OnSchemaHintInfo(ByVal sender As Object, ByVal e
 As
AxphGantXControl.IphSchemaXEvents_OnSchemaHintInfoEvent) Handles
ganCapacity.OnSchemaHintInfo
  Debug.WriteLine(e.theStart.ToString())

  ‘ Like this; I have not compiled it so please excuse any typos…
  if not (e.theObject is nothing) then
    dim col as IphDataEntity_SchemaTime
    set col=phSchemaX.Columns.Items(e.theObject.Col)
    Debug.WriteLine(col.Text)
  end if
End Sub

10199 : vertical line on the time item area, that will always show current time?

Question

Can i draw somehow a vertical line on the time item area, that will always show the current time?

Answer

you can set IphGantX3.TodayLineOnOff=true, but It is easy to do this in the Background draw event, like this

Private Sub phGantX1_OnGantAreaDrawBackground(ByVal theGant As phGantXControl.IphGantX3, ByVal Left As Long, ByVal Top As Long, ByVal Right As Long, ByVal Bottom As Long, ByVal theHDC As Long)
Dim aRect As Module1.RECT

  x = theGant.DateToPixel(Now)
  If (x > 0) And (x < Right) Then
    aRect.Bottom = Bottom
    aRect.Top = Top
    aRect.Right = x + 1
    aRect.Left = x – 1
    aBrush = Module1.GetStockObject(7)
    aDummy = Module1.FrameRect(theHDC, aRect, aBrush)
  End If
‘Public Declare Function GetStockObject Lib “gdi32” (ByVal fnObject As Long) As Long
End Sub

10197 : I want the height”s of all the rows to change

Question

If I change the height of one row (may be the 1st one or maybe I select all
rows and the increase the height) I want the height’s of all the rows to
get changed accordingly. How do I do this one.

Answer

You will have to iterate all rows and set the height to each one.
This code doubles the row height on the selected row:
if phGantX1.CurrentDataEntityTree<>nil then
begin
  y:=(phGantX1.CurrentDataEntityTree as IphDataEntity_Tree2).GridRowIndex;
  phGantX1.SetRowHeightGrid(y,phGantX1.GetRowHeightGrid(y)*2);
end;

10196 : How to add a list of numbers or texts to a Schema time item

Question

Anyone know how to add a list of numbers or texts to a Schema time item such that each number is on a separate line within the text box.

 I’ve tried .
 Dim X As IphDataEntity_SchemaTime
 Set X = phSchemaX1.AddSchemaTime(0)
 X.AddText “1”, 10, 10, 0
 X.AddText “2”, 10, 10, 0

Answer

But the second text overwrites the first.
 the 10’s are pixel coordinates from the top left of the time item
try
 X.AddText “1”, 10, 10, 0
 X.AddText “2”, 10, 30, 0