项目

一般

简介

行为

翻页列表示例 » 历史记录 » 修订 1

修订 1/2 | 下一页 »
yangdefeng, 2022-06-15 11:47


翻页列表示例

模块说明
对话框中显示支持翻页的列表
可自定义列表内容与样式
可自定义每页显示列表条数
点击相应按钮可返回点击对象信息


特戒引擎脚本示例:

使用前提1
请开启配置开关"isUseCustomOKPanel"
配置文件 ..\Mir200\Tejieconfig\Tejieconfig.txt
配置节点 [tjconfig]
配置项 isUseCustomOkPanel=1

使用前提2
将附件中的配置文件放入以下目录
..\Mir200\Envir\QuestDiary\数据文件\


[@main]
;--设定步长(单页条数),推算最大页码--
#act
mov n$步长 5
mov n$页码 1
goto @数据加载
tbl_size tb_g测试表 n$表长
div n$最大页码 n$表长 n$步长
mul n$计数 n$最大页码 n$步长
 
#if
small n$计数 n$表长
#act
inc n$最大页码 1
 
#if
#act
goto @数据分页
 
[@数据加载]
#act
tbl_create_global tb_g测试表 关键字 字段1 字段2 字段3
tbl_load tb_g测试表 \数据文件\测试表.csv
 
[@数据分页]
#act
mov n$idx_page <$str(n$页码)>
dec n$idx_page 1
mul n$idx_page <$str(n$步长)>
inc n$idx_page 1
mov n$idx <$str(n$idx_page)>
mov s$itemList
 
#if loop n$步长
;--最后一页处理--
not large n$idx n$表长
#act
tbl_index_key tb_g测试表 n$idx s$key
mov s$条目名 <$str(s$key)>
mov s$字段1 <$tbl(tb_g测试表,s$key,字段1)>
mov s$字段2 <$tbl(tb_g测试表,s$key,字段2)>
mov s$字段3 <$tbl(tb_g测试表,s$key,字段3)>
goto @条目模板
inc s$itemList <$str(s$item)>
inc n$idx 1
 
#if
#act
goto @界面显示
;--print <$str(s$itemList)>--
 
[@条目模板]
;--此处可自定义条目模板样式--
#act
mov s$item
inc s$item (<itemIndex:<$str(n$idx)>>
inc s$item <img:denglu_liebiao_weixuanzhong:25:25:1:1:950:95>
inc s$item <text:<$str(s$字段1)>{scolor=150}:80:60>
inc s$item <text:<$str(s$字段2)>:300:60>
inc s$item <text:<$str(s$字段3)>:520:60>
inc s$item <text:点击按钮:720:60/@点击条目(<$str(s$条目名)>)>
inc s$item )
 
[@界面显示]
#say
<panelSize:1200:800>\
<itemGrid:<$str(s$itemList)>:分页显示列表,1,0,1:0:0:1000,100:1,1,650,1:0>\
 
<text:上页:100:700/@翻页(0)>
<text:~~~当前页:~~~<$str(n$页码)>:230:700>
<text:下页:400:700/@翻页(1)>
 
[@翻页]
#if
large n$页码 1
equal <$scriptParam1> 0
#act
dec n$页码 1
 
#if
small n$页码 n$最大页码
equal <$scriptParam1> 1
#act
inc n$页码 1
 
#if
#act
goto @数据分页
 
[@点击条目]
#act
messageBox 点击的是--><$scriptParam1>

yangdefeng 更新于 超过 2 年 之前 · 1 修订