Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Fri Dec 14, 2018 7:40 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Bevel Buttons in cocoa broken
PostPosted: Sat Nov 10, 2012 11:32 pm 
Offline

Joined: Tue Aug 07, 2012 9:46 pm
Posts: 26
I have a program that uses the bevel button in the toggle mode, but with 2012 r1.2 and cocoa it is broken or I don't know how to use it. This code has worked for a long time. If I toggle a button, the logic in the background untoggles other buttons. Is there something I am missing or is this a big bug?

Code like the below doesn't fire correctly

for i = 0 to 3 //set all to false
if i = index then
else
ROTBevel(i).Value = False
end if
next


Thanks

Luke


Top
 Profile  
Reply with quote  
 Post subject: Re: Bevel Buttons in cocoa broken
PostPosted: Sun Nov 11, 2012 12:35 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
Two things...

1.... this is a better way to do it

for i = 0 to 3  // make sure only selected is toggled.
ROTBevel(i).Value = (i=index)
next


2.... You are right ... it works in Carbon... but not in Cocoa.

_________________
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: Bevel Buttons in cocoa broken
PostPosted: Sun Nov 11, 2012 2:03 pm 
Offline

Joined: Tue Aug 07, 2012 9:46 pm
Posts: 26
I wonder if this is going to be fixed or if I need to redesign.


Top
 Profile  
Reply with quote  
 Post subject: Re: Bevel Buttons in cocoa broken
PostPosted: Sun Nov 11, 2012 8:46 pm 
Offline
User avatar

Joined: Fri Sep 30, 2005 11:00 am
Posts: 583
Location: Beautiful Taiwan
lajdesign wrote:
I wonder if this is going to be fixed or if I need to redesign.

A workaround is to call .refresh after setting the value.

A better work around IMHO is to dump the bevel button and replace it with a custom push button, with Cocoa you can modify a push button to function exactly like a bevel button. Although you either need to write a bunch of declares or use the MBS plugin to do so. The main advantage for doing this method is that a pushbutton responds to firstMouseDown, and doesn't need resetting when changing it's value (state in NS terms). Albeit saying that, I haven't yet figured out how to display text and an image in a modified pushbutton come bevel button.

And finally, Apple AHIG actually advises no longer using Bevel Buttons, replace them with segmentviews or icon buttons. Although I'm using them in a situation where segmentviews and icon buttons don't really work.

_________________
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: Bevel Buttons in cocoa broken
PostPosted: Mon Nov 12, 2012 4:01 pm 
Offline

Joined: Tue Aug 07, 2012 9:46 pm
Posts: 26
Thanks. I don't like work arounds, but will put that in.


Top
 Profile  
Reply with quote  
 Post subject: Re: Bevel Buttons in cocoa broken
PostPosted: Sat Dec 01, 2012 9:22 am 
Offline
User avatar

Joined: Tue Oct 24, 2006 3:38 am
Posts: 148
Location: Ger
rowlands wrote:
And finally, Apple AHIG actually advises no longer using Bevel Buttons, replace them with segmentviews or icon buttons. Although I'm using them in a situation where segmentviews and icon buttons don't really work.

Thanks, I think I've to change my Bevel Buttons as well, when I start to compile in Cocoa.

_________________
This is REALbasic 2011r3 on a MacBook Pro Late '10 ("MacBookPro6,2") with Mac OS X 10.8.3


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