Beispiel #1
0
        public void UpdateTopBottomValues()
        {
            var topValue    = TopValue;
            var bottomValue = BottomValue;
            var delta       = Math.Abs(TopValue - BottomValue); // % of this
            var multiplier  = 0.05F;                            //5%
            var divider     = 10;                               //to .. , 10, 20, .. , 80, 90, ..

            if (TopValue > BottomValue)
            {
                topValue    = SliderUtilities.RoundUp(TopValue, delta, multiplier, divider);
                bottomValue = SliderUtilities.RoundDown(BottomValue, delta, multiplier, divider);
            }
            else
            {
                topValue    = SliderUtilities.RoundDown(TopValue, delta, multiplier, divider);
                bottomValue = SliderUtilities.RoundUp(BottomValue, delta, multiplier, divider);
            }

            panel.TopValue  = topValue;
            panel2.TopValue = topValue;

            panel.BottomValue  = bottomValue;
            panel2.BottomValue = bottomValue;

            topValueLabel.Text    = panel.TopValueText;
            bottomValueLabel.Text = panel.BottomValueText;
        }
Beispiel #2
0
 public float ValueToHeight(float value)
 {
     return(SliderUtilities.ValueToHeight(value, TopValue, BottomValue, Height));
 }
Beispiel #3
0
 private float GetOffsetForValue(float value)
 {
     return(SliderUtilities.GetOffsetForValue(value, TopValue, BottomValue, Height));
 }
Beispiel #4
0
 public float YToValue(float y)
 {
     return(SliderUtilities.YToValue(y, TopValue, BottomValue, Height));
 }