New topic: Slider Control positioning
<http://forums.realsoftware.com/viewtopic.php?t=37960> Page 1 of 1 [ 5 posts ] Previous topic | Next topic Author Message writer Post subject: Slider Control positioningPosted: Sat Mar 05, 2011 7:34 pm Joined: Wed Jan 31, 2007 9:01 am Posts: 267 Location: Saratoga Springs, NY area Hi, I am using a slider control so that the user can increase or decrease a timer's time (in ms) interval. So, the higher the interval the slower the timer fires. The problem is that if the slider is moved right, this equates with an end result of slowing the timer (larger time interval='more means less'). One solution would be to flip the slider upside down to create the illusion of 'more means more,' less means less.' Can't figure out how to do this. An alternative would be to change the values by math formula so somehow increasing the slider value would result in an inverse value for the timer interval, etc. Something like that...but can't get my brain around it. Any suggestions on how to achieve the result? Kind Regards, _________________ writer Windows 7 Home Premium 64 bit, Core i7, 8G RAM, ATI Radeon HD5770, Release 2010-5 Top DaveS Post subject: Re: Slider Control positioningPosted: Sat Mar 05, 2011 8:14 pm Joined: Sun Aug 05, 2007 10:46 am Posts: 2830 Location: San Diego, CA timer.interval=slider.max-slider.value _________________ Dave Sisemore MacPro, OSX 10.6.4 RB2009r5.1 Note : I am not interested in any solutions that involve custom Plug-ins of any kind Top writer Post subject: Re: Slider Control positioningPosted: Sat Mar 05, 2011 11:40 pm Joined: Wed Jan 31, 2007 9:01 am Posts: 267 Location: Saratoga Springs, NY area Hi Dave, Thanks for your help. The slider's range is 80-120 ms. 80 for the timer's interval will increase the speed of change, whereas 120 will slow the change down. If I set this up as .maximum - .value, and do the math, I can't figure out how this will preserve the correct value if, for example, the user sets the slider to 120. The actual values need to be preserved, and the slider needs to appear like moving it to a bigger value is speeding up the change (when in actuality it is not). I think I am asking for a way to create an "illusion" rather than label this slider as 'the higher the value, the slower the change.' Maybe there is simply no other way than labeling it as mentioned to do this? (Ideally, rotating the slider upside down, would probably work, but this does not seem possible.) Sorry if I am not describing the goal clearly. Kind Regards, _________________ writer Windows 7 Home Premium 64 bit, Core i7, 8G RAM, ATI Radeon HD5770, Release 2010-5 Top timhare Post subject: Re: Slider Control positioningPosted: Sun Mar 06, 2011 12:41 am Joined: Fri Jan 06, 2006 3:21 pm Posts: 9392 Location: Portland, OR USA Other than adding some offset to the equation, Dave's code should do exactly what you want. Did you try it? Top Indy Post subject: Re: Slider Control positioningPosted: Sun Mar 06, 2011 12:44 am Joined: Wed Jul 09, 2008 10:46 pm Posts: 174 Location: Minneapolis Since your minimum value is not zero, you should use: Code:timer.interval = slider.max - slider.value + slider.min _________________ http://www.miscjunk.org Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 5 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
