Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Nov 20, 2019 1:29 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Slider Control positioning
PostPosted: Sat Mar 05, 2011 7:34 pm 
Offline

Joined: Wed Jan 31, 2007 9:01 am
Posts: 273
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 2011r3


Top
 Profile  
Reply with quote  
 Post subject: Re: Slider Control positioning
PostPosted: Sat Mar 05, 2011 8:14 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
timer.interval=slider.max-slider.value

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Slider Control positioning
PostPosted: Sat Mar 05, 2011 11:40 pm 
Offline

Joined: Wed Jan 31, 2007 9:01 am
Posts: 273
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 2011r3


Top
 Profile  
Reply with quote  
 Post subject: Re: Slider Control positioning
PostPosted: Sun Mar 06, 2011 12:41 am 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
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
 Profile  
Reply with quote  
 Post subject: Re: Slider Control positioning
PostPosted: Sun Mar 06, 2011 12:44 am 
Offline

Joined: Wed Jul 09, 2008 10:46 pm
Posts: 193
Location: Minneapolis
Since your minimum value is not zero, you should use:
timer.interval = slider.max - slider.value + slider.min

_________________
http://www.miscjunk.org


Top
 Profile  
Reply with quote  
 Post subject: Re: Slider Control positioning
PostPosted: Sun Mar 06, 2011 8:21 am 
Offline

Joined: Wed Jan 31, 2007 9:01 am
Posts: 273
Location: Saratoga Springs, NY area
Hi,

Thanks for your replies and suggestions.

I had tried it, testing timer.interval=slider.max-slider.value. Since the range begins at the minimum of 80, adding the minimum value, as Indy suggested, seems to correct the formula.

timer.interval = slider.max - slider.value + slider.min


Again, much thanks.

Kind Regards,

_________________
writer

Windows 7 Home Premium 64 bit, Core i7, 8G RAM, ATI Radeon HD5770, Release 2011r3


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group