Code: Select all
// The default code is a com class (inherited from xui.Com)
Class('App', 'xui.Com',{
// Ensure that all the value of "key/value pair" does not refer to external variables
Instance:{
// To initialize instance(e.g. properties)
initialize : function(){
// To determine whether or not the com will be destroyed, when the first UI control be destroyed
this.autoDestroy = true;
// To initialize properties
this.properties = {};
},
// To initialize internal components (mostly UI controls)
// *** If you're not a skilled, dont modify this function manually ***
iniComponents : function(){
// [[Code created by CrossUI RAD Tools
var host=this, children=[], append=function(child){children.push(child.get(0));};
append((new xui.UI.Panel())
.setHost(host,"ctl_panel4")
.setDock("left")
.setWidth(130)
.setZIndex(1)
.setOverflow("auto")
.setCaption("ctl_panel4")
);
host.ctl_panel4.append(new xui.UI.Pane().setPosition('absolute').setDock('fill').setHost(host,'ctl_div1'));
for(var i = 0; i < 40; i++) {
host.ctl_div1.append((new xui.UI.Input())
.setLeft(0)
.setTop(0)
.setWidth(100)
.setPosition("relative")
);
}
return children;
// ]]Code created by CrossUI RAD Tools
},
// Give a chance to load other com
iniExComs : function(com, threadid){
},
// Give a chance to determine which UI controls will be appended to parent container
customAppend : function(parent, subId, left, top){
// "return false" will cause all the internal UI controls will be added to the parent panel
return false;
},
// This instance's events
events : {},
_ctl_sbutton1_onclick : function (profile, e, src, value) {
var uictrl = profile.boxing();
xui.alert("hi","I'm " + uictrl.getAlias());
}
}
});