虚表 —— 截短长文本

演示

代码

Code aardioLine:27复制
  • 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.
    • import win.ui;
    • import godking.vlistEx;
    • /*DSG{{*/
    • mainForm = win.form(text="vlistEx - table adapter";right=591;bottom=487)
    • mainForm.add(
    • vlist={cls="vlistEx";left=8;top=8;right=584;bottom=480;db=1;dl=1;dr=1;dt=1;edge=1;transparent=1;z=1}
    • )
    • /*}}*/
    • //======================= 创建虚表 =======================
    • var t = { fields={"序号","文件地址","年龄","地址","身份证"} };
    • for(i=1;10;1){
    • var tt={};
    • tt["序号"]="[@rowindex]"; // 行序号标记是不允许编辑修改的
    • tt["文件地址"]="c:\"++tostring(math.random(1,9999999))++"\abcd\efgh\asdf\"++tostring(math.random(1,9999))++".png";
    • tt["年龄"]=math.random(10,99);
    • tt["地址"]=math.random(1000,9999)+"中华人民共和国北京市";
    • tt["身份证"]=math.random(1000,9999)+"身份证";
    • ..table.push(t,tt);
    • }
    • mainForm.vlist.setTable(t,,{50,100,50,100,-1},{1,0,1,0,1});
    • //======================= 功能演示 =======================
    • mainForm.vlist.onlyText = true;
    • mainForm.vlist.ellipsion = true;
    • mainForm.show();
    • win.loopMessage();


    迷你地图


    演示代码