示例#1
0
        internal void TabMouseMove(int x, int y)
        {
            if (!_tabMDown)
            {
                _graphicsTabPanel.Cst.Page.Cursor = AtEdgeOfPanel(x, y) ? Cursors.HSplit : Cursors.Arrow;
                return;
            }

            if (_edgePanel == -1)
            {
                return;
            }

            var mainPan = _graphicsTabPanel.Cst.MainPan;
            var subPan  = _graphicsTabPanel.Cst.SubPan;

            var p1 = _panPercent * (y - _topY) / (_bottomY - _topY);
            var p2 = _panPercent * (_bottomY - y) / (_bottomY - _topY);

            if (p1 < 5 || p2 < 5)
            {
                return;
            }

            if (_edgePanel == 0)
            {
                if (Math.Abs(p1 - mainPan.PercentHeight) <= 1.0)
                {
                    return;
                }
                mainPan.PercentHeight   = p1;
                subPan[0].PercentHeight = p2;
            }
            else
            {
                if (Math.Abs(p1 - subPan[_edgePanel - 1].PercentHeight) <= 1.0)
                {
                    return;
                }
                subPan[_edgePanel - 1].PercentHeight = p1;
                subPan[_edgePanel].PercentHeight     = p2;
            }
            _graphPanel.SetSize(_graphPanel.Width, _graphPanel.Height);
        }