Skip to content

Commit

Permalink
Added additional configuration options for numberSlider per issue pyr…
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdaversa committed Feb 9, 2023
1 parent 47fb2bf commit 68596b2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pyrevitlib/pyrevit/forms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1278,8 +1278,9 @@ def _setup(self, **kwargs):
self.sliderPrompt.Text = value_prompt
self.numberPicker.Minimum = kwargs.get('min', 0)
self.numberPicker.Maximum = kwargs.get('max', 100)
self.numberPicker.TickFrequency = kwargs.get('interval', 1)
self.numberPicker.Value = \
value_default if isinstance(value_default, float) \
value_default if isinstance(value_default, (float, int)) \
else self.numberPicker.Minimum

def string_value_changed(self, sender, args): #pylint: disable=unused-argument
Expand Down Expand Up @@ -3270,7 +3271,7 @@ def ask_for_date(default=None, prompt=None, title=None, **kwargs):
)


def ask_for_number_slider(default=None, min=0, max=100, prompt=None, title=None, **kwargs):
def ask_for_number_slider(default=None, min=0, max=100, interval=1 prompt=None, title=None, **kwargs):
"""Ask user to select a number value.
This is a shortcut function that configures :obj:`GetValueWindow` for
Expand Down Expand Up @@ -3302,6 +3303,9 @@ def ask_for_number_slider(default=None, min=0, max=100, prompt=None, title=None,
default=default,
prompt=prompt,
title=title,
max=max,
min=min,
interval=interval,
**kwargs
)

Expand Down

0 comments on commit 68596b2

Please sign in to comment.