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
|
define.class('$ui/button', function(require,$ui$, textbox, label, view){
this.attributes = {
commands:[],
}
this.oninit = function(){
this.buttoncolor1 = this.bgcolor;
this.buttoncolor2 = this.bgcolor;
}
this.borderwidth =0 ;
this.borderradius = 0;
this.padding = 4;
this.render = function(){
var res = [];
this.buttonres = undefined;
this.iconres = undefined
if (this.icon && this.icon.length > 0){
this.iconres = icon({alignself:"center", fgcolor:this.textcolor, bgcolor:NaN,icon: this.icon});
res.push(this.iconres);
}
if (this.text && this.text.length > 0){
this.buttonres = label({alignself:"center", bgcolor:NaN, fgcolor:this.textcolor, position: "relative", text: this.text})
res.push(this.buttonres);
}
return view({bgcolor:NaN,margin:this.internalmargin, alignitems:"center", flexdirection:"row",justifycontent:"center"},res);
}
})
|