请下载最新版customPlus库
看效果:
编辑
上代码:
Code AardioLine:92复制
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.import
win
.ui;var
winform = win
.form(text="aardio + customPlus 显示图片演示 by 光庆"
;right=927
;bottom=607
)- winform.add(
- button={cls=
"button"
;text="下一页"
;left=552
;top=536
;right=682
;bottom=596
;color=14120960
;db=1
;flat=1
;font=LOGFONT(h=-14
);z=2
}; - button2={cls=
"button"
;text="上一页"
;left=232
;top=536
;right=362
;bottom=596
;color=14120960
;db=1
;flat=1
;font=LOGFONT(h=-14
);z=3
}; - button3={cls=
"button"
;text="目录"
;left=392
;top=536
;right=522
;bottom=596
;color=14120960
;db=1
;flat=1
;font=LOGFONT(h=-14
);z=4
}; - checkbox={cls=
"checkbox"
;text="按比例缩放"
;left=80
;top=544
;right=208
;bottom=568
;checked=1
;db=1
;z=5
}; - checkbox2={cls=
"checkbox"
;text="自动调整照片方向"
;left=80
;top=568
;right=224
;bottom=592
;checked=1
;db=1
;z=6
}; - plus={cls=
"plus"
;left=0
;top=0
;right=928
;bottom=528
;clipBk=false
;db=1
;dl=1
;dr=1
;dt=1
;notify=1
;z=1
} - )
- winform.show();
var
itemModel = {- {
-
type
="img"
, - name =
"pic"
, - rectf={x=
0
;y=0
;width=120
;height=115
}, - scale =
true
; - thumbnail =
true
; - click=
true
; - orientation =
true
; - }
- {
-
type
="text"
, - name =
"picname"
, - rectf={x=
0
;y=100
;width=120
;height=15
}, - align=
1
, - valign=
1
, - font={name=
"Tahoma"
,point=11
,color=0xFFFF0000}, - }
- }
-
import
godking.customPlusvar
c = godking.customPlus(winform.plus,itemModel,itemList,{- itemWidth=
125
, - itemHeight=
120
, - autoSizeWidth=
0
, - autoSizeHeight=
0
, - colnum=
7
, - rownum=
4
, - padLeft=
20
, - padTop=
20
, - padRight=
20
, - padBottom=
20
, - bkcolor=0xFFFFFFFF;
- });
-
- c.onClick =
function
(itemIndex,elemIndex,elemID,elemName,pageIndex){ - ..
win
.msgbox("您点击了:"
++c.itemList[itemIndex].picname); - }
-
- winform.button.oncommand =
function
(id,event){ - c.toNextPage();
- }
-
- winform.adjust =
function
( cx,cy,wParam ) { - c.init();
- };
-
- winform.button2.oncommand =
function
(id,event){ - c.toPrevPage();
- }
-
- winform.button3.oncommand =
function
(id,event){ -
import
fsys.dlg.dir; -
import
fsys; -
var
dir = fsys.dlg.dir(); -
if
dir { -
var
list = fsys.list(dir,"<\.JPG>|<\.PNG>|<\.jpg>|<\.png>"
); -
var
itemList = {}; -
for
(i=1
; - ..
table
.push(itemList,{picname=list[i];pic=list[list[i]]}); - }
- c.setItemList(itemList);
- winform.text = dir;
- }
- }
- winform.checkbox.oncommand =
function
(id,event){ - itemModel[
1
].scale=winform.checkbox.checked; - c.init( itemModel,,,)
- }
- winform.checkbox2.oncommand =
function
(id,event){ - itemModel[
1
].orientation=winform.checkbox2.checked; - c.init( itemModel,,,)
- }
win
.loopMessage();