Exemple #1
0
        private bool CheckRightAxis(int x, int y)
        {
            float bottomX = _rAxis.GetPoint1()[0]; //x-position of bottom point
            float bottomY = _rAxis.GetPoint1()[1]; //y-position of bottom point

            float topX = _rAxis.GetPoint2()[0];    //x-position of top point
            float topY = _rAxis.GetPoint2()[1];    //y-position of top point

            if (x > bottomX && y - bottomY < PIXEL_RADIUS && y - bottomY > -PIXEL_RADIUS)
            {
                _currentAxis          = _rAxis;
                _textBox.DataEntered += ModifyMinimumValue;
                SetupTextBox();

                return(true);
            }
            else if (x > topX && y - topY < PIXEL_RADIUS && y - topY > -PIXEL_RADIUS)
            {
                _currentAxis          = _rAxis;
                _textBox.DataEntered += ModifyMaximumValue;
                SetupTextBox();

                return(true);
            }

            return(false);
        }
Exemple #2
0
        private bool CheckTopAxis(int x, int y)
        {
            float leftX = _tAxis.GetPoint1()[0];  //x-position of left point
            float leftY = _tAxis.GetPoint1()[1];  //y-position of left point

            float rightX = _tAxis.GetPoint2()[0]; //x-position of right point
            float rightY = _tAxis.GetPoint2()[1]; //y-position of right point

            if (x - leftX < PIXEL_RADIUS && x - leftX > -PIXEL_RADIUS && y > leftY)
            {
                _currentAxis          = _tAxis;
                _textBox.DataEntered += ModifyMinimumValue;
                SetupTextBox();

                return(true);
            }
            else if (x - rightX < PIXEL_RADIUS && x - rightX > -PIXEL_RADIUS && y > rightY)
            {
                _currentAxis          = _tAxis;
                _textBox.DataEntered += ModifyMaximumValue;
                SetupTextBox();

                return(true);
            }

            return(false);
        }
Exemple #3
0
        protected virtual void Create()
        {
            _chartItem = new vtkChartXY();

            _textBox = new FloatingTextBox();

            vtkChartXY chart = (vtkChartXY)_chartItem;

            _lAxis = chart.GetAxis((int)vtkAxis.Location.LEFT);
            vtkTextProperty titleProps = _lAxis.GetTitleProperties();

            titleProps.SetOpacity(0.0);

            _bAxis     = chart.GetAxis((int)vtkAxis.Location.BOTTOM);
            titleProps = _bAxis.GetTitleProperties();
            titleProps.SetOpacity(0.0);

            _rAxis     = chart.GetAxis((int)vtkAxis.Location.RIGHT);
            titleProps = _rAxis.GetTitleProperties();
            titleProps.SetOpacity(0.0);

            _tAxis     = chart.GetAxis((int)vtkAxis.Location.TOP);
            titleProps = _tAxis.GetTitleProperties();
            titleProps.SetOpacity(0.0);
        }
Exemple #4
0
        private void ModifyMaximumValue(object sender, EventArgs eventArgs)
        {
            double max;

            if (Double.TryParse(_textBox.TextBox.Text, out max))
            {
                _currentAxis.SetMaximum(max);
                _currentAxis = null;
                this.Render();
            }
            else if (String.IsNullOrEmpty(_textBox.TextBox.Text))
            {
                // Do nothing
            }
            else
            {
                this.Log.Error("Improperly formatted min value.");
            }

            _textBox.TextBox.Text = "";
            _textBox.DataEntered -= ModifyMaximumValue;
        }