Using group of checkboxes
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Using group of checkboxes
Hello guys!
I need to use the group of checkboxes (7 checkboxes). And there must be not more than 4 boxes is checked (0-4). Where i can read some info about it?
I need to use the group of checkboxes (7 checkboxes). And there must be not more than 4 boxes is checked (0-4). Where i can read some info about it?
Re: Using group of checkboxes
Hi Ultravibe,
I highly doubt that there is a tutorial or something for this very special problem.
But hey, it is pure logics, so its solvable with a bit of thinking!
Please check the attached stack and be sure to understand the logics!
Best
Klaus
I highly doubt that there is a tutorial or something for this very special problem.

But hey, it is pure logics, so its solvable with a bit of thinking!

Please check the attached stack and be sure to understand the logics!
Best
Klaus
- Attachments
-
- group_of_checkboxes.livecode.zip
- (1.58 KiB) Downloaded 237 times
Re: Using group of checkboxes
Thank you Klaus!
I've understand the logics of your script. And how can i operate with the values of these checkboxes?
for example: when i got separate checkboxes - everything is simple:
or
how can i use same syntax in button's group? i mean how to spell names of objects in group?
I've understand the logics of your script. And how can i operate with the values of these checkboxes?
for example: when i got separate checkboxes - everything is simple:
Code: Select all
if hilite of button "Check1" is true then --some actions...
Code: Select all
put hilite of button "Check1" into CheckDataVar
Re: Using group of checkboxes
Or i can use the names which i specify in property inspector independantly of grouping objects?
Re: Using group of checkboxes
Hi Ultravibe,
1. of course you should name YOUR buttons, I was just lazy and duplicated the same button a couple of times
2. Hm, why not put everything into the groups script?
When do you want to "trigger" your actions?
When the user CHECKS a button?
In any case I would create another handler in the group like this:
And call it by passing the short name of the target, maybe when checking a button:
Best
Klaus
1. of course you should name YOUR buttons, I was just lazy and duplicated the same button a couple of times

2. Hm, why not put everything into the groups script?
When do you want to "trigger" your actions?
When the user CHECKS a button?
In any case I would create another handler in the group like this:
Code: Select all
command do_something tButtonName
switch tButtonName
case "Check1"
## do something...
break
case "Check2"
## do something else...
break
## etc...
end switch
end do_something
Code: Select all
...
if target_can_be_checked() then
## We can check the target button
set the hilite of the target to TRUE
do_something the short name of the target
else
...
Klaus
Re: Using group of checkboxes
Well, i'll tell you why i using restrictions of checking the boxes (no more than 4 is checked)?
I'm TV-director and soon will be a broadcast of tractor's races. I developing the software (and graphic design) for this event
Initially there are 24-30 riders. And with a few steps (i call it "stages"), some riders are gone.
At the stage #5, i've got 5-7 riders and i need to specify only 4 of them which is coming to semifinal.
Riders are earning points at the stage #5, but the final deсision (who's coming to semifinal) is made by referees.
And my graphics operator just check the boxes of specified riders (we're listening the intercom of referees) and push some kind of "APPLY" button to send only 4 riders to semifinal)))))
So the checkbox group and "APPLY" button is differenet objects!
I'm TV-director and soon will be a broadcast of tractor's races. I developing the software (and graphic design) for this event
Initially there are 24-30 riders. And with a few steps (i call it "stages"), some riders are gone.
At the stage #5, i've got 5-7 riders and i need to specify only 4 of them which is coming to semifinal.
Riders are earning points at the stage #5, but the final deсision (who's coming to semifinal) is made by referees.
And my graphics operator just check the boxes of specified riders (we're listening the intercom of referees) and push some kind of "APPLY" button to send only 4 riders to semifinal)))))
So the checkbox group and "APPLY" button is differenet objects!
Re: Using group of checkboxes
Hi Ultravibe,
aha, I see!
OK. do this:
1. Create a handler like this in the group script, I'm afraid we cannot avoid to check each buttons state:
2. Put this into the "Apply" button:
There are many other ways to implement something like this, but this will work fine in this situation
Best
Klaus
aha, I see!
OK. do this:
1. Create a handler like this in the group script, I'm afraid we cannot avoid to check each buttons state:
Code: Select all
command do_something
switch
case the hilite of btn "Check1"
## do something...
break
case the hilite of btn "Check2"
## do something else...
break
## etc...
end switch
end do_something
Code: Select all
on mouseup
send "do_something" to grp "the checkbox group"
end mouseup

Best
Klaus
Re: Using group of checkboxes
Thank you, one more time!
One more question:
I read a few fields from database - (put revDataFromQuery(tab,return,DatabaseID,QueryString) and put it to variable.
Fields of database is separated by tab characters in this variable. when i put it into fld "ShowTable" separated fields are automatically placed into different cells of fld.
And how can i separate them by program code and put it into different variables? Where can i find info about this?
One more question:
I read a few fields from database - (put revDataFromQuery(tab,return,DatabaseID,QueryString) and put it to variable.
Fields of database is separated by tab characters in this variable. when i put it into fld "ShowTable" separated fields are automatically placed into different cells of fld.
And how can i separate them by program code and put it into different variables? Where can i find info about this?
Re: Using group of checkboxes
Or like this (on screenshot)
I use TextField. And put data which readed from database into TextField. I've enabled the highlighting of one row (without multi-row)
How can i get a number of selected row? What's the right syntax?
I use TextField. And put data which readed from database into TextField. I've enabled the highlighting of one row (without multi-row)
How can i get a number of selected row? What's the right syntax?
- Attachments
-
- screenshot.jpg (36.69 KiB) Viewed 7131 times
Re: Using group of checkboxes
Hi.
It looks like this is a "table field", no? With "list behavior" set to true.
Look in the dictionary for "hilitedLine" and "selectedLine"
Craig Newman
It looks like this is a "table field", no? With "list behavior" set to true.
Look in the dictionary for "hilitedLine" and "selectedLine"
Craig Newman
Re: Using group of checkboxes
Craig Newman, thank you!