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


class progress{
    ctor(parent,tvalue){ 
    tvalue.cls = "msctls_progress32";
	if(tvalue.edge) tvalue.style |= 0x20000/*_WS_EX_STATICEDGE*/;	
	 
	this.pos2 = 0;
	this.max2 = 100
    }
	@metaProperty;
}
progress.metaProperty = win.ui.ctrl.metaProperty(

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

/***intellisense()
?win.ui.ctrl.progress  =!progress.
!progress.pos = 进度条位置
!progress.hwnd = 控件句柄
!progress.id = 控件ID
!progress.parent = 父窗口
!progress.parent.hwnd = 父窗口句柄
!progress.hide = 控件是否隐藏
!progress.disabled = 控件ID
!progress.left = 左侧坐标
!progress.right = 右侧坐标
!progress.top = 顶部坐标
!progress.bottom = 底部坐标
!progress.redraw() = 刷新
!progress.show(true__) = 显示控件
!progress.rect = 控件区块位置(::RECT结构体)
!progress.clientRect =  控件客户区块位置(::RECT结构体)
!progress.font = 控件字体(::LOGFONT结构体)
!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***/