
Code AardioLine:170复制
1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.33.34.35.36.37.38.39.40.41.42.43.44.45.46.47.48.49.50.51.52.53.54.55.56.57.58.59.60.61.62.63.64.65.66.67.68.69.70.71.72.73.74.75.76.77.78.79.80.81.82.83.84.85.86.87.88.89.90.91.92.93.94.95.96.97.98.99.100.101.102.103.104.105.106.107.108.109.110.111.112.113.114.115.116.117.118.119.120.121.122.123.124.125.126.127.128.129.130.131.132.133.134.135.136.137.138.139.140.141.142.143.144.145.146.147.148.149.150.151.152.153.154.155.156.157.158.159.160.161.162.163.164.165.166.167.168.169.170.import
win
.ui;import
godking.vlistEx;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 =
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 ,
" "
,,,,,); - 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,1,, );
- winform.menu.selectedBkColor=
null
; - winform.menu.ownerDraw =
function
(row,col,hdc,x,y,w,h,param,...){ -
-
-
import
godking.paint; -
var
p = godking.paint.fromHdc(hdc); -
var
dpi = winform.menu.dpi; -
-
var
round = 20
*dpi; -
var
btnf = ::RECTF(x,y,w,h); -
var
rectf = ::RECTF(x+5
*dpi,y+5
*dpi,h-10
*dpi,h-10
*dpi); -
var
imgf = ::RECTF(x+10
*dpi,y,h-20
*dpi,h); -
var
textf = ::RECTF(x+h,y,w,h); -
if
param { - p.fillRoundRectF(btnf,round,0xFF1493FD);
- p.fillEllipseF(rectf,0xFFFFFFFF)
- p.drawImageF(imgf,winform.menu.getCellText(row,
2
),,true
); - p.drawTextF(textf,winform.menu.getCellText(row,
3
),::LOGFONT(name="宋体"
;h=14
*dpi;color=0xFFFFFFFF;brush=null
),0,0,1) - }
elseif
winform.menu.selIndex===row{ - p.fillRoundRectF(btnf,round,0xFF50B82E);
- p.fillEllipseF(rectf,0xFFFFFFFF)
- p.drawImageF(imgf,winform.menu.getCellText(row,
2
),,true
); - p.drawTextF(textf,winform.menu.getCellText(row,
3
),::LOGFONT(name="宋体"
;h=14
*dpi;color=0xFFFFFFFF;brush=null
),0,0,1) - }
else
{ - p.fillRoundRectF(btnf,round,0xB19EA7FD)
- p.fillEllipseF(rectf,0x55FFFFFF)
- p.drawImageF(imgf,winform.menu.getCellText(row,
2
),,true
); - p.drawTextF(textf,winform.menu.getCellText(row,
3
),::LOGFONT(name="宋体"
;h=14
*dpi;color=0xFF000000;brush=null
),0,0,1) - }
-
-
var
btnw = 14
*dpi; -
var
rect = ::RECT(x+w-btnw,y,x+w,y+btnw); -
if
rect.contains(winform.menu.mouseX,winform.menu.mouseY){ - p.fillEllipse(rect ,0xFFFF0000);
- }
else
{ - p.fillEllipse(rect ,0xFF00AA00);
- }
- p.drawEllipse(rect ,0xFFFFFFFF,,)
- p.textAntiAlias =
true
; - p.drawText(x+w-btnw+
1
,y,x+w,y+btnw+3
,"×"
,::LOGFONT(name="Arial"
;h=20
*dpi;color=0xFFFFFFFF;brush=null
),0,1,1); - p.close();
- winform.menu.setButtonRects( row, col, {rect} );
- }
- winform.vlist.setHeaderHeight(
50
); - winform.vlist.headerAlign = {
1
,1
,0
,0
,0
,1
}; - winform.vlist.setRowHeight(
45
); - winform.vlist.textColor = 0x666666;
- winform.vlist.selectedTextColor = 0xFF0000;
- winform.vlist.lineColorH =0xCFCFCF;
- winform.vlist.lineWidthV =
null
; import
inet.http- winform.vlist.addImg(
"正常按钮"
,"https://d.xiazai8.com/pic/20240316/dfphijddtql.jpg"
); - winform.vlist.addImg(
"悬停按钮"
,"https://d.xiazai8.com/pic/20240316/nmx5hgq2tap.png"
); 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
(winform,row,imgfile){ -
import
inet.http; -
var
pic = inet.http.get(imgfile); -
if
type
.isString(pic) { -
thread
.lock("临界区名称"
); - winform.vlist.addImg(imgfile,pic,false,100,100);
- winform.vlist.redrawRow(row);
-
thread
.unlock("临界区名称"
); - }
- }
- ,winform,row,url);
- }
- 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 and
col { -
if
!buttonIndex { - winform.vlist.setTable(pageitemlist[row] ,,{scale=
true
,40
,50
,150
,180
,60
,60
},{1
,1
,0
,0
,0
,1
},,,true) - winform.vlist.setColumnType(
2
,6 ); - winform.vlist.setColumnType(
6
,5,1,"正常按钮"
,"悬停按钮"
); - }
else
{ - winform.menu.delRow(row);
-
table
.remove(pageitemlist,row); - }
- }
- }
- winform.adjust =
function
( cx,cy,wParam ) { - winform.vlist.setColumnWidth( , {scale=
true
,40
,50
,150
,180
,60
,60
}); - };
- winform.show();
- winform.menu.onClick(
1
,1
); win
.loopMessage();