-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replace VerticalAquaRadioButtonGroup and VerticalCheckBoxGroup with layout managers #30
Comments
I have to say... This got even worse after it was instrumented for PhET-iO. For example, in VerticalCheckBoxGroup, the tandem for each check box is set like this: 65 tandem: options.tandem.createTandem( items[ i ].tandemName || 'checkBox' ) If I had used this in BLL, the There's a similar problem in tandem ids for the AquaRadioButtons created by VerticalAquaRadioButtonGroup. @samreid Do you agree that this is a little messed up? |
We struggled with the same problem in ComboBox and settled on a similar strategy: itemNodeTandem = options.tandem.createTandem( itemNodeOptions.tandemName || 'comboBoxItemNode' ); Forces and Motion: Basics uses VerticalCheckBoxGroup like so: this.verticalCheckBoxGroup = new VerticalCheckBoxGroup( [
{
content: new Text( sumOfForcesString, _.extend( { tandem: tandem.createTandem( 'showSumOfForcesTextNode' ) }, fontOptions ) ),
property: model.showSumOfForcesProperty,
tandemName: 'showSumOfForcesCheckBox'
},
{
content: new Text( valuesString, _.extend( { tandem: tandem.createTandem( 'showValuesTextNode' ) }, fontOptions ) ),
property: model.showValuesProperty,
tandemName: 'showValuesCheckBox'
},
{
content: showSpeedContent,
property: model.showSpeedProperty,
tandemName: 'showSpeedCheckBox'
}
], {
tandem: tandem.createTandem( 'verticalCheckBoxGroup' )
} );
Perhaps we should document (and possibly have assertions?) that the item tandems should end in "CheckBox" for VCBG and "RadioButton" for VARBG? |
In ComboBox, it's the item tandem ids that are automatically created. So we end up with ids like |
Why would it be reasonable to have |
It should be |
I'm confused, we should chat! |
If you created your own CheckBox inside of a Panel, the id for the Panel would presumably be something like 'forcesControlPanel', and the CheckBox would be 'forcesControlPanel.showAppliedForceCheckBox', not 'forcesControlPanel.showAppliedForce'. |
As pointed out in #30 (comment) the tandems end in |
OK, I see... The client is responsible for the "*CheckBox" name. |
This doesn't appear to be a problem anymore, now that VBox is used. Closing. |
Add layout managers, either in scenery, sun or scenery-phet, to make these groups go away.
Or clean up these groups, and generalize to one 'vertical group' that is independent of component type. There is duplicate code here.
The text was updated successfully, but these errors were encountered: