Help on slider control

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jason Charalambides

    Help on slider control

    I need to assign a slider to determine a percentage value for a certain
    variable in my program. I decided to use a slider so that the user will be
    able to manually set a value between 0.000... to 1.000 for that variable.
    The problem for me is how do I associate the slider to that variable? Do I
    need to write something specific within that or do I just give the slider
    control the name of the variable that it shall control?
    Thank you
    J.C.


  • R.Wieser

    #2
    Re: Help on slider control

    Jason Charalambides <jason-@mail.utexas.ed u> schreef in berichtnieuws
    qhZTa.98224$hV. 7521682@twister .austin.rr.com. ..

    Hello Jason,
    [color=blue]
    > I need to assign a slider to determine a percentage value for a certain
    > variable in my program. I decided to use a slider so that the user will[/color]
    be[color=blue]
    > able to manually set a value between 0.000... to 1.000 for that variable.[/color]

    That might be a problem, 'cause the slider seems to work with a long-integer
    (whole numbers only). It looks like you will have to convert yourself (Hint
    : just divide the gotten value by what it can become at max.)
    [color=blue]
    > The problem for me is how do I associate the slider to that variable?[/color]

    You can't/don't. Just like with the other controls, you just, when you need
    it, request whatever you need from the control to be returned. Like as in
    most cases, you can "grab" the current value from the Slider using (what
    else :-) Slider1.value
    [color=blue]
    > Do I need to write something specific within that or do I just give the[/color]
    slider[color=blue]
    > control the name of the variable that it shall control?[/color]

    That's another way to work with the Slider's value (the control pushing it's
    value into the outside world, as opposed to the outside world grabbing it
    from the control).

    You can change an outside variable from within one of the Slider's events.
    The two events that could be used for it are the Change and Scroll -event.
    In either you could place something like :

    {Outside-variable} = Slider1.value
    [color=blue]
    > Thank you[/color]

    You're welcome.

    By the way : Most in the above is generic (is true for all controls), and a
    little (like the exact name of the usable events) was found by me looking in
    the Help-file, under Slider. Just a hint ... :-)

    Regards,
    Rudy Wieser



    Comment

    Working...