在AAuto中用文本框实现控制台的输出效果

Published: Tags: AAUTO
import win.ui;
/*DSG{{*/
var winform = ..win.form(text="AAuto Form";right=359;bottom=311)
winform.add(
btn_winex={cls="button";text="WinEX方式";left=216;top=168;right=344;bottom=280;z=3};
button={cls="button";text="Edit自带";left=216;top=32;right=344;bottom=144;z=2};
edit={cls="edit";left=16;top=16;right=200;bottom=296;align="center";bgcolor=0;color=65280;edge=1;multiline=1;z=1}
)
/*}}*/

winform.button.oncommand = function(id,event){
	winform.edit.limit = 300 //限制最大字数
	for(i=1;200;1){
		winform.edit.log("自带:"++tostring(i),'\r\n')
		winform.edit.redraw()
	}
}

import winex
winform.btn_winex.oncommand = function(id,event){
	winform.edit.limit = 0 //取消限制,不然无法输出
	for(i=1;200;1){
		winex.sendString( "WinEx:"++tostring(i)++'\r\n',winform.edit.hwnd)
	}
}

winform.show() 
win.loopMessage();