/*______________________________________________________________________
|        ______   |
|      /      /   |
|     /    O /    |      ___________________________________________
|    /    / /     |
|   /    / /  /|  |       U I Z E     J A V A S C R I P T     A P I
|  /____/ /__/_|  |      ___________________________________________
|            |__  |
|_________________|
|
|           TITLE : Uize.Widget Object
|         VERSION : 1.0
|            TYPE : Object Definition
|          AUTHOR : Chris van Rensburg (http://www.tomkidding.com)
|       COPYRIGHT : (c)2005 Chris van Rensburg
|     DESCRIPTION : Implements a base class that serves as a foundation for various UI widget subclasses
|        REQUIRES : Uize.js
|                   Uize.Element.js
|_______________________________________________________________________*/
(function(){var b_a=null,b_b=true,b_c=false,b_d=Uize.Element;var b_e=Uize.Widget=Uize.subclass(function(){var b_f=this;this.childWidgets={instances:{},add:function(b_g,b_h){
this.instances[b_g]=b_h;b_h.parentWidget=b_f;},insertUi:function(){b_e.doForObjects(this.instances,'insertUi')},removeUi:function(){b_e.doForObjects(this.instances,'removeUi')},updateUi:function(){b_e.doForObjects(this.instances,'updateUi')},wireUi:function(){b_e.doForObjects(this.instances,'wireUi')},remove:function(b_h){var b_i=this.instances;for(var b_g in b_i){if(b_g===b_h||b_i[b_g]===b_h){b_i[b_g].removeUi();delete b_i[b_g];break;}}}}}),b_j=b_e.prototype;b_j.getUiElement=function(b_k){return b_d.getById(this.b_l+b_k);};b_j.isEnabled=function(){return this.b_m&&(typeof this.parentWidget=='undefined'||this.parentWidget.isEnabled());};b_j.insertUi=function(){var b_f=this,b_n=typeof b_f.b_n=='string'?b_f.b_n:b_f.b_n();b_d.insertHtml(b_e.substituteInto(b_e.substituteInto(b_f.substituteResources(b_n),b_f.b_o),b_f.b_p),b_f.b_q);b_f.childWidgets.insertUi();b_f.wireUi();};b_j.removeUi=b_j.updateUi=b_j.wireUi=function(){};function b_r(b_s){b_e[b_s]=function(){this.doForInstance(b_s)}}b_r('insertUi');
b_r('updateUi');b_r('wireUi');b_r('removeUi');b_e.registerProperties({b_q:'container',b_l:{name:'elementIdPrefix',onChange:function(){this.b_l=this.substituteResources(this.b_l);this.updateUi();}},b_m:{name:'enabled',onChange:function(){this.updateUi()}},b_n:'html',b_o:'htmlSubstitutions',b_p:'substitutions'});b_e.set({b_q:b_a,b_l:'[#objectName]_',b_m:b_b,b_n:'',b_o:{},b_p:{}});})();
