aardio 文档

aardio 范例: 虚表

//虚表
//相关范例:范例 / 数据库 / sqlite / 虚表
//下面listview 控件的类名(cls属性)请改为 "vlistview"
import win.ui;
/*DSG{{*/
winform = win.form(text="虚表";right=805;bottom=610)
winform.add(
listview={cls="vlistview";left=27;top=17;right=778;bottom=564;db=1;dl=1;dr=1;dt=1;edge=1;mode="icon";z=1}
)
/*}}*/

winform.enableDpiScaling("init");

import win.imageList; 
var imageList = win.imageList( winform.dpiScale(32,32) ); 
winform.listview.setImageList( imageList.loadIcon(0x7F00) );

var data = {};
for(i=1;10000){
    table.push(data,{ { iImage = 0; text = i } })
}

//指定虚表行数
winform.listview.count = 1000;

//获取虚表项
winform.listview.onGetDispItem = function(item,row,col){
    return data[row][col]; 
} 

winform.show();
win.loopMessage();

Markdown 格式