请升级 虚表 至最新版 (不低于v20.1)

import win.ui;
import godking.vlistEx;
/*DSG{{*/
mainForm = win.form(text="vlistEx - table adapter";right=354;bottom=469;border="thin")
mainForm.add({
vlist={cls="vlistEx";left=10;top=11;right=331;bottom=445;transparent=1;z=1}
})
/*}}*/
import fonts.fontAwesome
var itemModel = { /* 自绘元素模板 */
{
type="rect", /* 背景框 */
round=4,
rectf={x=3;y=0;width=-3;height=-1},
itemselectedcolor=0xFF888888;
width=1,
color=0xFFDDDDDD;
fillcolor=0xFFEEEEEE,
itemhoverfillcolor=0xFFC4C4C4,
itemselectedfillcolor=0xFFC2C2C2;
smooth=true;
},
{
name="logo", /* 图标 */
type="text",
hover=true,
rectf={x=10;y=10;width=50;height=50},
font={name="FontAwesome",point=30,color=0xFF00488E},
valign = 1;
smooth=true;
},
{
name="title", /* 标题 */
type="text",
rectf={x=70;y=12;width=-10;height=20},
font={name="宋体",h=16,weight=700,color=0xFF5d492c},
itemselectedfont={name="宋体",h=16,weight=700,color=0xFF00488E},
smooth=true;
},
{
type="text", /* 内容 */
name="content",
rectf={x=70;y=36;width=-10;height=18},
valign = 1;
font={name="宋体",h=12,color=0xFF888888},
},
{
type="proc", /* 底部进度条 */
rectf={x=10;y=-10;width=-10;height=-5},
proc=function(row,col,data,graphics,hdc,itemRect,rect,hovered,itemSelected,itemHovered){
import godking.paint;
var paint=godking.paint.fromGraphics(graphics);
paint.offsetMode = false;
rect.bottom = math.floor(rect.bottom);//避免底边小数值导致线条模糊
var rect1 = rect.copy();
var width = rect.width;
rect.right = math.round(rect.left+width*row/owner.count);
paint.fillRect(rect /*绘制范围RECT*/,0xFFFF8C00);
paint.drawRect(rect1 /*绘制范围RECT*/,0xFF8B4513,/*线宽*/,/*线型*/);
paint.close();
};
},
{
type="proc", /* 右上角选择框 */
rectf={x=-24;y=10;width=14;height=14},
proc=function(row,col,data,graphics,hdc,itemRect,rect,hovered,itemSelected,itemHovered){
owner.drawCheckBox(hdc,rect.left,rect.top,14*owner.dpi/*大小*/,itemSelected/*是否选中*/,/*正常颜色*/,/*选中颜色*/,/*对号颜色*/,/*是否单选*/);
};
}
}
var itemList = { /* 自绘元素数据列表 */
{content="360出品的杀毒软件";title="驱动精灵BATW";logo='\uF0A0'};
{content="360出品的网页浏览软件";title="360浏览器";logo='\uF0A1'};
{content="金山公司出品的办公软件";title="WPS办公";logo='\uF0A2'};
{content="永中公司出品的办公软件";title="永中文字";logo='\uF0A3'};
{content="360出品的网页浏览软件";title="360浏览器";logo='\uF0A4'};
{content="金山公司出品的办公软件";title="WPS办公";logo='\uF0A5'};
fields={"软件名称"}
}
mainForm.vlist.setTable(itemList,,-1);
mainForm.vlist.setColumnType(1/*列号*/,7/*_vlistEx_ColType_OwnerDrawCustom*/,itemModel,itemList);
mainForm.vlist.setHeaderHeight(0);
mainForm.vlist.setRowHeight(70);
mainForm.vlist.lineWidthV=0;
mainForm.vlist.lineWidthH=0;
mainForm.vlist.selectedBkColor=null;
mainForm.show();
win.loopMessage();