Skip to content

Commit

Permalink
convert to new ComboBoxItem, phetsims/sun#450
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Malley <[email protected]>
  • Loading branch information
pixelzoom committed Jan 17, 2019
1 parent 8f0d798 commit 7e698c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion js/demo/testing/view/RemoveAndDisposeTestPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ define( function( require ) {

// modules
const ComboBox = require( 'SUN/ComboBox' );
const ComboBoxItem = require( 'SUN/ComboBoxItem' );
const HBox = require( 'SCENERY/nodes/HBox' );
const inherit = require( 'PHET_CORE/inherit' );
const Node = require( 'SCENERY/nodes/Node' );
Expand Down Expand Up @@ -85,7 +86,7 @@ define( function( require ) {
// create the combo box for selecting the type of sound generator to add
const comboBoxItems = [];
_.keys( SOUND_GENERATOR_INFO ).forEach( soundGeneratorKey => {
comboBoxItems.push( ComboBox.createItem(
comboBoxItems.push( new ComboBoxItem(
new Text( SOUND_GENERATOR_INFO[ soundGeneratorKey ].comboBoxName, { font: COMBO_BOX_FONT } ),
soundGeneratorKey
) );
Expand Down
5 changes: 3 additions & 2 deletions js/demo/testing/view/SoundEncodingComparisonPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ define( function( require ) {

// modules
const ComboBox = require( 'SUN/ComboBox' );
const ComboBoxItem = require( 'SUN/ComboBoxItem' );
const HBox = require( 'SCENERY/nodes/HBox' );
const HStrut = require( 'SCENERY/nodes/HStrut' );
const inherit = require( 'PHET_CORE/inherit' );
Expand Down Expand Up @@ -207,7 +208,7 @@ define( function( require ) {
sounds.forEach( ( soundDescriptor, index ) => {

// create the combo box item for selecting this sound
soundSelectorComboBoxItems.push( ComboBox.createItem(
soundSelectorComboBoxItems.push( new ComboBoxItem(
new Text( soundDescriptor.soundName, { font: COMBO_BOX_FONT } ),
index
) );
Expand All @@ -216,7 +217,7 @@ define( function( require ) {
const encodingSelectorComboBoxItems = [];
soundDescriptor.encodings.forEach( ( encoding, encodingIndex ) => {
const stereoMonoString = encoding.stereo ? '(stereo)' : '(mono)';
encodingSelectorComboBoxItems.push( ComboBox.createItem(
encodingSelectorComboBoxItems.push( new ComboBoxItem(
new Text( encoding.format + ' ' + encoding.rate + ' ' + stereoMonoString, { font: COMBO_BOX_FONT } ),
encodingIndex
) );
Expand Down

0 comments on commit 7e698c9

Please sign in to comment.