예제 #1
0
파일: AxisStyle.cs 프로젝트: olesar/Altaxo
        public IHitTestObject HitTest(HitTestPointData parentCoord, DoubleClickHandler AxisScaleEditorMethod, DoubleClickHandler AxisStyleEditorMethod, DoubleClickHandler AxisLabelMajorStyleEditorMethod, DoubleClickHandler AxisLabelMinorStyleEditorMethod)
        {
            IHitTestObject hit;

            if (null != (hit = _axisTitle?.HitTest(parentCoord)))
            {
                return(hit);
            }

            if (IsAxisLineEnabled && null != (hit = _axisLineStyle.HitTest(parentCoord, false)))
            {
                hit.DoubleClick = AxisScaleEditorMethod;
                return(hit);
            }

            // hit testing the axes - secondly now with the ticks
            // in this case the TitleAndFormat editor for the axis should be shown
            if (IsAxisLineEnabled && null != (hit = _axisLineStyle.HitTest(parentCoord, true)))
            {
                hit.DoubleClick = AxisStyleEditorMethod;
                return(hit);
            }

            if (null != (hit = _majorLabelStyle?.HitTest(parentCoord)))
            {
                hit.DoubleClick = AxisLabelMajorStyleEditorMethod;
                return(hit);
            }

            if (null != (hit = _minorLabelStyle?.HitTest(parentCoord)))
            {
                hit.DoubleClick = AxisLabelMinorStyleEditorMethod;
                return(hit);
            }

            return(null);
        }