import win.ui;/*DSG{{*/var winform = ..win.form( bottom=397;parent=...;right=596;text="AAuto Form" )
winform.add(
checkbox5={ bottom=386;text="項(xiàng)五";left=433;top=370;z=8;right=482;cls="checkbox" };
checkbox2={ bottom=386;text="項(xiàng)二";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="開(kāi)始導(dǎo)出";cls="button" };
checkbox3={ bottom=386;text="項(xiàng)三";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="項(xiàng)四";left=385;top=370;z=7;right=434;cls="checkbox" }
)/*}}*/
creatTeltable=function(){//winform.listview.setExtended(0x4/*_LVS_EX_CHECKBOXES*/);//勾選框winform.listview.insertColumn("序號(hào)",40,1)
winform.listview.insertColumn("項(xiàng)二",120,2)
winform.listview.insertColumn("項(xiàng)三",120,3)
winform.listview.insertColumn("項(xiàng)四",120,4)
winform.listview.insertColumn("項(xiàng)五",120,5)
}
creatTeltable()
winform.listview.wndproc = function(hwnd,message,wParam,lParam){
select(message) {case 0x233/*_WM_DROPFILES*/{
winform.listview.clear();
path = win.getDropFile(wParam )[1]; var x = 1; for line in io.lines(path) { //采取分行迭代方法讀取test.txt文本的內(nèi)容;var a,b,c,d,e = table.unpack(string.split(line,"<"+ winform.edit.text +">")); //string.split以“ ”為分割符分割讀取的文本行 然后把分開(kāi)的值分別賦值給a,b,模式匹配詳細(xì)請(qǐng)參考幫助文檔和論壇; winform.listview.addItem({tostring(x);a;b;c;d;e});//顯示到listview控件;x++;
}
}
}//無(wú)返回值則繼續(xù)調(diào)用默認(rèn)回調(diào)函數(shù)}
winform.button.oncommand = function(id,event){//winform.msgbox( winform.button.text );for(i=1;winform.listview.count;1){var xinxi = ""if(winform.checkbox2.checked){
xinxi = xinxi ++ winform.listview.getItemText(i,2) ++ winform.edit.text
}if(winform.checkbox3.checked){
xinxi = xinxi ++ winform.listview.getItemText(i,3) ++ winform.edit.text
}if(winform.checkbox4.checked){
xinxi = xinxi ++ winform.listview.getItemText(i,4) ++ winform.edit.text
}if(winform.checkbox5.checked){
xinxi = xinxi ++ winform.listview.getItemText(i,5)
}
string.save("xinxi.txt", tostring(xinxi) + '\r\n' ,true)
}
win.msgbox("搞定","ok")
}
/**
winform.wndproc = function(hwnd,message,wparam,lparam){
select(message) {//判斷消息類型
case 0x10/*_WM_CLOSE窗口關(guān)閉消息*/{
if(win.msgboxTest("你要關(guān)閉窗口么?","詢問(wèn)")=false){
return wparam;
}
}
}
//無(wú)返回值則繼續(xù)調(diào)用默認(rèn)回調(diào)函數(shù)
}
**/
winform.show()
win.loopMessage();