import { Event } from "laya/events/Event" ; import { Box } from "laya/ui/Box" ; import { Label } from "laya/ui/Label" ; import { TestPageUI } from "../ui/test/TestPageUI" ; import { Main } from "./../Main" ; export class IDE_Project extends TestPageUI { Main : typeof Main = null ; constructor ( maincls ) { super ( ) ; this . Main = maincls ; this . Main . box2D . addChild ( this ) ; this . btn . on ( Event . CLICK , this , this . onBtnClick ) ; this . btn2 . on ( Event . CLICK , this , this . onBtn2Click ) ; this . cacheAs = "bitmap" ; } private onBtnClick ( ) { this . radio . selectedIndex = 1 ; this . clip . index = 8 ; this . tab . selectedIndex = 2 ; this . combobox . selectedIndex = 0 ; this . check . selected = true ; } private onBtn2Click ( ) { this . box . dataSource = { slider : 50 , scroll : 80 , progress : 0.2 , input : "This is a input" , label : { color : "#ff0000" , text : "Hello LayaAir" } } ; var arr = [ ] ; for ( var i = 0 ; i < 100 ; i ++ ) { arr . push ( { label : "item " + i , clip : i % 9 } ) ; } this . list . array = arr ; } private onListRender ( item , index ) { var label = ( < Label > item . getChildByName ( "label" ) ) ; if ( index % 2 ) { label . color = "#ff0000" ; } else { label . color = "#000000" ; } } dispose ( ) { this . removeChildren ( ) ; this . removeSelf ( ) ; } }