示例#1
0
文件: Table.cs 项目: TW2/CoolTable
        private void Table_MouseWheel(object sender, MouseEventArgs e)
        {
            oldCurY = oldCurY + (e.Delta > 0 ? 3 : -3);

            if (oldCurY < -GetLinesCount())
            {
                oldCurY = -GetLinesCount();
            }

            if (oldCurY > 0)
            {
                oldCurY = 0;
            }


            Event.ScrollEventArgs evt = new Event.ScrollEventArgs(
                oldCurY,
                GetLinesCountHeight(),
                bag);

            curY = -evt.Position;
            grip = GetLinesCountHeight() / 4f;
            if (grip < 20)
            {
                grip = 20;
            }

            _Scrolling(evt);
        }
示例#2
0
文件: Table.cs 项目: TW2/CoolTable
        protected virtual void _Scrolling(Event.ScrollEventArgs e)
        {
            EventHandler <Event.ScrollEventArgs> handler = OnScrolling;

            if (handler != null)
            {
                handler(this, e);
            }
        }