Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Tue Nov 21, 2017 10:54 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Slider - Cocoa
PostPosted: Fri Apr 19, 2013 3:38 pm 
Offline

Joined: Fri Sep 30, 2005 7:20 pm
Posts: 857
I have a slider with the settings of -100 for minimum and 100 for maximum. This works in Carbon, but the negative values are ignored in Cocoa.

I'm using RS 2012r2...is this a bug or standard behavior?

Thanks,

Kuzey

_________________
MY 3D Blog


Top
 Profile  
Reply with quote  
 Post subject: Re: Slider - Cocoa
PostPosted: Fri Apr 19, 2013 3:56 pm 
Offline

Joined: Mon May 30, 2011 12:56 am
Posts: 702
Make your slider have min 0 and max 200.
Subtract 100 from .value before use


Top
 Profile  
Reply with quote  
 Post subject: Re: Slider - Cocoa
PostPosted: Fri Apr 19, 2013 4:09 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
kermit wrote:
Make your slider have min 0 and max 200.
Subtract 100 from .value before use


you mean from min 100 to max 200

_________________
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 - Cocoa
PostPosted: Fri Apr 19, 2013 4:33 pm 
Offline

Joined: Fri Sep 30, 2005 7:20 pm
Posts: 857
Thanks guys,

I hope they update the language reference so I won't forget in a few months.

I do believe kermit is right, 0 to 200 and set the value to 100 in the property panel...so it's in the center on open & you have 100 on either side...I think.

:)

Kuzey

_________________
MY 3D Blog


Top
 Profile  
Reply with quote  
 Post subject: Re: Slider - Cocoa
PostPosted: Fri Apr 19, 2013 9:59 pm 
Offline
User avatar

Joined: Fri Sep 30, 2005 11:00 am
Posts: 583
Location: Beautiful Taiwan
Kuzey wrote:
Thanks guys,

I hope they update the language reference so I won't forget in a few months.

I do believe kermit is right, 0 to 200 and set the value to 100 in the property panel...so it's in the center on open & you have 100 on either side...I think.

:)

Kuzey

Indeed that will work, or you could use a declare to get at NSSlider's value.
soft declare function doubleValue lib "Cocoa" selector "doubleValue" (Ref as integer) as Double
return doubleValue(me.handle)

_________________
Sam Rowlands
rMBP 15" @ 10.8 & '08 MBA 13" @ 10.6 + 10.7, RB2012
http://www.ohanaware.com/
AppWrapper - Prepare Apps for Mac App Store & OS X 10.8 - http://www.ohanaware.com/appwrapper/


Top
 Profile  
Reply with quote  
 Post subject: Re: Slider - Cocoa
PostPosted: Sat Apr 20, 2013 5:57 am 
Offline

Joined: Fri Sep 30, 2005 7:20 pm
Posts: 857
Hi Sam,

How would you actually use that, I have no experience with declares.


Kuzey

_________________
MY 3D Blog


Top
 Profile  
Reply with quote  
 Post subject: Re: Slider - Cocoa
PostPosted: Sat Apr 20, 2013 6:38 am 
Offline
User avatar

Joined: Fri Sep 30, 2005 11:00 am
Posts: 583
Location: Beautiful Taiwan
Kuzey wrote:
Hi Sam,

How would you actually use that, I have no experience with declares.


Kuzey


okay - this is untested, but it should go something like...

soft declare function doubleValue lib "Cocoa" selector "doubleValue" (Ref as integer) as Double
Dim sliderValue as double = doubleValue( slider1.handle)


where slider1 is the name of your slider. Once you've gotten it working, you can wrap it into a method so you can use it in many places.

_________________
Sam Rowlands
rMBP 15" @ 10.8 & '08 MBA 13" @ 10.6 + 10.7, RB2012
http://www.ohanaware.com/
AppWrapper - Prepare Apps for Mac App Store & OS X 10.8 - http://www.ohanaware.com/appwrapper/


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 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