//入门
import win.ui;
/*DSG{{*/
var winform = win.form(text="web.form 入门";right=1151;bottom=745;parent=...;scroll=1)
winform.add()
/*}}*/

//web.form 使用系统自带的 IE 内核,生成的EXE体积很小，
//即使 WIN10 删除IE浏览器，IE内核浏览器控件仍作为操作系统组件被保留。
//大家通常低估了IE控件的作用：IE11已普及，一般用不到最新前端技术的话IE控件是非常强大的。
import web.form.ie11;
var wb = web.form.ie11( winform,5/*_UIFLAG_DIALOG*/);//低于IE11就自动安装IE11

import console;
wb.external={
	tab = {abc=1;b=2};
	getAardioArray = function(){
		return wb.jsArray({12;23;34}); 
	}
} 

wb.html = /**
<!doctype html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<script src="https://cdn.jsdelivr.net/npm/firebug-lite-ie/build/firebug-lite-debug.min.js#startOpened"></script>
	<script type="text/javascript">

	$enum = function(obj,callback,thisObj){
	 
		if( obj instanceof Array ){
			for(var i=0;i<obj.length;i++){
				callback.call(thisObj||window,i,obj[i],obj);  
			}
		}
		else if( obj instanceof Object ){
			for( k in obj){
				callback.call(thisObj||window,k,obj[k],obj); 
			}
		}
		else{
			if(typeof(obj)=="unknown"){
				var array = new VBArray(obj).toArray()
				for (var i = 0; i < array.length; i++) {
					callback.call(thisObj||window,i,array[i],array );
				}
			}
			else if( obj ) { 
				var e = new Enumerator(obj);  
				var k;
				if(!e)
					return;
				
				for   (;!e.atEnd();e.moveNext()){ 
					k = e.item(); 
					callback.call(thisObj||window,k,obj[k],obj); 
				} 
			}
		} 
	}  
	</script>
	
	<script type="text/javascript">
	//其他Js代码
	
	</script>
	
	<style type="text/css">
    body { 
        font: 10.5pt/1.3;
    }
    </style> 
</head>
<body>
	<div id="myId">  
		Click here!
	</div>
</body>
</html>
**/
  
var js = /**
	console.log( "Hello,Aardio!" )
	console.log( "Welcome to Aardio!",event.srcElement.id );
	//枚举js数组
	$enum(
		[1,2,3],
		function(v,i){
			console.log(v,i)
		}
	)
	//枚举js对象
	$enum(
		{a:123,b:456},
		function(k,v){
			console.log(k,v)
		}
	)
	//枚举aardio数组
	$enum(
		external.getAardioArray(),
		function(k,v){
			console.log(k,v)
		}
	)
	//枚举aardio对象
	$enum(
		external.tab,
		function(k,v){
			console.log(k,v)
		}
	)
**/
wb.eventScript(js,"myId","onclick")

winform.show(); 

//进入消息循环
win.loopMessage(); 
