Options buttons and script

This is the place to discuss anything relating to MobGUI

Moderators: heatherlaine, kevinmiller, robinmiller, malte, splash21

Post Reply
ludo
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 72
Joined: Mon Dec 03, 2007 6:10 pm

Options buttons and script

Post by ludo » Tue Jan 21, 2014 2:49 pm

Hello,

How set the "selected" button of a cluster by script.

I try without success :
set the mgoption of grp "xx" to the id of grp "yy" of grp "xx"

xx = the cluster
yy = the button.


The goal is to "reset" alls choices and returns to default value for each controls.

Thanks.

splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Location: UK
Contact:

Re: Options buttons and script

Post by splash21 » Tue Jan 21, 2014 3:06 pm

Hi, Ludo.

If you have a cluster of 3 options buttons (Option1, Option2 and Option3), you can select one by;

Code: Select all

send "mouseDown" to group "Option1"
HTH!
LiveCode Development & Training : http://splash21.com

ludo
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 72
Joined: Mon Dec 03, 2007 6:10 pm

Re: Options buttons and script

Post by ludo » Tue Jan 21, 2014 3:15 pm

splash21 wrote:Hi, Ludo.

If you have a cluster of 3 options buttons (Option1, Option2 and Option3), you can select one by;

Code: Select all

send "mouseDown" to group "Option1"
HTH!
So simple ! Thanks !

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7240
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Options buttons and script

Post by jacque » Tue Jan 21, 2014 5:04 pm

Are they really option buttons or are they radio buttons? If they are radio buttons then use either the hilitedButtonName or the hilitedButton.

Code: Select all

set the hilitedButtonName of grp xx to yy
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Location: UK
Contact:

Re: Options buttons and script

Post by splash21 » Tue Jan 21, 2014 9:13 pm

jacque wrote:Are they really option buttons ... ?
They are custom buttons :D
Options.png
Options.png (9.37 KiB) Viewed 6599 times
LiveCode Development & Training : http://splash21.com

roddy
Posts: 40
Joined: Tue Mar 04, 2014 7:24 pm

Re: Options buttons and script

Post by roddy » Thu Mar 20, 2014 5:02 pm

I was having a problem with navigating to a card that contained my mg control group where the correct button wasn't highlighted. This worked for me in the card script:

on opencard
send "mouseDown" to group "Home"
put "Home" into fld "mgcLabel"
end opencard

roddy
Posts: 40
Joined: Tue Mar 04, 2014 7:24 pm

Re: Options buttons and script

Post by roddy » Fri Mar 21, 2014 10:54 pm

actually,
put "Home" into fld "mgcLabel"
stopped working, not sure why.

when navigating to card 2 which contains my MobGui control group from my splash card (that does not contain the control group), the title still shows the last tab option and potentially the wrong tab option...

splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Location: UK
Contact:

Re: Options buttons and script

Post by splash21 » Sat Mar 22, 2014 1:04 pm

Hi, Roddy. If you're referencing the control components, you can also specify the actual control group;

Code: Select all

put "Home" into fld "mgcLabel" of group "MyButton"
Does this help?
LiveCode Development & Training : http://splash21.com

Post Reply

Return to “MobGUI”