为什么80%的码农都做不了架构师?>>>
import win.ui;
/*DSG{{*/
var winform = ..win.form( bottom=397;parent=...;right=596;text="AAuto Form" )
winform.add(
checkbox5={ bottom=386;text="项五";left=433;top=370;z=8;right=482;cls="checkbox" };
checkbox2={ bottom=386;text="项二";left=286;top=370;z=5;right=335;cls="checkbox" };
listview={ bgcolor=16777215;bottom=357;right=591;left=6;top=5;acceptfiles=1;z=2;fullRow=1;edge=1;cls="listview" };
edit={ text="分割符 ";bottom=387;right=96;left=9;top=366;z=3;edge=1;cls="edit" };
button={ bottom=390;right=581;left=486;top=363;z=1;text="开始导出";cls="button" };
checkbox3={ bottom=386;text="项三";left=335;top=370;z=6;right=382;cls="checkbox" };
static={ bottom=386;right=192;left=104;text="拖放文件即可";top=368;z=4;transparent=1;cls="static" };
checkbox4={ bottom=386;text="项四";left=385;top=370;z=7;right=434;cls="checkbox" }
)
/*}}*/creatTeltable=function(){//winform.listview.setExtended(0x4/*_LVS_EX_CHECKBOXES*/);//勾选框winform.listview.insertColumn("序号",40,1)winform.listview.insertColumn("项二",120,2)winform.listview.insertColumn("项三",120,3)winform.listview.insertColumn("项四",120,4)winform.listview.insertColumn("项五",120,5)
}
creatTeltable()winform.listview.wndproc &#61; function(hwnd,message,wParam,lParam){select(message) {case 0x233/*_WM_DROPFILES*/{winform.listview.clear();path &#61; win.getDropFile(wParam )[1]; var x &#61; 1; for line in io.lines(path) { //采取分行迭代方法读取test.txt文本的内容&#xff1b;var a,b,c,d,e &#61; table.unpack(string.split(line,"<"&#43; winform.edit.text &#43;">")); //string.split以“ ”为分割符分割读取的文本行 然后把分开的值分别赋值给a,b,模式匹配详细请参考帮助文档和论坛; winform.listview.addItem({tostring(x);a;b;c;d;e});//显示到listview控件;x&#43;&#43;;} }}//无返回值则继续调用默认回调函数
}winform.button.oncommand &#61; function(id,event){//winform.msgbox( winform.button.text );for(i&#61;1;winform.listview.count;1){var xinxi &#61; ""if(winform.checkbox2.checked){xinxi &#61; xinxi &#43;&#43; winform.listview.getItemText(i,2) &#43;&#43; winform.edit.text}if(winform.checkbox3.checked){xinxi &#61; xinxi &#43;&#43; winform.listview.getItemText(i,3) &#43;&#43; winform.edit.text}if(winform.checkbox4.checked){xinxi &#61; xinxi &#43;&#43; winform.listview.getItemText(i,4) &#43;&#43; winform.edit.text}if(winform.checkbox5.checked){xinxi &#61; xinxi &#43;&#43; winform.listview.getItemText(i,5)}string.save("xinxi.txt", tostring(xinxi) &#43; &#39;\r\n&#39; ,true)}win.msgbox("搞定","ok")
}/**
winform.wndproc &#61; function(hwnd,message,wparam,lparam){select(message) {//判断消息类型case 0x10/*_WM_CLOSE窗口关闭消息*/{if(win.msgboxTest("你要关闭窗口么?","询问")&#61;false){return wparam; }}}//无返回值则继续调用默认回调函数
}
**/winform.show()
win.loopMessage();