中国开发网: 论坛: 程序员情感CBD: 贴子 479281
有狐
eyaai
Class("LINBApp1", null, {
Constructor : function(){
this.Widgets = new linb.UI;
},
Instance : {
InitializeComponents : function(){
var self = this;
this.rootWidget = linb([document.body], false);
// [[designer
//
// label2
//
//create a new linb.UI.Label
this.label2 = new linb.UI.Label();
//set name to label2
this.label2.name("label2");
//set properties
this.label2.setCaption("label2");
//give custom props to label2
this.label2.custom({
"left" : 40,
"top" : 32,
"position" : "absolute",
"zIndex" : 1,
"width" : 48,
"height" : 16
});
//create label2
this.label2.create();
//
//add label2 to parent
this.rootWidget.attach(this.label2, null);
//
// button23
//
//create a new linb.UI.Button
this.button23 = new linb.UI.Button();
//set name to button23
this.button23.name("button23");
//set properties
this.button23.setCaption("button23");
//give custom props to button23
this.button23.custom({
"left" : 120,
"top" : 120,
"position" : "absolute",
"zIndex" : 1,
"width" : 120,
"height" : 20
});
//set events
this.button23.beforeValueChanged(function anonymous(){});
this.button23.onClick(function anonymous(){
alert(label2.$caption)
});
//create button23
this.button23.create();
//
//add button23 to parent
this.rootWidget.attach(this.button23, null);
//
// input4
//
//create a new linb.UI.Input
this.input4 = new linb.UI.Input();
//set name to input4
this.input4.name("input4");
//give custom props to input4
this.input4.custom({
"left" : 88,
"top" : 32,
"position" : "absolute",
"zIndex" : 1,
"width" : 120,
"height" : 20
});
//create input4
this.input4.create();
//
//add input4 to parent
this.rootWidget.attach(this.input4, null);
//
// list1
//
//create a new linb.UI.List
this.list1 = new linb.UI.List();
//set name to list1
this.list1.name("list1");
//set properties
this.list1.setItems([{
"id" : "1",
"caption" : "list1"
},
{
"id" : "2",
"caption" : "list2"
},
{
"id" : "3",
"caption" : "list3"
}]);
//give custom props to list1
this.list1.custom({
"left" : 256,
"top" : 32,
"position" : "absolute",
"zIndex" : 1,
"width" : 120,
"height" : 150
});
//create list1
this.list1.create();
//
//add list1 to parent
this.rootWidget.attach(this.list1, null);
//
// ajax1
//
//create a new linb.DataSource.Ajax
this.ajax1 = new linb.DataSource.Ajax();
//set name to ajax1
this.ajax1.name("ajax1");
//set events
this.ajax1.onRequestOK(function(hash){
this._memory = hash;
this.object.updateConnections()
});
this.ajax1.onRequestFail(function(msg){
this.properties.test = 'msg'
});
//
// request ajax1
this.ajax1.request();
// ]]designer
},
//run build app with thread
start : function(){
var self = this;
linb.thread(null, [function(){
self.iniInfo = 'Components Initializing...';
self.InitializeComponents();
}],
0, function(){
self.iniInfo = 'Loading...';
linb.dom.setCover(self.iniInfo);
},
//set busy status to UI
function(){
linb.dom.setCover('Page Initializing...');
},
//set free status to UI
function(){
linb.dom.setCover(false);
})
.start();
}
},
Static : {},
Initialize : function(){},
Before : function(){},
After : function(){}
});

linb.main(function(){
var app = new LINBApp1;
app.start();
});

window.debug=function(){};

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录