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

why does AboutDialog extend ScreenView? #156

Closed
pixelzoom opened this issue Sep 8, 2014 · 2 comments
Closed

why does AboutDialog extend ScreenView? #156

pixelzoom opened this issue Sep 8, 2014 · 2 comments

Comments

@pixelzoom
Copy link
Contributor

In #154, we've decided to implement an Options dialog. It will be accessed like the About dialog (from the PhET menu) and have look and behavior similar to the About dialog.

The first thing I did was to look at joist.AboutDialog, to see how it might be generalized. The first thing I noticed is that AboutDialog extends ScreenView, which seems very odd. Is there a reason why AboutDialog must extend ScreenView? What should the type hierarchy for dialogs really look like?

Assigning this to @samreid since he is the original author of AboutDialog.

@samreid
Copy link
Member

samreid commented Sep 11, 2014

As far as I recall (and my memory is a bit fuzzy here), I think AboutDialog extended ScreenView so that it would be guaranteed to be centered and scaled perfectly, and appear in front of everything else in the sim. Perhaps now that the rest of the sim infrastructure/transforms/input/etc has stabilized it would be possible to implement the about dialog as a Node (or Panel) instead of a ScreenView (in my opinion that would be a good step to take if possible).

@samreid samreid assigned pixelzoom and unassigned samreid Sep 11, 2014
@pixelzoom
Copy link
Contributor Author

AboutDialog relies on ScreenView for scaling, and to do positioning (via layoutBounds). Trying to generalize AboutDialog into something that could be generally used for dialogs turned into a major project, and made it clear (to me anyway) that it's not a good approach. So I recommend that we (mostly) ignore the AboutDialog implementation, and come up with a new implementation of dialogs.

Closing this issue, since my question is now answered.

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