共三个版本的代码,功能相同,效果不同:
1、tab版menu
2、虚表版menu
3、虚表自绘版menu
代码如下:
1、tab版menu |
import win.ui; import godking.vlistEx; /*DSG{{*/ var winform = win.form(text="aardio form";right=711;bottom=607;bgcolor=16777215) winform.add( static={cls="static";left=139;top=7;right=140;bottom=600;bgcolor=16752414;clip=1;db=1;dl=1;dt=1;z=3}; tabPlus1={cls="plus";text="测试文本1";left=31;top=34;right=139;bottom=63;bgcolor=16752414;clip=1;dl=1;dt=1;z=1}; tabPlus2={cls="plus";text="测试文本2";left=31;top=63;right=139;bottom=92;bgcolor=16752414;clip=1;dl=1;dt=1;z=2}; vlist={cls="vlistEx";left=150;top=9;right=704;bottom=600;bgcolor=16777215;db=1;dl=1;dr=1;dt=1;z=4} ) /*}}*/ str = /************* [杀毒软件] 软件名称1=驱动精灵BATW 软件图标=https://img.onlinedown.net/download/202401/135322-65b1f7529ae05.jpg 软件介绍=360出品的杀毒软件 软件大小=65.2 MB 软件链接=https://sfdl.360safe.com/360sd/360sd_x64_std_7.0.0.1060.exe —————————————————————————————————————— 软件名称1=360浏览器 软件图标=https://img.onlinedown.net/download/202408/184132-66b9e6dc71d00.png 软件介绍=360出品的网页浏览软件 软件大小=98 MB 软件链接=https://down.360safe.com/se/360se15.3.6272.64.exe —————————————————————————————————————— 软件名称1=WPS办公 软件图标=https://img3.downza.cn/download/202109/183238-6141cbc684960.jpg 软件介绍=金山公司出品的办公软件 软件大小=155 MB 软件链接=https://official-package.wpscdn.cn/wps/download/WPS_Setup_18912.exe —————————————————————————————————————— 软件名称1=永中文字 软件图标=https://img3.downza.cn/download/202206/103057-6296cf61b8670.jpg 软件介绍=永中公司出品的办公软件 软件大小=125 MB 软件链接=https://dl.yozosoft.com/yozo/project/file/20240812_094642_267975/9.0.5004.101ZH.S1.exe —————————————————————————————————————— 软件名称1=苗 软件图标=http://img3.downza.cn/download/201812/093213-5c184e1da25b6.jpg 软件介绍=360出品的杀毒软件 软件大小=65.2 MB 软件链接=https://sfdl.360safe.com/360sd/360sd_x64_std_7.0.0.1060.exe —————————————————————————————————————— 软件名称2=WPS办公 软件图标=https://img3.downza.cn/download/202404/145505-662609c96c2aa.jpg 软件介绍=金山公司出品的办公软件 软件大小=155 MB 软件链接=https://official-package.wpscdn.cn/wps/download/WPS_Setup_18912.exe —————————————————————————————————————— 软件名称2=永中文字 软件图标=http://img3.downza.cn/download/202008/183039-5f4639cf775d1.jpg 软件介绍=永中公司出品的办公软件 软件大小=125 MB 软件链接=https://dl.yozosoft.com/yozo/project/file/20240812_094642_267975/9.0.5004.101ZH.S1.exe —————————————————————————————————————— 软件名称2=360浏览器 软件图标=https://img.onlinedown.net/download/202408/184132-66b9e6dc71d00.png 软件介绍=360出品的网页浏览软件 软件大小=98 MB 软件链接=https://down.360safe.com/se/360se15.3.6272.64.exe —————————————————————————————————————— 软件名称3=WPS办公 软件图标=https://img.onlinedown.net/download/202410/145050-6708caca5238d.jpg 软件介绍=金山公司出品的办公软件 软件大小=155 MB 软件链接=https://official-package.wpscdn.cn/wps/download/WPS_Setup_18912.exe —————————————————————————————————————— 软件名称3=360浏览器 软件图标=http://img3.downza.cn/download/202108/134640-611c9ec0c442e.jpg 软件介绍=360出品的网页浏览软件 软件大小=98 MB 软件链接=https://down.360safe.com/se/360se15.3.6272.64.exe —————————————————————————————————————— 软件名称3=永中文字 软件图标=https://img.onlinedown.net/download/202411/152557-6735a60547e5a.png 软件介绍=永中公司出品的办公软件 软件大小=125 MB 软件链接=https://dl.yozosoft.com/yozo/project/file/20240812_094642_267975/9.0.5004.101ZH.S1.exe —————————————————————————————————————— 软件名称4=苗 软件图标=http://img3.downza.cn/download/201812/093213-5c184e1da25b6.jpg 软件介绍=360出品的杀毒软件 软件大小=65.2 MB 软件链接=https://sfdl.360safe.com/360sd/360sd_x64_std_7.0.0.1060.exe —————————————————————————————————————— 软件名称4=360浏览器 软件图标=http://img3.downza.cn/mobile/202010/094613-5f8506e5bace3.jpg 软件介绍=360出品的网页浏览软件 软件大小=98 MB 软件链接=https://down.360safe.com/se/360se15.3.6272.64.exe —————————————————————————————————————— 软件名称5=WPS办公 软件图标=http://img3.downza.cn/mobile/202109/141759-61516217adff6.jpg 软件介绍=金山公司出品的办公软件 软件大小=155 MB 软件链接=https://official-package.wpscdn.cn/wps/download/WPS_Setup_18912.exe —————————————————————————————————————— 软件名称5=永中文字 软件图标=http://img3.downza.cn/mobile/202010/145434-5f87f22aa6c8d.jpg 软件介绍=永中公司出品的办公软件 软件大小=125 MB 软件链接=https://dl.yozosoft.com/yozo/project/file/20240812_094642_267975/9.0.5004.101ZH.S1.exe —————————————————————————————————————— 软件名称5=360浏览器 软件图标=http://img3.downza.cn/mobile/202307/100932-64a4d0dc3a703.jpg 软件介绍=360出品的网页浏览软件 软件大小=98 MB 软件链接=https://down.360safe.com/se/360se15.3.6272.64.exe —————————————————————————————————————— 软件名称5=苗 软件图标=https://img3.downza.cn/download/202302/151212-63fda94c226df.jpg 软件介绍=360出品的杀毒软件 软件大小=65.2 MB 软件链接=https://sfdl.360safe.com/360sd/360sd_x64_std_7.0.0.1060.exe —————————————————————————————————————— *************/ var pageitemlist = {}; import win.ui.tabs; var tabs = win.ui.tabs(winform.tabPlus2,winform.tabPlus1); tabs.clear(); //清除模板 for(i=1;5;1){ tabs.add({ text="标题 "++i; }) var t = {fields={"序号","图标","软件名称","软件介绍","软件大小","下载"}}; var pattern = "软件名称"++i++"=(\C+)\r\n软件图标=(\C+)\r\n软件介绍=(\S+)\r\n软件大小=(\d+.?\d+\sMB)\r\n软件链接=(\S+.exe)\r\n" for s1,s2,s3,s4,s5 in string.gmatch( str, pattern ){ var tt={}; tt["序号"]="[@rowindex]"; tt["图标"]=""; tt["软件名称"]=s1; tt["软件介绍"]=s3; tt["软件大小"]=s4; tt["下载"]=""; tt["地址"]=s5; tt["图标网址"]=s2; ..table.push(t,tt); } ..table.push(pageitemlist,t); } tabs.skin( background = { // 背景 default = 0xFFFFFFFF; } color = { // 文本颜色 hover = 0xF00000FF; } border = { // 边框 default = { bottom = 1;color= 0xFF1E9FFF; } hover = { bottom = 1;right = 4;color= 0xFF1E9FFF; } } checked = { // 选中状态 background = { hover = 0xFF99CCFF; focus = 0xFF1E9FFF; active = 0xFF333366; default = 0xFF1E9FFF; } color = { // 文本颜色 hover = 0xFF000000; default = 0xFFFFFFFF; } border = { // 边框 hover = { right = 2;color=0xFF1E9FFF} default = { right = 2;color=0xFF1E9FFF} } } ) import inet.http; var mypic = ..raw.buffer(1024*1024*10); winform.vlist.setHeaderHeight(50); winform.vlist.headerAlign = 1; winform.vlist.setRowHeight(45); winform.vlist.textColor = 0x666666; winform.vlist.selectedTextColor = 0xFF0000; winform.vlist.lineColorH =0xCFCFCF; winform.vlist.lineWidthV = null; winform.vlist.addImg("正常按钮","https://d.xiazai8.com/pic/20240316/dfphijddtql.jpg"); winform.vlist.addImg("悬停按钮","https://d.xiazai8.com/pic/20240316/nmx5hgq2tap.png"); import thread.command; thread.command.instance().resetImg =function(row,imgfile,len){ if row and imgfile and len { var buf = ..string.left(mypic,len); if winform.vlist.addImg(imgfile,buf/*图片文件*/,false/*是否替换*/,100/*宽度*/,100/*高度*/) { winform.vlist.redrawRow(row); } } } import godking.paint; winform.vlist.ownerDraw = function (row,col,hdc,x,y,w,h,param,...){ var url = winform.vlist.getCellText(row,"图标网址"); var buf = winform.vlist.getImg(url); if buf { var p = godking.paint.fromHdc(hdc); p.drawImageF(x,y,w,h,buf/*图片*/,/*透明度或图片属性*/,true/*保持比例*/) p.close() return ; } ..gdi.fillRect(hdc,0xEEEEEE,::RECT(x,y,x+w,y+h)); //没有加载图片前,可以先画一个灰色方框占位。 thread.invoke( function(row,imgfile,mypic){ import inet.http; var pic = inet.http.get(imgfile); if type.isString(pic) { import thread.command; thread.lock("临界区名称"); ..raw.copy(mypic,pic,#pic); thread.command.resetImg(row,imgfile,#pic); thread.unlock("临界区名称"); } } ,row,url,..raw.toPointer(mypic)); } winform.vlist.onClick = function(row/*行*/,col/*列*/,x,y){ if col==6 {..win.msgbox(winform.vlist.getCellText(row,"地址"))} } tabs.onSelchange = function(idx,tab,form){ winform.vlist.setTable(pageitemlist[idx] /*数据表*/,/*列标题*/,{40,50,150,180,60,60}/*列宽*/,/*0左1中2右*/,/*字典转为数组*/,/*字符串转为Utf8*/,true/*是否克隆新表*/) winform.vlist.setColumnType(2,6/*_vlistEx_ColType_OwnerDraw*/ ); winform.vlist.setColumnType(6,5/*_vlistEx_ColType_Button*/,1/*0居中1缩放2填满*/,"正常按钮"/*正常图片*/,"悬停按钮"/*鼠标悬停图片*/ ); } tabs.selIndex = 1; winform.show(); win.loopMessage();
2、虚表版menu |
import win.ui; import godking.vlistEx; /*DSG{{*/ var winform = win.form(text="aardio form";right=711;bottom=607;bgcolor=16777215) winform.add( menu={cls="vlistEx";left=8;top=8;right=136;bottom=600;bgcolor=16777215;db=1;dl=1;dr=1;dt=1;z=3}; static={cls="static";left=139;top=7;right=140;bottom=600;bgcolor=16752414;clip=1;db=1;dl=1;dt=1;z=1}; vlist={cls="vlistEx";left=144;top=8;right=698;bottom=599;bgcolor=16777215;db=1;dl=1;dr=1;dt=1;z=2} ) /*}}*/ str = /************* [杀毒软件] 软件名称1=驱动精灵BATW 软件图标=https://img.onlinedown.net/download/202401/135322-65b1f7529ae05.jpg 软件介绍=360出品的杀毒软件 软件大小=65.2 MB 软件链接=https://sfdl.360safe.com/360sd/360sd_x64_std_7.0.0.1060.exe —————————————————————————————————————— 软件名称1=360浏览器 软件图标=https://img.onlinedown.net/download/202408/184132-66b9e6dc71d00.png 软件介绍=360出品的网页浏览软件 软件大小=98 MB 软件链接=https://down.360safe.com/se/360se15.3.6272.64.exe —————————————————————————————————————— 软件名称1=WPS办公 软件图标=https://img3.downza.cn/download/202109/183238-6141cbc684960.jpg 软件介绍=金山公司出品的办公软件 软件大小=155 MB 软件链接=https://official-package.wpscdn.cn/wps/download/WPS_Setup_18912.exe —————————————————————————————————————— 软件名称1=永中文字 软件图标=https://img3.downza.cn/download/202206/103057-6296cf61b8670.jpg 软件介绍=永中公司出品的办公软件 软件大小=125 MB 软件链接=https://dl.yozosoft.com/yozo/project/file/20240812_094642_267975/9.0.5004.101ZH.S1.exe —————————————————————————————————————— 软件名称1=苗 软件图标=http://img3.downza.cn/download/201812/093213-5c184e1da25b6.jpg 软件介绍=360出品的杀毒软件 软件大小=65.2 MB 软件链接=https://sfdl.360safe.com/360sd/360sd_x64_std_7.0.0.1060.exe —————————————————————————————————————— 软件名称2=WPS办公 软件图标=https://img3.downza.cn/download/202404/145505-662609c96c2aa.jpg 软件介绍=金山公司出品的办公软件 软件大小=155 MB 软件链接=https://official-package.wpscdn.cn/wps/download/WPS_Setup_18912.exe —————————————————————————————————————— 软件名称2=永中文字 软件图标=http://img3.downza.cn/download/202008/183039-5f4639cf775d1.jpg 软件介绍=永中公司出品的办公软件 软件大小=125 MB 软件链接=https://dl.yozosoft.com/yozo/project/file/20240812_094642_267975/9.0.5004.101ZH.S1.exe —————————————————————————————————————— 软件名称2=360浏览器 软件图标=https://img.onlinedown.net/download/202408/184132-66b9e6dc71d00.png 软件介绍=360出品的网页浏览软件 软件大小=98 MB 软件链接=https://down.360safe.com/se/360se15.3.6272.64.exe —————————————————————————————————————— 软件名称3=WPS办公 软件图标=https://img.onlinedown.net/download/202410/145050-6708caca5238d.jpg 软件介绍=金山公司出品的办公软件 软件大小=155 MB 软件链接=https://official-package.wpscdn.cn/wps/download/WPS_Setup_18912.exe —————————————————————————————————————— 软件名称3=360浏览器 软件图标=http://img3.downza.cn/download/202108/134640-611c9ec0c442e.jpg 软件介绍=360出品的网页浏览软件 软件大小=98 MB 软件链接=https://down.360safe.com/se/360se15.3.6272.64.exe —————————————————————————————————————— 软件名称3=永中文字 软件图标=https://img.onlinedown.net/download/202411/152557-6735a60547e5a.png 软件介绍=永中公司出品的办公软件 软件大小=125 MB 软件链接=https://dl.yozosoft.com/yozo/project/file/20240812_094642_267975/9.0.5004.101ZH.S1.exe —————————————————————————————————————— 软件名称4=苗 软件图标=http://img3.downza.cn/download/201812/093213-5c184e1da25b6.jpg 软件介绍=360出品的杀毒软件 软件大小=65.2 MB 软件链接=https://sfdl.360safe.com/360sd/360sd_x64_std_7.0.0.1060.exe —————————————————————————————————————— 软件名称4=360浏览器 软件图标=http://img3.downza.cn/mobile/202010/094613-5f8506e5bace3.jpg 软件介绍=360出品的网页浏览软件 软件大小=98 MB 软件链接=https://down.360safe.com/se/360se15.3.6272.64.exe —————————————————————————————————————— 软件名称5=WPS办公 软件图标=http://img3.downza.cn/mobile/202109/141759-61516217adff6.jpg 软件介绍=金山公司出品的办公软件 软件大小=155 MB 软件链接=https://official-package.wpscdn.cn/wps/download/WPS_Setup_18912.exe —————————————————————————————————————— 软件名称5=永中文字 软件图标=http://img3.downza.cn/mobile/202010/145434-5f87f22aa6c8d.jpg 软件介绍=永中公司出品的办公软件 软件大小=125 MB 软件链接=https://dl.yozosoft.com/yozo/project/file/20240812_094642_267975/9.0.5004.101ZH.S1.exe —————————————————————————————————————— 软件名称5=360浏览器 软件图标=http://img3.downza.cn/mobile/202307/100932-64a4d0dc3a703.jpg 软件介绍=360出品的网页浏览软件 软件大小=98 MB 软件链接=https://down.360safe.com/se/360se15.3.6272.64.exe —————————————————————————————————————— 软件名称5=苗 软件图标=https://img3.downza.cn/download/202302/151212-63fda94c226df.jpg 软件介绍=360出品的杀毒软件 软件大小=65.2 MB 软件链接=https://sfdl.360safe.com/360sd/360sd_x64_std_7.0.0.1060.exe —————————————————————————————————————— *************/ var pageitemlist,pagelist = {},{}; for(i=1;5;1){ var t = {fields={"序号","图标","软件名称","软件介绍","软件大小","下载"}}; var pattern = "软件名称"++i++"=(\C+)\r\n软件图标=(\C+)\r\n软件介绍=(\S+)\r\n软件大小=(\d+.?\d+\sMB)\r\n软件链接=(\S+.exe)\r\n" for s1,s2,s3,s4,s5 in string.gmatch( str, pattern ){ var tt={}; tt["序号"]="[@rowindex]"; tt["图标"]=""; tt["软件名称"]=s1; tt["软件介绍"]=s3; tt["软件大小"]=s4; tt["下载"]=""; tt["地址"]=s5; tt["图标网址"]=s2; ..table.push(t,tt); } ..table.push(pageitemlist,t); ..table.push(pagelist,{` <img name="E:\图片素材\png\png60_清新网页设计\ (`++i++`).png",w=24,h=24> 标题 `++i}) } winform.menu.setTable(pagelist /*数据表*/,/*列标题*/,/*列宽*/,/*0左1中2右*/,/*字典转为数组*/,/*字符串转为Utf8*/,/*是否克隆新表*/); winform.menu.setHeaderHeight(0); winform.menu.setRowHeight(40); winform.menu.lineWidthV=0; winform.menu.hideScroll(true/*隐藏横向滚动条*/,false/*隐藏纵向滚动条*/); import inet.http; var mypic = ..raw.buffer(1024*1024*10); winform.vlist.setHeaderHeight(50); winform.vlist.headerAlign = 1; winform.vlist.setRowHeight(45); winform.vlist.textColor = 0x666666; winform.vlist.selectedTextColor = 0xFF0000; winform.vlist.lineColorH =0xCFCFCF; winform.vlist.lineWidthV = null; winform.vlist.addImg("正常按钮","https://d.xiazai8.com/pic/20240316/dfphijddtql.jpg"); winform.vlist.addImg("悬停按钮","https://d.xiazai8.com/pic/20240316/nmx5hgq2tap.png"); import thread.command; thread.command.instance().resetImg =function(row,imgfile,len){ if row and imgfile and len { var buf = ..string.left(mypic,len); if winform.vlist.addImg(imgfile,buf/*图片文件*/,false/*是否替换*/,100/*宽度*/,100/*高度*/) { winform.vlist.redrawRow(row); } } } import godking.paint; winform.vlist.ownerDraw = function (row,col,hdc,x,y,w,h,param,...){ var url = winform.vlist.getCellText(row,"图标网址"); var buf = winform.vlist.getImg(url); if buf { var p = godking.paint.fromHdc(hdc); p.drawImageF(x,y,w,h,buf/*图片*/,/*透明度或图片属性*/,true/*保持比例*/) p.close() return ; } ..gdi.fillRect(hdc,0xEEEEEE,::RECT(x,y,x+w,y+h)); //没有加载图片前,可以先画一个灰色方框占位。 thread.invoke( function(row,imgfile,mypic){ import inet.http; var pic = inet.http.get(imgfile); if type.isString(pic) { import thread.command; thread.lock("临界区名称"); ..raw.copy(mypic,pic,#pic); thread.command.resetImg(row,imgfile,#pic); thread.unlock("临界区名称"); } } ,row,url,..raw.toPointer(mypic)); } winform.vlist.onClick = function(row/*行*/,col/*列*/,x,y){ if col==6 {..win.msgbox(winform.vlist.getCellText(row,"地址"))} } winform.menu.onClick = function(row/*行*/,col/*列*/,x,y,buttonIndex/*按钮序号*/){ if row { winform.vlist.setTable(pageitemlist[row] /*数据表*/,/*列标题*/,{40,50,150,180,60,60}/*列宽*/,/*0左1中2右*/,/*字典转为数组*/,/*字符串转为Utf8*/,true/*是否克隆新表*/) winform.vlist.setColumnType(2,6/*_vlistEx_ColType_OwnerDraw*/ ); winform.vlist.setColumnType(6,5/*_vlistEx_ColType_Button*/,1/*0居中1缩放2填满*/,"正常按钮"/*正常图片*/,"悬停按钮"/*鼠标悬停图片*/ ); } } winform.show(); winform.menu.onClick(1); win.loopMessage();
3、虚表自绘版menu |
import win.ui; import godking.vlistEx; /*DSG{{*/ var winform = win.form(text="aardio form";right=711;bottom=607;bgcolor=16777215) winform.add( menu={cls="vlistEx";left=8;top=8;right=136;bottom=600;bgcolor=16777215;db=1;dl=1;dr=1;dt=1;z=3}; static={cls="static";left=139;top=7;right=140;bottom=600;bgcolor=16752414;clip=1;db=1;dl=1;dt=1;z=1}; vlist={cls="vlistEx";left=144;top=8;right=698;bottom=599;bgcolor=16777215;db=1;dl=1;dr=1;dt=1;z=2} ) /*}}*/ str = /************* [杀毒软件] 软件名称1=驱动精灵BATW 软件图标=https://img.onlinedown.net/download/202401/135322-65b1f7529ae05.jpg 软件介绍=360出品的杀毒软件 软件大小=65.2 MB 软件链接=https://sfdl.360safe.com/360sd/360sd_x64_std_7.0.0.1060.exe —————————————————————————————————————— 软件名称1=360浏览器 软件图标=https://img.onlinedown.net/download/202408/184132-66b9e6dc71d00.png 软件介绍=360出品的网页浏览软件 软件大小=98 MB 软件链接=https://down.360safe.com/se/360se15.3.6272.64.exe —————————————————————————————————————— 软件名称1=WPS办公 软件图标=https://img3.downza.cn/download/202109/183238-6141cbc684960.jpg 软件介绍=金山公司出品的办公软件 软件大小=155 MB 软件链接=https://official-package.wpscdn.cn/wps/download/WPS_Setup_18912.exe —————————————————————————————————————— 软件名称1=永中文字 软件图标=https://img3.downza.cn/download/202206/103057-6296cf61b8670.jpg 软件介绍=永中公司出品的办公软件 软件大小=125 MB 软件链接=https://dl.yozosoft.com/yozo/project/file/20240812_094642_267975/9.0.5004.101ZH.S1.exe —————————————————————————————————————— 软件名称1=苗 软件图标=http://img3.downza.cn/download/201812/093213-5c184e1da25b6.jpg 软件介绍=360出品的杀毒软件 软件大小=65.2 MB 软件链接=https://sfdl.360safe.com/360sd/360sd_x64_std_7.0.0.1060.exe —————————————————————————————————————— 软件名称2=WPS办公 软件图标=https://img3.downza.cn/download/202404/145505-662609c96c2aa.jpg 软件介绍=金山公司出品的办公软件 软件大小=155 MB 软件链接=https://official-package.wpscdn.cn/wps/download/WPS_Setup_18912.exe —————————————————————————————————————— 软件名称2=永中文字 软件图标=http://img3.downza.cn/download/202008/183039-5f4639cf775d1.jpg 软件介绍=永中公司出品的办公软件 软件大小=125 MB 软件链接=https://dl.yozosoft.com/yozo/project/file/20240812_094642_267975/9.0.5004.101ZH.S1.exe —————————————————————————————————————— 软件名称2=360浏览器 软件图标=https://img.onlinedown.net/download/202408/184132-66b9e6dc71d00.png 软件介绍=360出品的网页浏览软件 软件大小=98 MB 软件链接=https://down.360safe.com/se/360se15.3.6272.64.exe —————————————————————————————————————— 软件名称3=WPS办公 软件图标=https://img.onlinedown.net/download/202410/145050-6708caca5238d.jpg 软件介绍=金山公司出品的办公软件 软件大小=155 MB 软件链接=https://official-package.wpscdn.cn/wps/download/WPS_Setup_18912.exe —————————————————————————————————————— 软件名称3=360浏览器 软件图标=http://img3.downza.cn/download/202108/134640-611c9ec0c442e.jpg 软件介绍=360出品的网页浏览软件 软件大小=98 MB 软件链接=https://down.360safe.com/se/360se15.3.6272.64.exe —————————————————————————————————————— 软件名称3=永中文字 软件图标=https://img.onlinedown.net/download/202411/152557-6735a60547e5a.png 软件介绍=永中公司出品的办公软件 软件大小=125 MB 软件链接=https://dl.yozosoft.com/yozo/project/file/20240812_094642_267975/9.0.5004.101ZH.S1.exe —————————————————————————————————————— 软件名称4=苗 软件图标=http://img3.downza.cn/download/201812/093213-5c184e1da25b6.jpg 软件介绍=360出品的杀毒软件 软件大小=65.2 MB 软件链接=https://sfdl.360safe.com/360sd/360sd_x64_std_7.0.0.1060.exe —————————————————————————————————————— 软件名称4=360浏览器 软件图标=http://img3.downza.cn/mobile/202010/094613-5f8506e5bace3.jpg 软件介绍=360出品的网页浏览软件 软件大小=98 MB 软件链接=https://down.360safe.com/se/360se15.3.6272.64.exe —————————————————————————————————————— 软件名称5=WPS办公 软件图标=http://img3.downza.cn/mobile/202109/141759-61516217adff6.jpg 软件介绍=金山公司出品的办公软件 软件大小=155 MB 软件链接=https://official-package.wpscdn.cn/wps/download/WPS_Setup_18912.exe —————————————————————————————————————— 软件名称5=永中文字 软件图标=http://img3.downza.cn/mobile/202010/145434-5f87f22aa6c8d.jpg 软件介绍=永中公司出品的办公软件 软件大小=125 MB 软件链接=https://dl.yozosoft.com/yozo/project/file/20240812_094642_267975/9.0.5004.101ZH.S1.exe —————————————————————————————————————— 软件名称5=360浏览器 软件图标=http://img3.downza.cn/mobile/202307/100932-64a4d0dc3a703.jpg 软件介绍=360出品的网页浏览软件 软件大小=98 MB 软件链接=https://down.360safe.com/se/360se15.3.6272.64.exe —————————————————————————————————————— 软件名称5=苗 软件图标=https://img3.downza.cn/download/202302/151212-63fda94c226df.jpg 软件介绍=360出品的杀毒软件 软件大小=65.2 MB 软件链接=https://sfdl.360safe.com/360sd/360sd_x64_std_7.0.0.1060.exe —————————————————————————————————————— *************/ var pageitemlist,pagelist = {},{}; for(i=1;5;1){ var t = {fields={"序号","图标","软件名称","软件介绍","软件大小","下载"}}; var pattern = "软件名称"++i++"=(\C+)\r\n软件图标=(\C+)\r\n软件介绍=(\S+)\r\n软件大小=(\d+.?\d+\sMB)\r\n软件链接=(\S+.exe)\r\n" for s1,s2,s3,s4,s5 in string.gmatch( str, pattern ){ var tt={}; tt["序号"]="[@rowindex]"; tt["图标"]=""; tt["软件名称"]=s1; tt["软件介绍"]=s3; tt["软件大小"]=s4; tt["下载"]=""; tt["地址"]=s5; tt["图标网址"]=s2; ..table.push(t,tt); } ..table.push(pageitemlist,t); ..table.push(pagelist,{"[@ownerDraw]","E:\图片素材\png\png60_清新网页设计\ ("++i++").png","标题 "++i}); } winform.menu.setTable(pagelist /*数据表*/," "/*列标题*/,/*列宽*/,/*0左1中2右*/,/*字典转为数组*/,/*字符串转为Utf8*/,/*是否克隆新表*/); winform.menu.setHeaderHeight(0); winform.menu.setRowHeight(40); winform.menu.padding=0; winform.menu.lineWidthV=0; winform.menu.lineWidthH=0; winform.menu.hideScroll(true/*隐藏横向滚动条*/,false/*隐藏纵向滚动条*/); winform.menu.setColumnType(1/*列号*/,5/*_vlistEx_ColType_Button*/,1/*0居中1缩放2填满*/,/*正常图片*/,/*鼠标悬停图片*/ ); winform.menu.selectedBkColor=null; winform.menu.ownerDraw = function (row,col,hdc,x,y,w,h,param,...){ //当列类型为 _vlistEx_ColType_Button 时,如果单元格内容为"[@ownerDraw]",使用该函数自绘按钮。 //此时 param 值为:true:鼠标在当前单元格内;false:鼠标未在当前单元格内; import godking.paint; var p = godking.paint.fromHdc(hdc); if param { p.fillRoundRectF(x,y,w,h,20,0xFF1493FD); p.fillEllipseF(x+5,y+5,h-10,h-10,0xFFFFFFFF) p.drawImageF(x+10,y,h-20,h,winform.menu.getCellText(row,2),,true); p.drawTextF(x+h,y,w,h,winform.menu.getCellText(row,3),::LOGFONT(name="宋体";h=14;color=0xFFFFFFFF;brush=null),0/*格式*/,0/*水平*/,1/*垂直*/) } elseif winform.menu.selIndex===row{ p.fillRoundRectF(x,y,w,h,20,0xFF50B82E); p.fillEllipseF(x+5,y+5,h-10,h-10,0xFFFFFFFF) p.drawImageF(x+10,y,h-20,h,winform.menu.getCellText(row,2),,true); p.drawTextF(x+h,y,w,h,winform.menu.getCellText(row,3),::LOGFONT(name="宋体";h=14;color=0xFFFFFFFF;brush=null),0/*格式*/,0/*水平*/,1/*垂直*/) } else { p.fillRoundRectF( x,y,w,h,20,0xB19EA7FD) p.fillEllipseF(x+5,y+5,h-10,h-10,0x55FFFFFF) p.drawImageF(x+10,y,h-20,h,winform.menu.getCellText(row,2),,true); p.drawTextF(x+h,y,w,h,winform.menu.getCellText(row,3),::LOGFONT(name="宋体";h=14;color=0xFF000000;brush=null),0/*格式*/,0/*水平*/,1/*垂直*/) } p.close(); } import inet.http; var mypic = ..raw.buffer(1024*1024*10); winform.vlist.setHeaderHeight(50); winform.vlist.headerAlign = 1; winform.vlist.setRowHeight(45); winform.vlist.textColor = 0x666666; winform.vlist.selectedTextColor = 0xFF0000; winform.vlist.lineColorH =0xCFCFCF; winform.vlist.lineWidthV = null; winform.vlist.addImg("正常按钮","https://d.xiazai8.com/pic/20240316/dfphijddtql.jpg"); winform.vlist.addImg("悬停按钮","https://d.xiazai8.com/pic/20240316/nmx5hgq2tap.png"); import thread.command; thread.command.instance().resetImg =function(row,imgfile,len){ if row and imgfile and len { var buf = ..string.left(mypic,len); if winform.vlist.addImg(imgfile,buf/*图片文件*/,false/*是否替换*/,100/*宽度*/,100/*高度*/) { winform.vlist.redrawRow(row); } } } import godking.paint; winform.vlist.ownerDraw = function (row,col,hdc,x,y,w,h,param,...){ var url = winform.vlist.getCellText(row,"图标网址"); var buf = winform.vlist.getImg(url); if buf { var p = godking.paint.fromHdc(hdc); p.drawImageF(x,y,w,h,buf/*图片*/,/*透明度或图片属性*/,true/*保持比例*/) p.close() return ; } ..gdi.fillRect(hdc,0xEEEEEE,::RECT(x,y,x+w,y+h)); //没有加载图片前,可以先画一个灰色方框占位。 thread.invoke( function(row,imgfile,mypic){ import inet.http; var pic = inet.http.get(imgfile); if type.isString(pic) { import thread.command; thread.lock("临界区名称"); ..raw.copy(mypic,pic,#pic); thread.command.resetImg(row,imgfile,#pic); thread.unlock("临界区名称"); } } ,row,url,..raw.toPointer(mypic)); } winform.vlist.onClick = function(row/*行*/,col/*列*/,x,y){ if col==6 {..win.msgbox(winform.vlist.getCellText(row,"地址"))} } winform.menu.onClick = function(row/*行*/,col/*列*/,x,y,buttonIndex/*按钮序号*/){ if row { winform.vlist.setTable(pageitemlist[row] /*数据表*/,/*列标题*/,{40,50,150,180,60,60}/*列宽*/,/*0左1中2右*/,/*字典转为数组*/,/*字符串转为Utf8*/,true/*是否克隆新表*/) winform.vlist.setColumnType(2,6/*_vlistEx_ColType_OwnerDraw*/ ); winform.vlist.setColumnType(6,5/*_vlistEx_ColType_Button*/,1/*0居中1缩放2填满*/,"正常按钮"/*正常图片*/,"悬停按钮"/*鼠标悬停图片*/ ); } } winform.show(); winform.menu.onClick(1); win.loopMessage();