Example #1
0
        private void SetupRelative()
        {
            XScale.SetRange(1, 200);
            XScale.SetIncrements(1, 10);
            XScale.Value = rx;

            YScale.SetRange(1, 200);
            YScale.SetIncrements(1, 10);
            YScale.Value = ry;
        }
Example #2
0
        /// <summary>
        /// Create and show a slider (HScale) that will allow the user to
        /// customize how far in the past to show completed items.
        /// </summary>
        private void CreateRangeSlider()
        {
            // There are five (5) different values allowed here:
            // "Yesterday", "Last7Days", "LastMonth", "LastYear", or "All"
            // Create the slider with 5 distinct "stops"
            rangeSlider = new HScale(0, 4, 1);
            rangeSlider.SetIncrements(1, 1);
            rangeSlider.WidthRequest = 100;
            rangeSlider.DrawValue    = true;

            // TODO: Set the initial value and range
            string rangeStr =
                Application.Preferences.Get(PreferencesKeys.CompletedTasksRange);

            if (rangeStr == null)
            {
                // Set a default value of All
                rangeStr = ShowCompletedRange.All.ToString();
                Application.Preferences.Set(PreferencesKeys.CompletedTasksRange,
                                            rangeStr);
            }

            currentRange              = ParseRange(rangeStr);
            rangeSlider.Value         = (double)currentRange;
            rangeSlider.FormatValue  += OnFormatRangeSliderValue;
            rangeSlider.ValueChanged += OnRangeSliderChanged;
            rangeSlider.Show();

            this.ExtraWidget = rangeSlider;
        }
Example #3
0
 protected override void UpdateView()
 {
     hScale.SetRange(min, max);
     hScale.SetIncrements(step, page);
     hScale.Sensitive = Command.CanExecute();
 }