File tree 1 file changed +29
-0
lines changed
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -495,6 +495,35 @@ class Control extends View {
495
495
}
496
496
497
497
class Label extends View {
498
+ var _content : web . Node = null ;
499
+ var _color : Color = Color . DARK_TEXT ;
500
+
501
+ function constructor ( ) {
502
+ }
503
+
504
+ function constructor ( text : string ) {
505
+ this . setText ( text ) ;
506
+ }
507
+
508
+ function setText ( content : string ) : void {
509
+ this . _content = Util . createTextNode ( content ) ;
510
+ }
511
+
512
+ function setText ( content : web . Node ) : void {
513
+ this . _content = content ;
514
+ }
515
+
516
+ override function _toElement ( ) : web . HTMLElement {
517
+ assert this . _content ! = null ;
518
+
519
+ var element = super . _toElement ( ) ; // <div>
520
+ element . appendChild ( this . _content ) ;
521
+
522
+ var style = element . style ;
523
+ style . color = this . _color . toStyle ( ) ;
524
+
525
+ return element ;
526
+ }
498
527
}
499
528
500
529
class Button extends Control {
You can’t perform that action at this time.
0 commit comments