-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/phetsims/scenery-phet
- Loading branch information
Showing
8 changed files
with
89 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
js/demo/keyboard/demoSpinnerControlsKeyboardHelpSection.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright 2024, University of Colorado Boulder | ||
|
||
/** | ||
* Demo for SpinnerControlsKeyboardHelpSection. | ||
* | ||
* @author Jesse Greenberg (PhET Interactive Simulations) | ||
*/ | ||
|
||
import Bounds2 from '../../../../dot/js/Bounds2.js'; | ||
import { Node } from '../../../../scenery/js/imports.js'; | ||
import SpinnerControlsKeyboardHelpSection from '../../keyboard/help/SpinnerControlsKeyboardHelpSection.js'; | ||
|
||
export default function demoSpinnerControlsKeyboardHelpSection( layoutBounds: Bounds2 ): Node { | ||
const spinnerSection = new SpinnerControlsKeyboardHelpSection(); | ||
spinnerSection.center = layoutBounds.center; | ||
return spinnerSection; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright 2024, University of Colorado Boulder | ||
|
||
/** | ||
* The keyboard help section that describes how to interact with a "spinner". | ||
* | ||
* @author Jesse Greenberg (PhET Interactive Simulations) | ||
*/ | ||
|
||
import SliderControlsKeyboardHelpSection, { SliderControlsKeyboardHelpSectionOptions } from './SliderControlsKeyboardHelpSection.js'; | ||
import sceneryPhet from '../../sceneryPhet.js'; | ||
import SceneryPhetStrings from '../../SceneryPhetStrings.js'; | ||
import optionize, { EmptySelfOptions } from '../../../../phet-core/js/optionize.js'; | ||
|
||
const spinnerControlsStringProperty = SceneryPhetStrings.keyboardHelpDialog.spinnerControlsStringProperty; | ||
const spinnerStringProperty = SceneryPhetStrings.keyboardHelpDialog.spinnerStringProperty; | ||
|
||
type SelfOptions = EmptySelfOptions; | ||
type ParentOptions = SliderControlsKeyboardHelpSectionOptions; | ||
export type SpinnerControlsKeyboardHelpSectionOptions = SelfOptions & ParentOptions; | ||
|
||
export default class SpinnerControlsKeyboardHelpSection extends SliderControlsKeyboardHelpSection { | ||
public constructor( providedOptions?: SpinnerControlsKeyboardHelpSectionOptions ) { | ||
|
||
const options = optionize<SpinnerControlsKeyboardHelpSectionOptions, SelfOptions, ParentOptions>()( { | ||
headingStringProperty: spinnerControlsStringProperty, | ||
sliderStringProperty: spinnerStringProperty, | ||
|
||
// PhET 'spinners' usually do not support larger steps with the page up/page down keys. | ||
includeLargerStepsRow: false | ||
}, providedOptions ); | ||
|
||
super( options ); | ||
} | ||
} | ||
|
||
sceneryPhet.register( 'SpinnerControlsKeyboardHelpSection', SpinnerControlsKeyboardHelpSection ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters