//自定义控件,嵌入AAuto
import win.ui;
/*DSG{{*/
var winform = win.form( bottom=399;parent=...;right=599;border="resizable";text="AAuto Form" )
winform.add( 
layoutWindow={ dr=1;dl=1;notify=1;right=580;left=10;dt=1;top=12;bottom=382;z=1;db=1;text="layoutWindow";multiline=1;cls="edit" }
)
/*}}*/

import web.layout;
var wbLayout = web.layout(winform.layoutWindow);
 
import web.form 
wbLayout.onControlCreate  = function( layoutEle, name, hwnd ){ 
	if( owner._contrls[name].hwnd = hwnd ){
		wb = web.form(winform.layoutWindow.static) 
		wb.write("<a href='http://www.aau.cn'>http://www.aau.cn</a>") 
	}
}
 
wbLayout.onDocumentComplete = function() {  

	var eles = wbLayout.queryEles("script[type='text/aauto']");  
	for(i,ele in eles){
		assert(  loadcode( "
		var window = ...;
		var $ = function(...){
			return window.queryEles(...);
		}" + ele.innerText ) )( wbLayout );
	}; 
}
 
import win.ui.ctrl.static;//仅仅在HTML中引用的控件，需要事先导入AAuto
html =/***
<OBJECT type="static" name="static" id="b" style="border:1px solid red;width:500px; height: 200px;"></OBJECT> 
<INPUT type="edit" name="edit" id="b" style="border:1px solid red;width:500px; height: 200px;"></INPUT> 
<WIDGET type="custom" name="custom" id="b" style="border:1px solid red;width:500px; height: 200px;"></WIDGET> 

<script type="text/aauto"> 
	import win; 
	var code = $("script[type='text/aauto']")[1].innerText
	win.msgbox( code ) 
</script>	
***/
wbLayout.write(html) 

winform.show() 
win.loopMessage();
