namespace win.ui.ctrl; 
import win.ui.ctrl.metaProperty;//导入控件属性元表支持
 
class picturebox{
    ctor(parent,tvalue){
    tvalue.style |= 0xE/*_SS_BITMAP*/;
    tvalue.cls = "static" 
	if(tvalue.edge) tvalue.exstyle |= 0x20000/*_WS_EX_STATICEDGE*/;  
	if(tvalue.transparent)tvalue.exstyle |= 0x20/*_WS_EX_TRANSPARENT*/;
	if(tvalue.notify)tvalue.style |= 0x100/*_SS_NOTIFY*/ 
	tvalue.style |= 0x2000000/*_WS_CLIPCHILDREN*/ | 0x4000000/*_WS_CLIPSIBLINGS*/;
    }
	@metaProperty;
}

picturebox.metaProperty = win.ui.ctrl.metaProperty(

	image = {
		_get = function(){  
			return null; 
		}
		_set = function( v ){
			if(!#v){
				owner.modifyStyle( 0x3/*_SS_ICON*/  |  0xE/*_SS_BITMAP*/);
				return;
			}
			var ipic = ..win.ole.image.load(v)
			var hpic,imgtype = ipic.CopyHandle() ; 
			if( imgtype ==0x1/*_IMAGE_ICON*/ )
			{ 
			     var style   =   ::GetWindowLong(owner.hwnd,  0xFFFFFFF0/*_GWL_STYLE*/);   
			     ::SetWindowLong(owner.hwnd,0xFFFFFFF0/*_GWL_STYLE*/,style | 0x3/*_SS_ICON*/ );
		         ::SendMessage(owner.hwnd,0x170/*_STM_SETICON*/, topointer(0x1/*_IMAGE_ICON*/),hpic); 
		    }
		    else if( imgtype ==0x0/*_IMAGE_BITMAP*/ ){
		         var style   =   ::GetWindowLong(owner.hwnd,  0xFFFFFFF0/*_GWL_STYLE*/);   
			     ::SetWindowLong(owner.hwnd,0xFFFFFFF0/*_GWL_STYLE*/,style | 0xE/*_SS_BITMAP*/ );
		         SendMessage(owner.hwnd,0x172/*_STM_SETIMAGE*/, topointer(0x0/*_IMAGE_BITMAP*/),hpic);
		    }
		} 	
	}  
)
 
 
/***intellisense()
!picturebox.image = 图像文件路径
!picturebox.hwnd = 控件句柄
!picturebox.id = 控件ID
!picturebox.parent = 父窗口
!picturebox.parent.hwnd = 父窗口句柄
!picturebox.hide = 控件是否隐藏
!picturebox.disabled = 控件ID
!picturebox.left = 左侧坐标
!picturebox.right = 右侧坐标
!picturebox.top = 顶部坐标
!picturebox.bottom = 底部坐标
!picturebox.redraw() = 刷新
!picturebox.show(true__) = 显示控件
!picturebox.rect = 控件区块位置(::RECT结构体)
!picturebox.clientRect =  控件客户区块位置(::RECT结构体)
!picturebox.font = 控件字体(::LOGFONT结构体)
!picturebox.clientRect =  获取控件客户区块位置(::RECT结构体)
!picturebox.theme = 外观主题,例如\nwinform.button.theme = "Explorer"\nwinform.button.theme = false
!picturebox.modifyStyle(.(remove,add) = 如果指定第三个参数，则使用此参数调用::SetWidnowPos 
!picturebox.modifyStyleEx(.(remove,add) = 如果指定第三个参数，则使用此参数调用::SetWidnowPos
!picturebox.capture = 是否捕获全局鼠标消自息
!picturebox.close() = 关闭控件
!picturebox.invalidate(__/*可选使用::RECT()对象指定客户区*/) = 使窗口绘图区无效
!picturebox.invalidate(__/*可选使用::RECT()对象指定客户区*/,0) = 使窗口绘图区无效\n不刷新背景
!picturebox.update() = 重绘invalidate函数指定的区块
!picturebox.setFocus() = 设置焦点 
!picturebox.setPos(.(x坐标,y坐标,宽,高,插入位置,参数) = 调整窗口位置或排序,所有参数可选\n同时指定x,y坐标则移动位置\n同时指定宽高则改变大小\n指定插入位置(句柄或_HWND前缀常量)则调整Z序
!picturebox.getPos() = 返回相对坐标,宽,高\nx,y,cx,cy=win.getPos(hwnd)
?win.ui.ctrl.picturebox  =!picturebox.
end intellisense***/



