//progress 进度条
import win.ui.ctrl.metaProperty;//导入控件属性元表支持
namespace win.ui.ctrl;  

class progress{
    ctor(parent,tParam){ 
    	if(tParam){
    		tParam.cls = "msctls_progress32";
			if(tParam.edge) tParam.style |= 0x20000/*_WS_EX_STATICEDGE*/;	
		} 
		 
		this._private  = {
			step = 10;
			min = 0;
			max = 100;
			pos = 0; 
		}
    }
	@_metaProperty;
}

progress._metaProperty =  metaProperty(
	min = {
		_get = function(){ 
			 return owner._private.min;
		}
		_set = function( v ){
			owner._private.min = v;
			     
			if( (owner._private.min!==null) &&  (owner._private.max!==null) )
		     ::SendMessage(owner.hwnd, 0x401/*_PBM_SETRANGE*/, null, topointer(::MAKELONG(owner._private.min,  owner._private.max) ) );
		} 	
	}; 
	max = {
		_get = function(){ 
			/*读取属性代码写在这里*/
			return owner._private.max;
		}
		_set = function( v ){
			 owner._private.max = v;
			 
		     if( (owner._private.min!==null) &&  (owner._private.max!==null) )
		       	 ::SendMessage(owner.hwnd, 0x401/*_PBM_SETRANGE*/, null,  topointer(::MAKELONG(owner._private.min,  owner._private.max) ) );
		}	
	};
	pos = {
		_get = function(){ 
			/*读取属性代码写在这里*/
			return owner._private.pos;
		}
		_set = function( v ){
			if( v > owner._private.max )
					v = 1;

			owner._private.pos = v;
		     ::SendMessage(owner.hwnd, 0x402/*_PBM_SETPOS*/, topointer(v), null)
		} 	
	};
	stepIt = function(){
		return ::SendMessage(owner.hwnd,0x405/*_PBM_STEPIT*/);
	};
	step =  {
		_get = function(){ 
			return owner._private.step;
		}
		_set = function( v ){ 
			 owner._private.step = v;
		     ::SendMessageInt(owner.hwnd, 0x404/*_PBM_SETSTEP*/,v,0)
		} 	
	};
)

/***intellisense()
win.ui.ctrl.progress = 进度条控件支持库
win.ui.ctrl.progress() = 进度条控件\n!progress.
?win.ui.ctrl.progress  =!progress.
!progress.stepIt() = 进度条前进一个增量\n返回步进前位置
!progress.step = 设置stepIt()函数的步进增量\n默认为10
!progress.pos = 进度条位置
!progress.hwnd = 控件句柄
!progress.id = 控件ID
!progress._parentForm = 控件所在的父窗口(指win.form对象)\n!winform.
!progress.getParent() = 返回父窗口\n!static.
!progress.setParent(__/*控件对象*/) = 改变父窗口 
!progress.hide = 控件是否隐藏
!progress.disabled = 是否禁用
!progress.left = 左侧坐标
!progress.right = 右侧坐标
!progress.top = 顶部坐标
!progress.bottom = 底部坐标
!progress.width = 宽度
!progress.height = 高度
!progress.redraw() = 刷新
!progress.show(true__) = 显示控件
!progress.getRect() = 控件区块位置(::RECT结构体)
!progress.getRect(true) = 控件屏幕区块位置(::RECT结构体)  
!progress.setRect(rc) = 设置控件区块位置(::RECT结构体)  
!progress.setRect(rc,true) = 设置控件屏幕区块位置(::RECT结构体)
!progress.getClientRect() =  控件客户区块位置(::RECT结构体)\n!rect. 
!progress.clientRect =  获取控件客户区块位置(::RECT结构体)
!progress.theme = 外观主题,例如\nwinform.button.theme = "Explorer"\nwinform.button.theme = false
!progress.max = 最大值
!progress.min = 最小值
!progress.modifyStyle(.(remove,add) = 如果指定第三个参数，则使用此参数调用::SetWidnowPos 
!progress.modifyStyleEx(.(remove,add) = 如果指定第三个参数，则使用此参数调用::SetWidnowPos
!progress.capture = 是否捕获全局鼠标消息
!progress.close() = 关闭控件窗
!progress.invalidate(__/*可选使用::RECT()对象指定客户区*/) = 使窗口绘图区无效
!progress.invalidate(__/*可选使用::RECT()对象指定客户区*/,0) = 使窗口绘图区无效\n不刷新背景
!progress.update() = 重绘invalidate函数指定的区块
!progress.setFocus() = 设置焦点 
!progress.setPos(.(x坐标,y坐标,宽,高,插入位置,参数) = 调整窗口位置或排序,所有参数可选\n同时指定x,y坐标则移动位置\n同时指定宽高则改变大小\n指定插入位置(句柄或_HWND前缀常量)则调整Z序
!progress.getPos() = 返回相对坐标,宽,高\nx,y,cx,cy=win.getPos(hwnd)
end intellisense***/