Skip to content
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

Create general Properties to control all mass/diameter NumberControls #260

Closed
zepumph opened this issue Feb 25, 2021 · 3 comments
Closed

Comments

@zepumph
Copy link
Member

zepumph commented Feb 25, 2021

On the lab screen. In the projectile control panel, we want a single Property that would set all Projectile types's mass NumberControl visible. This will directly change the numberControl.visibleProperty.

We also want this for displayOnlyProperty (see phetsims/sun#686 (comment)), and enabledProperty.

From #244

Here are notes from today's PhET-iO meeting

Just for mass and diameter

baseball mass slider invisble
general mass sliders invisible
general mass sliders visible

A baseball mass slider visible <--------------------- do this (direct control)
B baseball mass slider invisible


This works:
general mass sliders invisible
basball mass sliders visible

CONSENSUS:
The top level Property makes sense to actually manipulate the specific visibleProperties, even though those are still instrumented.

Tagging @arouinfar and @kathy-phet

@zepumph zepumph self-assigned this Feb 25, 2021
zepumph added a commit that referenced this issue Jul 29, 2021
@zepumph
Copy link
Member Author

zepumph commented Jul 29, 2021

The top level Property makes sense to actually manipulate the specific visibleProperties, even though those are still instrumented.

So there is a top level Property, and when it changes, it changes the individual NumberControl.visibleProperty for all object types.

This has been implemented above, see

projectileMotion.labScreen.view.projectileControlPanel.diameterNumberControlsVisibleProperty
projectileMotion.labScreen.view.projectileControlPanel.massNumberControlsVisibleProperty

So the above Properties will actually set all the individual visibleProperties, like

projectileMotion.labScreen.view.projectileControlPanel.carControl.massNumberControl.visibleProperty

This means that you can have this case, which allows for complete flexibility:

  • projectileMotion.labScreen.view.projectileControlPanel.massNumberControlsVisibleProperty is true
  • projectileMotion.labScreen.view.projectileControlPanel.carControl.massNumberControl.visibleProperty is set to false, hiding only that single NumberControl
  • projectileMotion.labScreen.view.projectileControlPanel.massNumberControlsVisibleProperty is still true, and didn't change from changing the more specific Property
  • projectileMotion.labScreen.view.projectileControlPanel.massNumberControlsVisibleProperty is set to false, now all controls, are invisible (but the car one didn't change).
  • projectileMotion.labScreen.view.projectileControlPanel.massNumberControlsVisibleProperty is set to true, now all controls are visible, and all changed (including the car one).

This seems great to me.

I also added code so that the panel will resize when NumberControls are hidden here on the lab screen.

Please review.

@zepumph
Copy link
Member Author

zepumph commented Jul 29, 2021

I created #270 to handle displayOnlyProperty.

@arouinfar
Copy link
Contributor

Thanks @zepumph! I really like how things are behaving in master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants