zhuguifei
2026-03-10 58402bd5e762361363a0f7d7907153c77dbb819f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/**
    @name Edo.controls.Label
    @class
    @typeName label
    @description 文本显示框
    @extend Edo.controls.Control
*/
Edo.controls.Label = function(){
 
    Edo.controls.Label.superclass.constructor.call(this);
};
Edo.controls.Label.extend(Edo.controls.Control,{
    elCls: 'e-label',
    /**
        @name Edo.controls.Label#autoWidth
        @property
        @default true
    */
    autoWidth: true,
    /**
        @name Edo.controls.Label#autoHeight
        @property
        @default true
    */
    autoHeight: true,
    /**
        @name Edo.controls.Label#minWidth
        @property
        @default 20
    */
    minWidth: 20,
        
 
    /**
        @name Edo.controls.Label#text
        @property
        @type String
        @description 文本
    */
    text: '',    
    /**
        @name Edo.controls.Label#forId
        @property    
        @type {String}
        @description 目标组件ID
    */
    forId: '',
    
//    sizeSet: false,
//    widthGeted: false,
      
    getInnerHtml: function(sb){
        sb[sb.length] = this.text;
    },
    _setText: function(value){
        if(this.text !== value){
            this.text = value;
            if(this.el){
                this.el.innerHTML = value;
                //this.el.style.width = 'auto';
            }
            if(!Edo.isInt(this.width)){
                this.widthGeted = false;                
//                this.el.style.width = 'auto';
//                Edo.util.Dom.repaint(this.el);
            }
            if(!Edo.isInt(this.height)){
                this.heightGeted = false;
            }
            this.changeProperty('text', value);
            this.relayout('text', value);
        }
    }     
});
 
Edo.controls.Label.regType('label');