
import win.ui.ctrl.listview;
namespace win.ui.ctrl; 
var listview = ..win.ui.ctrl.listview;

class checklist{
    ctor(parent,tvalue){ 
    	if( tvalue ){
    		tvalue.cls = "SysListView32"; 
    		tvalue.style |= 3/*_LVS_LIST*/ | 0x4000 /*_LVS_NOCOLUMNHEADER*/  
    		if(tvalue.edge)   
				tvalue.exstyle |= 0x200/*_WS_EX_CLIENTEDGE*/; 
   		}
 
    }
    oncreate = function(){ 
    	::SendMessageInt(this.hwnd,4150/*_LVM_SETEXTENDEDLISTVIEWSTYLE*/,0,0x00000004 /*_LVS_EX_CHECKBOXES*/ );
    } 
    getChecked = function(i){
		return ( ::SendMessage(this.hwnd, 0x102c/*LVM_GETITEMSTATE*/, topointer(i-1),topointer(0xF000/*LVIS_STATEIMAGEMASK*/) ) >> 12 ) != 1;
	}
	setChecked = function(i,v){ 
		var item=listview.LVITEM();  
		item.stateMask=0xF000/*LVIS_STATEIMAGEMASK*/;
		item.state=( (v)?2:1 )<<12;  
		::SendMessageByStruct(this.hwnd, 0x102b, i-1,item )  ;
	}
    @metaProperty;
}

checklist.metaProperty = listview.metaProperty;
 
/**intellisense()
!checklist.hwnd = 控件句柄
!checklist.id = 控件ID
!checklist.parent = 父窗口
!checklist.parent.hwnd = 父窗口句柄
!checklist.disabled = 控件ID
!checklist.left = 左侧坐标
!checklist.right = 右侧坐标
!checklist.top = 顶部坐标
!checklist.bottom = 底部坐标
!checklist.redraw() = 刷新
!checklist.show(true__) = 显示控件
!checklist.rect = 控件区块位置(::RECT结构体)
!checklist.clientRect =  控件客户区块位置(::RECT结构体)
!checklist.font = 控件字体(::LOGFONT结构体)
!checklist.clientRect =  获取控件客户区块位置(::RECT结构体)
!checklist.theme = 外观主题,例如\nwinform.button.theme = "Explorer"\nwinform.button.theme = false
!checklist.items = 列表项集合\ntable对象
!checklist.count = 列表项数目
!checklist.addItem(.(标题,位置) = 位置参数可省略,默认为count值
!checklist.setItemText(.(文本,行,列) = 设置项文本
!checklist.getItemText(.(行,列,缓冲区长度) = 列默认值为1,缓冲区最大字符数默认为100
!checklist.select(项索引) = 选中项
!checklist.select(项索引,false) = 取消选中项
!checklist.selIndex = 选定项索引
!checklist.getChecked(__) = 返回指定索引项是否选中
!checklist.setChecked(__,true) = 选定指定索引项
!checklist.setExtended(_LVS_EX__) = 启用树视图指定扩展样式
!checklist.setExtended(_LVS_EX__,false) = 取消树视图指定扩展样式
!checklist.getExtended() = 获取树视图扩展样式
!checklist.getExtended(_LVS_EX__) = 获取树视图指定扩展样式
!checklist.modifyStyle(.(remove,add) = 如果指定第三个参数，则使用此参数调用::SetWidnowPos 
!checklist.modifyStyleEx(.(remove,add) = 如果指定第三个参数，则使用此参数调用::SetWidnowPos
!checklist.capture = 是否捕获全局鼠标消自息
!checklist.close() = 关闭控件窗口
!checklist.setFocus() = 设置焦点 
!checklist.setPos(.(x坐标,y坐标,宽,高,插入位置,参数) = 调整窗口位置或排序,所有参数可选\n同时指定x,y坐标则移动位置\n同时指定宽高则改变大小\n指定插入位置(句柄或_HWND前缀常量)则调整Z序
!checklist.getPos() = 返回相对坐标,宽,高\nx,y,cx,cy=win.getPos(hwnd)
?win.ui.ctrl.checklist  =!checklist.
end intellisense**/

 