Thread: Dynamic Number of Checkboxes
-
January 18th, 2020, 00:47 #1
- Join Date
- Mar 2017
- Posts
- 31
Dynamic Number of Checkboxes
Been trying to puzzle this one out:
How do you go about making a horizontal series of checkboxes, where the amount rendered is equal to a variable set via a basicnumber element in the same window?
In other words, if I set the basicnumber field "Invokes" equal to "3," then I should see three checkboxes appear.
Using plain old CoreRPG as a base, although the extension is meant to "improve" (personal opinion of course) the Fate Core ruleset.
-
January 18th, 2020, 01:02 #2
Couple of ways:
1) Have all of the check boxes defined (assuming you have a definite maximum) and then enable/disable the check boxes through code as the number control is updated. See the setEnabled API command: https://www.fantasygrounds.com/refdo...xcp#setEnabled
2) Dynamically build the checkboxes using the createControl API when the number control is updated - https://www.fantasygrounds.com/refdo...#createControl
I’d tend to go with #1 - unless you potentially have lots and lots and lots of check boxes to create.Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
January 18th, 2020, 01:11 #3
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,422
Or you can look at the ammocounter template used in 3.5E and 5E rulesets that does something similar.
Regards,
JPG
-
January 18th, 2020, 01:14 #4Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
January 18th, 2020, 01:17 #5
- Join Date
- Mar 2017
- Posts
- 31
Thanks for the fast responses, guys! buttongroup_counter seems perfect for what I'm doing here.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks