Пример #1
0
        private void HoverTimer_Tick(object sender, EventArgs e)
        {
            // if mouse in same block at same position for 5 ticks (2,5 seconds) display tool tip, else hide tool tip

            if (!Cursor.Position.Equals(HoverPos))
            {
                HoverTicks = 0;
                HoverPos   = new Point(0, 0);
                HoverBlock = null;
                HoverText  = null;
                HoverTip.Hide(this);
                return;
            }

            if (HoverTicks < 1)
            {
                HoverTicks++;
                return;
            }

            if (HoverText == null && HoverBlock != null)
            {
                HoverText = HoverBlock.GetHoverText();

                HoverTip.Show(HoverText, this, PointToClient(Cursor.Position));
            }
        }
Пример #2
0
        public void CursorUpdate(BlockRow block)
        {
            // test block because control can scroll without mouse moving
            if (Cursor.Position.Equals(HoverPos) && block == HoverBlock)
            {
                return;
            }

            HoverTicks = 0;
            HoverPos   = Cursor.Position;
            HoverBlock = block;
            HoverText  = null;
            HoverTip.Hide(this);
        }
Пример #3
0
        private void HoverTimer_Tick(object sender, EventArgs e)
        {
            // if mouse in same block at same position for 5 ticks (2,5 seconds) display tool tip, else hide tool tip

            if ( !Cursor.Position.Equals(HoverPos) )
            {
                HoverTicks = 0;
                HoverPos   = new Point(0, 0);
                HoverBlock = null;
                HoverText  = null;
                HoverTip.Hide(this);
                return;
            }

            if (HoverTicks < 1)
            {
                HoverTicks++;
                return;
            }

            if (HoverText == null && HoverBlock != null)
            {
                HoverText = HoverBlock.GetHoverText();

                HoverTip.Show(HoverText, this, PointToClient(Cursor.Position));
            }
        }
Пример #4
0
        public void CursorUpdate(BlockRow block)
        {
            // test block because control can scroll without mouse moving
            if (Cursor.Position.Equals(HoverPos) && block == HoverBlock)
                return;

            HoverTicks = 0;
            HoverPos   = Cursor.Position;
            HoverBlock = block;
            HoverText  = null;
            HoverTip.Hide(this);
        }