import win.ui;
import console;
/*DSG{{*/
var winform = win.form(text="aardio form";right=759;bottom=469)
winform.add(
listview={cls="listview";left=120;top=80;right=616;bottom=368;edge=1;z=1}
)
/*}}*/
//listview与grid简单数据实例
import win.ui.grid
win.ui.grid(winform.listview)
dataTable = {
fields = {'a','b','c'},
{a:"a11",b:21,c:31},
{a:"a21",b:22,c:32},
{a:"a31",b:23,c:33},
}
winform.listview.setTable(dataTable); //数据表初始化,列宽度平均分布
//鼠标左键点击事件
winform.listview.onClick = function(item,subItem,nmListView){
//var index = winform.listview.selIndex; //选择的行
//var v = winform.listview.getItemText(nmListView.iItem,nmListView.iSubItem); //结构体
//var v = winform.listview.getItemText(item,subItem); //取值
//winform.msgbox(string.join({item,subItem,v},",")); //显示行、列、值信息
}
//鼠标双击修改事件
winform.listview.onEditChanged = function(text,iItem,iSubItem){
winform.msgbox(string.join({iItem,iSubItem,text},",")); //修改成功
}
//鼠标右键事件
winform.listview.onRightClick = function(item,subItem,nmListView){
var v = winform.listview.getItemText(item,subItem); //取值
winform.msgbox(string.join({item,subItem,v},",")); //显示行、列、值信息
}
winform.show();
win.loopMessage();