Skip to content

Commit

Permalink
add Checkbox to sun demo app, #488
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Mar 28, 2019
1 parent ebb5ab1 commit 8ac863c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions js/demo/ComponentsScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ define( function( require ) {
var AccordionBox = require( 'SUN/AccordionBox' );
var AlignBox = require( 'SCENERY/nodes/AlignBox' );
var AlignGroup = require( 'SCENERY/nodes/AlignGroup' );
var BooleanProperty = require( 'AXON/BooleanProperty' );
var Carousel = require( 'SUN/Carousel' );
var Checkbox = require( 'SUN/Checkbox' );
var Circle = require( 'SCENERY/nodes/Circle' );
Expand Down Expand Up @@ -55,6 +56,7 @@ define( function( require ) {
* {function(Bounds2): Node} createNode - creates the scene graph for the demo
*/
{ label: 'Carousel', createNode: demoCarousel },
{ label: 'Checkbox', createNode: demoCheckbox },
{ label: 'ComboBox', createNode: demoComboBox },
{ label: 'HSlider', createNode: demoHSlider },
{ label: 'VSlider', createNode: demoVSlider },
Expand Down Expand Up @@ -136,6 +138,28 @@ define( function( require ) {
} );
};

var demoCheckbox = function( layoutBounds ) {

const property = new BooleanProperty( true );
const enabledProperty = new BooleanProperty( true );

const checkbox = new Checkbox( new Text( 'My Awesome Checkbox', {
font: new PhetFont( 30 )
} ), property, {
enabledProperty: enabledProperty
} );

const enabledCheckbox = new Checkbox( new Text( 'enabled', {
font: new PhetFont( 20 )
} ), enabledProperty );

return new VBox( {
children: [ checkbox, enabledCheckbox ],
spacing: 30,
center: layoutBounds.center
} );
};

// Creates a demo of ComboBox
var demoComboBox = function( layoutBounds ) {

Expand Down

0 comments on commit 8ac863c

Please sign in to comment.