B4A Class Input Slider Class

Discussion in 'Additional libraries, classes and official updates' started by stevel05, Jun 18, 2012.

  1. red30

    red30 Active Member Licensed User

    "Y" And how to change the axis. To the upper position and the maximum value was at minimum lower. For vertical slider ...
     
  2. SandroB4A

    SandroB4A Member Licensed User

    Hi all,

    I like very much this Slider Class and I tried to do a change I need without success :(, I'd like to use a discrete value different than 1.

    For example I want a slider with values from 0 to 20 every 5.

    Someone can help me?

    Thanks

    EDIT: I realized it's an abovious question, I simply set the range from 0 to 4 and then multiply by 5 all the results...
     
    Last edited: Apr 3, 2017
    Jaco vd Walt likes this.
  3. stevel05

    stevel05 Expert Licensed User

    @SandroB4A Check InputSlider1-2.zip in the first post. I have added a Steps method, it should do what you want.

    If you are using a different version, you should be able to copy the relevant code to that version.
     
    SandroB4A likes this.
  4. SandroB4A

    SandroB4A Member Licensed User

    Thank you, works fine!
     
  5. Duncan H Williamson

    Duncan H Williamson Member Licensed User

    Hi
    This is a great slider !! I am having one small problem, I have set the maxval to 100 however when I slide the slider to the right the value shows as 577.
    I need the slider to go from 0 to 100...
    Regards

    Duncan
     
  6. stevel05

    stevel05 Expert Licensed User

    Can you post your code
     
    Duncan H Williamson likes this.
  7. Duncan H Williamson

    Duncan H Williamson Member Licensed User

    Code:
    InputSlider1.SetSliderColor(Colors.blue)
        InputSlider1.SetMaxVal(
    100)
        InputSlider1.SetValue(
    0)
        InputSlider1.SetDiscrete(
    True)
        InputSlider1.SetPointerCount(
    1)
    this is in activity create
    Code:
    Sub inputslider1_ValuesChanged(Values() As Float)
       Label1.Text = 
    NumberFormat(Values(0), 10)
    End Sub
    end this sub should display 0 to 100
     
  8. stevel05

    stevel05 Expert Licensed User

    OK, you are using DaveW's version. I think you need to set the number of pointers before anything else try changing your code to:

    Code:
    InputSlider1.SetPointerCount(1)
        InputSlider1.SetSliderColor(
    Colors.blue)
        InputSlider1.SetMaxVal(
    100)
        InputSlider1.SetValue(
    0)
        InputSlider1.SetDiscrete(
    True)
     
    Duncan H Williamson likes this.
  9. Duncan H Williamson

    Duncan H Williamson Member Licensed User

    Thanks Steve, that has sorted the problem
    Regards

    Duncan
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice