Exemple #1
0
        public void Show()
        {
            Visible       = true;
            CurrentStatus = ChartToolTipStatus.Standby;
            TimerTick     = 0;

            if (!Parent.ToolTips.Contains(this))
            {
                Parent.ToolTips.Add(this);
            }
        }
Exemple #2
0
 public void Hide(bool slow)
 {
     if (slow)
     {
         CurrentStatus = ChartToolTipStatus.Hide;
         TimerTick     = (int)Math.Round((1.0f - Opacity) * ReshowDelay);
     }
     else
     {
         Visible = false;
     }
 }
Exemple #3
0
        internal void OnTimerTick(int ticks)
        {
            int   nt      = TimerTick + ticks;
            float opacity = Opacity;

            switch (CurrentStatus)
            {
            case ChartToolTipStatus.Standby:
                if (nt > InitialDelay)
                {
                    CurrentStatus = ChartToolTipStatus.Show;
                    nt           -= InitialDelay;
                    opacity       = 1.0f;
                }
                else
                {
                    opacity = nt / (float)InitialDelay;
                }
                break;

            case ChartToolTipStatus.Show:
                if (ShowAlways || IsMouseHover)
                {
                    nt      = 0;
                    opacity = 1.0f;
                }
                else if (nt > AutoPopDelay)
                {
                    CurrentStatus = ChartToolTipStatus.Hide;
                    nt           -= AutoPopDelay;
                }
                break;

            case ChartToolTipStatus.Hide:
                if (nt > ReshowDelay)
                {
                    nt      = 0;
                    opacity = 0.0f;
                    Visible = false;
                }
                else
                {
                    opacity = 1.0f - Math.Min(1.0f, TimerTick / (float)ReshowDelay);
                }
                break;
            }

            TimerTick = nt;
            Opacity   = opacity;
        }
Exemple #4
0
        private void OnVisibleChanged()
        {
            if (Visible)
            {
                CurrentStatus = ChartToolTipStatus.Standby;
                TimerTick     = 0;
            }

            Invalidate();

            if (VisibleChanged != null)
            {
                VisibleChanged(this, EventArgs.Empty);
            }
        }
Exemple #5
0
 private void OnIsMouseHoverChanged()
 {
     CurrentStatus = ChartToolTipStatus.Show;
     TimerTick     = 0;
 }