/**
 * 功能：类似于java中的StringBuffer类的功能，用于字符串的拼接
 *       这种方式比直接用"+"性能要高出很多
 */
package("com.henry.ui");
com.henry.ui.Button = function(aText, aImage, id) {
	var buttonInstance = this.constructor.extendInstance(new com.henry.ui.Label(aText, aImage));
	var $super = buttonInstance.$super;				//防止死循环
	var self = buttonInstance;
	
	//方法定义区 
	{
		//buttonInstance.toString = function() {};
	}
		
	//初始化区
	{
		self.setClass("ui", "button");
		
		self.setId(id);
		
		self.addEventListener("onmouseover_pic", "onmouseover", 
			function(){
				this.setClass("mouseover", "button");
			}
		);

		
		self.addEventListener("onmouseout_pic", "onmouseout", 
			function(){
				this.setClass("mouseover", "");
				this.setClass("mousedown", "");
			}
		);
		self.addEventListener("onmousedown_pic", "onmousedown", 
			function(){
				this.setClass("mousedown", "button");
			}
		);
		self.addEventListener("onmouseup_pic", "onmouseup", 
			function(){
				this.setClass("mousedown", "");
			}
		);
	}
		
	return buttonInstance;
}
