Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Aug 19, 2018 4:59 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: WebSegmentedControl change selection
PostPosted: Mon Aug 13, 2012 11:40 am 
Offline
User avatar

Joined: Tue Jan 04, 2011 3:02 am
Posts: 1236
Location: Jönköping, Sweden
I have a WebSegmentedControl that shows/hides several ContainerControls when clicked.
I want to change the selected segment in code when a button is pushed.
SegmentedControl1.ListIndex = 0 makes the SegmentedControl show/hide the correct ContainerControls but the first segments style is not changing.

Is this a bug or am I getting this all wrong?
I'm not the best "explainer" so take a look at this movie-clip that explains it! :-)
https://www.box.com/s/b1a9c514b7c82900e51a

Any input appreciated!

_________________
Image http://www.linkedin.com/in/albinkiland
Dev. iMac 27" + 2x22" LG (2.8GHz Intel Core i7, 12GB RAM, 120GB SSD) OS X 10.8
Xojo Pro 2013r1


Top
 Profile  
Reply with quote  
 Post subject: Re: WebSegmentedControl change selection
PostPosted: Mon Aug 13, 2012 1:49 pm 
Offline
User avatar

Joined: Fri Sep 30, 2005 11:48 am
Posts: 3554
Location: Lenexa, KS
Don't you need to use the Selected Property for each Cell in the SegmentedControl? http://docs.realsoftware.com/index.php/WebSegmentedControl.Selected

_________________
Bob K.

A blog about being a Real Studio/Xojo developer at http://www.bkeeneybriefs.com


Top
 Profile  
Reply with quote  
 Post subject: Re: WebSegmentedControl change selection
PostPosted: Mon Aug 13, 2012 2:06 pm 
Offline
User avatar

Joined: Tue Jan 04, 2011 3:02 am
Posts: 1236
Location: Jönköping, Sweden
Thank you Bob!
Missed that part in the LR ;)

.Listindex does fire the Action event of the SegmentedControl and .Selected don't so I also hade to show/hide the Containers with some duplicate code as the Action event already hides/shows the Containers.. I would say that .Selected should behave like .Listindex, or something :)
http://docs.realsoftware.com/index.php/ ... .ListIndex

_________________
Image http://www.linkedin.com/in/albinkiland
Dev. iMac 27" + 2x22" LG (2.8GHz Intel Core i7, 12GB RAM, 120GB SSD) OS X 10.8
Xojo Pro 2013r1


Last edited by Akiland on Mon Aug 13, 2012 2:12 pm, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: WebSegmentedControl change selection
PostPosted: Mon Aug 13, 2012 2:09 pm 
Offline
User avatar

Joined: Fri Sep 30, 2005 11:48 am
Posts: 3554
Location: Lenexa, KS
You might have discovered a bug or bad documentation (or both).

_________________
Bob K.

A blog about being a Real Studio/Xojo developer at http://www.bkeeneybriefs.com


Top
 Profile  
Reply with quote  
 Post subject: Re: WebSegmentedControl change selection
PostPosted: Mon Aug 13, 2012 2:10 pm 
Offline
User avatar

Joined: Tue Jan 04, 2011 3:02 am
Posts: 1236
Location: Jönköping, Sweden
Bob Keeney wrote:
You might have discovered a bug or bad documentation (or both).

Edited my post above, but yeah there might be a bug :/

_________________
Image http://www.linkedin.com/in/albinkiland
Dev. iMac 27" + 2x22" LG (2.8GHz Intel Core i7, 12GB RAM, 120GB SSD) OS X 10.8
Xojo Pro 2013r1


Top
 Profile  
Reply with quote  
 Post subject: Re: WebSegmentedControl change selection
PostPosted: Wed Oct 31, 2012 2:26 pm 
Offline
User avatar

Joined: Fri Nov 10, 2006 4:10 pm
Posts: 1855
Location: Michigan, USA
I'm in an identical situation, may I ask how you ended up working around the issue? Did you use both ListIndex and Selected?

Thanks!

_________________
Windows 8 x64
Windows XP Pro SP3
Ubuntu 11.04 via Virtual Box
RS Enterprise 2012r1.1

Programming Tutorials & Free Projects: http://www.JasonTheAdams.com
"Christianity has not been tried and found wanting; it has been found difficult and not tried." - G.K. Chesterton


Top
 Profile  
Reply with quote  
 Post subject: Re: WebSegmentedControl change selection
PostPosted: Wed Oct 31, 2012 2:46 pm 
Offline
User avatar

Joined: Tue Jan 04, 2011 3:02 am
Posts: 1236
Location: Jönköping, Sweden
Jason_Adams wrote:
I'm in an identical situation, may I ask how you ended up working around the issue? Did you use both ListIndex and Selected?
Thanks!


I ended up using .selected and .visible for the container.
SegmentedControl1.Selected(0) = True
SegmentedControl1.Selected(1) = False
WebContainer1.visible = True
WebContainer2.visible = False

and so on.. :)

_________________
Image http://www.linkedin.com/in/albinkiland
Dev. iMac 27" + 2x22" LG (2.8GHz Intel Core i7, 12GB RAM, 120GB SSD) OS X 10.8
Xojo Pro 2013r1


Top
 Profile  
Reply with quote  
 Post subject: Re: WebSegmentedControl change selection
PostPosted: Wed Oct 31, 2012 3:23 pm 
Offline
User avatar

Joined: Fri Nov 10, 2006 4:10 pm
Posts: 1855
Location: Michigan, USA
Right on, that's what I ended up doing. Thanks for letting me know! :)

_________________
Windows 8 x64
Windows XP Pro SP3
Ubuntu 11.04 via Virtual Box
RS Enterprise 2012r1.1

Programming Tutorials & Free Projects: http://www.JasonTheAdams.com
"Christianity has not been tried and found wanting; it has been found difficult and not tried." - G.K. Chesterton


Top
 Profile  
Reply with quote  
 Post subject: SegmentedControl change selection
PostPosted: Wed Dec 12, 2012 2:54 pm 
Offline

Joined: Mon Dec 07, 2009 7:30 pm
Posts: 121
Location: Europe/Italy
How do you change the selection for a segmentedControl with code from another object, lets say a radiobutton?


Top
 Profile  
Reply with quote  
 Post subject: Re: SegmentedControl change selection
PostPosted: Thu Dec 13, 2012 4:06 am 
Offline
User avatar

Joined: Tue Jan 04, 2011 3:02 am
Posts: 1236
Location: Jönköping, Sweden
vfran wrote:
How do you change the selection for a segmentedControl with code from another object, lets say a radiobutton?

Check my previous post :)

_________________
Image http://www.linkedin.com/in/albinkiland
Dev. iMac 27" + 2x22" LG (2.8GHz Intel Core i7, 12GB RAM, 120GB SSD) OS X 10.8
Xojo Pro 2013r1


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