public static void CalculateMouseValue(IGaugeContainer container, IConvertibleScaleEx scale, MouseEventArgs e)
        {
            BasePrimitiveHitInfo hi = container.CalcHitInfo(e.Location);

            if (hi.Element != null && !hi.Element.IsComposite)
            {
                PointF modelPt = MathHelper.PointToModelPoint(scale as DevExpress.XtraGauges.Core.Base.IElement <IRenderableElement>, new PointF(e.X, e.Y));
                float  percent = scale.PointToPercent(modelPt);
                scale.Value = scale.PercentToValue(percent);
            }
        }
        public static void CheckCursor(IGaugeContainer container, System.Windows.Forms.MouseEventArgs e)
        {
            BasePrimitiveHitInfo hi = container.CalcHitInfo(e.Location);
            Cursor cursor           = (hi.Element != null && !hi.Element.IsComposite) ?
                                      Cursors.Hand : Cursors.Default;

            if (((Control)container).Cursor != cursor)
            {
                ((Control)container).Cursor = cursor;
            }
        }
Ejemplo n.º 3
0
        float CalculateMouseValue(IGaugeContainer container, IConvertibleScaleEx scale, MouseEventArgs e)
        {
            float result            = -1;
            BasePrimitiveHitInfo hi = container.CalcHitInfo(e.Location);

            if (hi.Element != null)
            {
                PointF modelPt = MathHelper.PointToModelPoint(scale as IElement <IRenderableElement>, hi.HitPoint);
                float  percent = scale.PointToPercent(modelPt);
                result = scale.PercentToValue(percent);
            }
            return(result);
        }
Ejemplo n.º 4
0
        private float SetScore(Point point)
        {
            float                result  = ((LinearGauge)gaugeCtr.Gauges[0]).Scales[0].Value;
            IGaugeContainer      igc     = gaugeCtr as IGaugeContainer;
            BasePrimitiveHitInfo hitInfo = igc.CalcHitInfo(point);

            if (hitInfo.Element != null)
            {
                BaseGaugeModel parent = BaseGaugeModel.Find(hitInfo.Element);
                if (parent != null)
                {
                    if (hitInfo.Element.Name == "Indicator4")
                    {
                        result = 5;
                    }
                    else if (hitInfo.Element.Name == "Indicator3")
                    {
                        result = 4;
                    }
                    else if (hitInfo.Element.Name == "Indicator2")
                    {
                        result = 3;
                    }
                    else if (hitInfo.Element.Name == "Indicator1")
                    {
                        result = 2;
                    }
                    else if (hitInfo.Element.Name == "Indicator0")
                    {
                        result = 1;
                    }
                }

                ((LinearGauge)gaugeCtr.Gauges[0]).Scales[0].Value = result;
            }
            return(result);
        }