Beispiel #1
0
        //MovBMouseUp
        private void Ax_MouseUp(object sender, MouseEventArgs e)
        {
            _isMouseDown4Move = false;

            int    ad = 0;
            double eY = e.Y;

            if (sender is Label)
            {
                ad  = ((Label)sender).Top;
                eY += ((Label)sender).Top;
            }

            UpperGraphic.FormGraphic.AxYMoveH(this, e.X, e.Y, ad, e.Button == MouseButtons.Left);

            if (e.Button == MouseButtons.Right)
            {
                //mm _expandBufMin = !IsInPercent ? ViewMin : UpperGraphic.Param.PercentToValue(ViewMin);
                _expandBufMin = !IsInPercent ? ViewMin : UpperGraphic.PercentToValue(ViewMin);
                //mm _expandBufMax = !IsInPercent ? ViewMax : UpperGraphic.Param.PercentToValue(ViewMax);
                _expandBufMax = !IsInPercent ? ViewMax : UpperGraphic.PercentToValue(ViewMax);

                double val = _expandBufMax -
                             (-TxtBoxMax.Top + eY) / (-TxtBoxMax.Top + (double)TxtBoxMin.Bottom) *
                             (_expandBufMax - _expandBufMin);

                UpperGraphic.FormGraphic.SelectCursorYSelectionEnter(UpperGraphic, val);
            }
            else if (e.Button == MouseButtons.Left)
            {
                if (_md)
                {
                    UpperGraphic.FormGraphic.CmdList.AxYSizePosChanged(this, _curSize, _curPos);
                }
                _md = false;
            }
        }
Beispiel #2
0
        //ResBMouseDown
        private void Ax_MouseDown(object sender, MouseEventArgs e)
        {
            AxSelect(sender, null);

            if (e.Button == MouseButtons.Left)
            {
                _isMouseDown4Move = true;
            }
            _mouseY = e.Y;
            double eY = e.Y;

            _mouseH = Ax.Bottom;
            if (sender is Label)
            {
                eY += ((Label)sender).Top;
            }

            if (e.Button == MouseButtons.Right)
            {
                //mm _expandBufMin = !IsInPercent ? ViewMin : UpperGraphic.Param.PercentToValue(ViewMin);
                _expandBufMin = !IsInPercent ? ViewMin : UpperGraphic.PercentToValue(ViewMin);
                //mm _expandBufMax = !IsInPercent ? ViewMax : UpperGraphic.Param.PercentToValue(ViewMax);
                _expandBufMax = !IsInPercent ? ViewMax : UpperGraphic.PercentToValue(ViewMax);

                double val = -(-TxtBoxMax.Top + eY)
                             / (-TxtBoxMax.Top + (double)TxtBoxMin.Bottom)
                             * (_expandBufMax - _expandBufMin) + _expandBufMax;

                UpperGraphic.FormGraphic.SelectCursorYSelectionStart(UpperGraphic, val);
            }
            else if (e.Button == MouseButtons.Left)
            {
                _curPos  = CurAxPos;
                _curSize = CurAxSize;
                _md      = true;
            }
        }
Beispiel #3
0
        //AxMBMove
        private void Ax_MouseMove(object sender, MouseEventArgs e)
        {
            if (_isMouseDown4Move)
            {
                int ad = 0;
                if (sender is Label)
                {
                    ad = ((Label)sender).Top;
                }

                UpperGraphic.FormGraphic.AxYMoveV(this, e.Y, _mouseY);
                UpperGraphic.FormGraphic.AxYTryMoveH(this, e.X, e.Y, ad);
            }
            else
            {
                if (e.Button == MouseButtons.Right)
                {
                    double eY = e.Y;
                    if (sender is Label)
                    {
                        eY += ((Label)sender).Top;
                    }

                    //mm _expandBufMin = !IsInPercent ? ViewMin : UpperGraphic.Param.PercentToValue(ViewMin);
                    _expandBufMin = !IsInPercent ? ViewMin : UpperGraphic.PercentToValue(ViewMin);
                    //mm _expandBufMax = !IsInPercent ? ViewMax : UpperGraphic.Param.PercentToValue(ViewMax);
                    _expandBufMax = !IsInPercent ? ViewMax : UpperGraphic.PercentToValue(ViewMax);

                    double val = _expandBufMax -
                                 (-TxtBoxMax.Top + eY) / (-TxtBoxMax.Top + (double)TxtBoxMin.Bottom) *
                                 (_expandBufMax - _expandBufMin);

                    UpperGraphic.FormGraphic.SelectCursorYSelectionEnd(UpperGraphic, val);
                }
            }
        }