2015-01-23 13:09:30 +00:00
|
|
|
Htk.Widget = new Class
|
|
|
|
({
|
|
|
|
Extends: Vn.Object
|
2015-03-06 23:33:54 +00:00
|
|
|
,Properties:
|
|
|
|
{
|
|
|
|
class:
|
|
|
|
{
|
|
|
|
type: String
|
|
|
|
,set: function (x)
|
|
|
|
{
|
|
|
|
this.node.className = x +' '+ this.node.className;
|
|
|
|
}
|
|
|
|
,get: function ()
|
|
|
|
{
|
|
|
|
return this.node.className;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-01-23 13:09:30 +00:00
|
|
|
|
|
|
|
/** Main HTML node that represents the widget **/
|
|
|
|
,node: null
|
2015-03-06 23:33:54 +00:00
|
|
|
,builder: null
|
|
|
|
|
|
|
|
,builderInit: function (path)
|
|
|
|
{
|
2015-11-09 08:14:33 +00:00
|
|
|
var builder = new Vn.Builder ();
|
|
|
|
builder.signalData = this;
|
|
|
|
builder.loadXml (path);
|
|
|
|
|
|
|
|
var res = this.builder = builder.load ();
|
|
|
|
this.node = res.$('main');
|
2015-11-17 10:34:33 +00:00
|
|
|
res.link ();
|
2015-03-06 23:33:54 +00:00
|
|
|
}
|
2015-01-23 13:09:30 +00:00
|
|
|
|
|
|
|
,createElement: function (tagName)
|
|
|
|
{
|
|
|
|
this.node = document.createElement (tagName);
|
|
|
|
return this.node;
|
|
|
|
}
|
|
|
|
|
|
|
|
,getNode: function ()
|
|
|
|
{
|
|
|
|
return this.node;
|
|
|
|
}
|
2015-03-09 08:36:54 +00:00
|
|
|
|
2015-03-06 23:33:54 +00:00
|
|
|
,$: function (id)
|
|
|
|
{
|
|
|
|
if (this.builder)
|
2015-11-09 08:14:33 +00:00
|
|
|
return this.builder.getById (id);
|
2015-03-06 23:33:54 +00:00
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
2015-03-15 12:44:57 +00:00
|
|
|
|
|
|
|
,remove: function ()
|
|
|
|
{
|
|
|
|
Vn.Node.remove (this.node);
|
|
|
|
}
|
2015-09-11 09:37:16 +00:00
|
|
|
|
|
|
|
,_destroy: function ()
|
|
|
|
{
|
|
|
|
if (this.builder)
|
|
|
|
this.builder.unref ();
|
|
|
|
|
|
|
|
this.parent ();
|
|
|
|
}
|
2015-01-23 13:09:30 +00:00
|
|
|
});
|