PlexityHide

Home 

Products 

Downloads 

Our Shop 

Support 

Contact 


GTP.NET FAQ 11237


Snap time item placements while moving Please note that this article refers to the GTP.NET
Jump to article- 2008-05-22 11:14:00 - Email plexityHide

Question

I know I can use DateScaler.Snap to control time item placement, but now I want to have the time item jump in discrete steps while the user moves it.

Is that possible?

Answer

Sure, everything is possible:

    /// <summary>
    /// This is how you can quantify the movement, while moving, to, for example, 1 hour
    /// </summary>
    private void gantt1_OnTimeItem_Hoover_ForQuantifyTest(PlexityHide.GTP.Gantt aGantt, PlexityHide.GTP.TimeItemEventArgs e)
    {
      if (gantt1.MouseMoveKind==MouseMoveKind.move)
      {
        int orgpos=gantt1.DateScaler.TimeToPixel(e.TimeItem.Start+e.Diff);
        DateTime quantizedTime=gantt1.DateScaler.SnapTime(e.TimeItem.Start+e.Diff,new TimeSpan(1,0,0));
        int newpos=gantt1.DateScaler.TimeToPixel(quantizedTime);
        int diff=newpos-orgpos;
        e.x =e.x+diff;
      }
    }

 

Google
WWW plexityHide GTP.NET FAQ
Support

Support intro

Knowledgebase

FAQ phGantTimePackage

FAQ GTP.NET

FAQ GTP.NET.SL and WPF

FAQ general

Testimonials

"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%"
Gaurav Patole,
WebTechDevelopers
More testimonials...




class="blk">PlexityHide.com
Grastensvagen 24, S-163 45 Spanga Sweden
E-mail: support@plexityhide.com