Skip to content

Commit

Permalink
phetioReadOnly change requests, #344
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Jul 28, 2023
1 parent b554334 commit 56d3d94
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions js/common/model/ProportionsModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export default class ProportionsModel extends PhetioObject {
const currentStartCountsProperty = new Property<BunnyCounts | null>( null, {
tandem: options.tandem.createTandem( 'currentStartCountsProperty' ),
phetioFeatured: true,
phetioReadOnly: true,
phetioValueType: NullableIO( BunnyCounts.BunnyCountsIO ),
phetioDocumentation: 'Counts at the start of the current generation'
} );
Expand Down
1 change: 1 addition & 0 deletions js/common/model/createBunnyArray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export default function createBunnyArray( providedOptions: BunnyArrayOptions ):
tandem: options.tandem.createTandem( 'countsProperty' ),
phetioValueType: BunnyCounts.BunnyCountsIO,
phetioFeatured: options.countsPropertyFeatured,
phetioReadOnly: true,
phetioState: false // because counts will be restored as Bunny instances are restored to BunnyGroup
} );

Expand Down
5 changes: 2 additions & 3 deletions js/common/view/pedigree/AllelesPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,15 @@ class Row extends VBox {
isDisposable: false
}, providedOptions );

const checkboxTandem = options.tandem.createTandem( 'checkbox' );

const text = new Text( gene.nameProperty, {
font: NaturalSelectionConstants.CHECKBOX_FONT,
maxWidth: 100 // determined empirically
} );

const checkbox = new Checkbox( visibleProperty, text,
combineOptions<CheckboxOptions>( {}, NaturalSelectionConstants.CHECKBOX_OPTIONS, {
tandem: checkboxTandem
tandem: options.tandem.createTandem( 'checkbox' ),
phetioVisiblePropertyInstrumented: false // see https://github.com/phetsims/natural-selection/issues/344
} ) );
const xDilation = 8;
const yDilation = 8;
Expand Down
6 changes: 4 additions & 2 deletions js/common/view/population/PopulationGenerationScroller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ export default class PopulationGenerationScroller extends HBox {
};
const backButton = new ArrowButton( 'left', back,
combineOptions<ArrowButtonOptions>( {
tandem: options.tandem.createTandem( 'backButton' )
tandem: options.tandem.createTandem( 'backButton' ),
enabledPropertyOptions: { phetioReadOnly: true }
}, NaturalSelectionConstants.ARROW_BUTTON_OPTIONS )
);

Expand All @@ -83,7 +84,8 @@ export default class PopulationGenerationScroller extends HBox {
};
const forwardButton = new ArrowButton( 'right', forward,
combineOptions<ArrowButtonOptions>( {
tandem: options.tandem.createTandem( 'forwardButton' )
tandem: options.tandem.createTandem( 'forwardButton' ),
enabledPropertyOptions: { phetioReadOnly: true }
}, NaturalSelectionConstants.ARROW_BUTTON_OPTIONS )
);

Expand Down

0 comments on commit 56d3d94

Please sign in to comment.