![]() |
|
GTP.NET FAQ 11019OnTimeItem_AfterMove event, the TimeItemEventArgs returns 0 in its X and Y fields? Please note that this article
refers to the GTP.NET Jump to article- 2007-10-20 10:09:00 - Email plexityHide Question
I am trying cause an interaction between two objects (represented by timeitems in the Gantt) that is triggered when one timeitem is moved on top of another. When trying to implement this by using the OnTimeItem_AfterMove event, the TimeItemEventArgs returns 0 in its X and Y fields. This is not good, since I am trying to find the "lower" timeitem by using the Gantt.TimeItemFromPoint method. 1) Why does the TimeItemEventArgs return these values? 2) If this is not fixable, how do I find the relevant timeitem?
Answer
1) The mouse position is not relevant after the mouse button is released, and the draw rectangle of the time item is not updated until the next render-sweep, what is valid here is the Start and Stop of the time item (collisiondetection may affect Y pixel pos, datescaler changes my change X pixel pos)
2) In the AfterMove the Start and Stop is updated. You can use those along with the DateScaler.TimeToPixel to get the X position and from that look for the time item that is on that position with TimeItemFromPoint.
|
"This is too GREAT. I must say you have strong support and really good programmers at your place. Your entire team is good. Just Fantastic! – 100%" |
| ? 1999-2006 PlexityHide.com Grastensvagen 24, S-163 45 Spanga Sweden E-mail: support@plexityhide.com |