-
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.
https://github.com/phetsims/scenery-phet/issues/853
- Loading branch information
1 parent
43a25d2
commit c4f3651
Showing
6 changed files
with
114 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
17 changes: 17 additions & 0 deletions
17
js/demo/keyboard/demoHeaterCoolerControlsKeyboardHelpSection.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 HeaterCoolerControlsKeyboardHelpSection. | ||
* | ||
* @author Jesse Greenberg (PhET Interactive Simulations) | ||
*/ | ||
|
||
import Bounds2 from '../../../../dot/js/Bounds2.js'; | ||
import { Node } from '../../../../scenery/js/imports.js'; | ||
import HeaterCoolerControlsKeyboardHelpSection from '../../keyboard/help/HeaterCoolerControlsKeyboardHelpSection.js'; | ||
|
||
export default function demoHeaterCoolerControlsKeyboardHelpSection( layoutBounds: Bounds2 ): Node { | ||
const section = new HeaterCoolerControlsKeyboardHelpSection(); | ||
section.center = layoutBounds.center; | ||
return section; | ||
} |
42 changes: 42 additions & 0 deletions
42
js/keyboard/help/HeaterCoolerControlsKeyboardHelpSection.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,42 @@ | ||
// Copyright 2024, University of Colorado Boulder | ||
|
||
/** | ||
* The keyboard help section that describes how to interact with a HeaterCoolerNode. | ||
* | ||
* @author Jesse Greenberg (PhET Interactive Simulations) | ||
*/ | ||
|
||
import SliderControlsKeyboardHelpSection, { ArrowKeyIconDisplay, SliderControlsKeyboardHelpSectionOptions } from './SliderControlsKeyboardHelpSection.js'; | ||
import sceneryPhet from '../../sceneryPhet.js'; | ||
import optionize, { EmptySelfOptions } from '../../../../phet-core/js/optionize.js'; | ||
import KeyboardHelpSectionRow from './KeyboardHelpSectionRow.js'; | ||
import NumberKeyNode from '../NumberKeyNode.js'; | ||
import SceneryPhetStrings from '../../SceneryPhetStrings.js'; | ||
|
||
type SelfOptions = EmptySelfOptions; | ||
type ParentOptions = SliderControlsKeyboardHelpSectionOptions; | ||
export type HeaterCoolerControlsKeyboardHelpSectionOptions = SelfOptions & ParentOptions; | ||
|
||
export default class HeaterCoolerControlsKeyboardHelpSection extends SliderControlsKeyboardHelpSection { | ||
public constructor( providedOptions?: HeaterCoolerControlsKeyboardHelpSectionOptions ) { | ||
|
||
const offIcon = new NumberKeyNode( 0 ); | ||
const offStringRow = KeyboardHelpSectionRow.labelWithIcon( SceneryPhetStrings.keyboardHelpDialog.heatCoolOffStringProperty, offIcon ); | ||
|
||
const options = optionize<HeaterCoolerControlsKeyboardHelpSectionOptions, SelfOptions, ParentOptions>()( { | ||
arrowKeyIconDisplay: ArrowKeyIconDisplay.UP_DOWN, | ||
|
||
headingStringProperty: SceneryPhetStrings.keyboardHelpDialog.heatCoolControlsStringProperty, | ||
jumpToMaximumStringProperty: SceneryPhetStrings.keyboardHelpDialog.maximumHeatStringProperty, | ||
jumpToMinimumStringProperty: SceneryPhetStrings.keyboardHelpDialog.maximumCoolStringProperty, | ||
|
||
additionalRows: [ | ||
offStringRow | ||
] | ||
}, providedOptions ); | ||
|
||
super( options ); | ||
} | ||
} | ||
|
||
sceneryPhet.register( 'HeaterCoolerControlsKeyboardHelpSection', HeaterCoolerControlsKeyboardHelpSection ); |
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