//简单无边框窗体
import win.ui;
import win.ui.menu;
import web.form;
/*DSG{{*/
var winform = win.form(parent=...; right=696;bottom=437;scroll=1;text="web ui";border="none" )
winform.add(  )
/*}}*/

//创建web窗体
var wb = web.form( winform 
	,0x8/*_UIFLAG_SCROLL_NO*/ | 0x4/*_UIFLAG_NO3DBORDER*/
	,//可输入_DLCTL_ 前缀的常量以控制下载行为
	);
 
/*事件接口{{*/

	/***
	
	//鼠标点这里,
	//然后按下CTRL键不放,再连续的按K,U键取消注释块,以启用下面的代码.
	
	wb.showMsg=function(text/*信息*/,caption/*标题*/){
		/*弹出对话框触发此事件*/
		
		return true; /*返回false则不显示对话框*/
	}
	
	wb.showMenu=function(x,y,id,ele){
		/*如果定义函数则禁用默认的右键弹出菜单*/
		
		select(id) { 
			case 0/*_CONTEXT_MENU_DEFAULT */ {
			
				}
			case 1/*_CONTEXT_MENU_IMAGE*/ {
			
				}
			case 2/*_CONTEXT_MENU_CONTROL*/ {
			
				}
			case 4/*_CONTEXT_MENU_TEXTSELECT */ {
			
				}
			case 5/*_CONTEXT_MENU_ANCHOR*/ {
			
				}
		}
	}
	wb.NavigateComplete2=function(pDisp, url) {
		/*导航完成后触发，刷新时不触发*/
	} 
	wb.NavigateError=function(pDisp,url,target,statusCode,cancel /*返回值*/) {
		/*出错时触发*/
	} 
	wb.BeforeNavigate2=function( pDisp, url, Flags, TargetFrameName, PostData, Headers, Cancel ) { 
		/*导航发生前触发（打开网页前），刷新时不触发*/
		return url, Flags, TargetFrameName, PostData, Headers, Cancel 
	} 
	wb.NewWindow2=function( ppDisp, Cancel) {
	    /*弹出新窗口以前触发 */
		return owner.openproxy /*创建代理窗口捕获网址并在当前窗口打开*/  
		
		return ppDisp, true; /*第二个返回值如果为真，则取消新窗口*/
		/*新建的web窗体，并将application作为返回值，则在该web窗口中打开*/
		/*return wbother.application; */
	} 
	
	***/
	
/*}}*/

 
wb.external = {
	hitCaption = function(){ 
		::PostMessage(winform.hwnd, 0xA1/*_WM_NCLBUTTONDOWN*/ , 0x2/*_HTCAPTION*/, 0) 
	}
	hitMax = function(){ 
		return winform.hitmax() 
	} 
	hitMin = function(){ 
		winform.hitmin();
	}
	close = function(){ 
		winform.close() 
	}
	
}



html =/*<html>
<head>
<title>web窗体</title>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<script>
	function SetButton(obj,state){ 
		obj.className=(state == 0)?"buttonActive":"buttonNA";
	}
</script>

<style>
.titlebarx {
filter:progid:DXImageTransform.Microsoft.Gradient(gradienttype=0, startcolorstr=#42BE42, endcolorstr=#FAFBDB);
}
.toolbar {
filter:progid:DXImageTransform.Microsoft.Gradient(gradienttype=0, startcolorstr=#F7F7F7, endcolorstr=#DEDBD6);
}
.webform {
filter:progid:DXImageTransform.Microsoft.Gradient(gradienttype=1, endcolorstr=#F7F7F7, startcolorstr=#DEDBD6);
}
.caption { 
	font-size: 9pt;
	color: #000000;
	cursor: hand
}
.minbutton {
	font-family: marlett;
	font-size: 10.5pt;
}
th, td, body, span, div { 
	font-size: 9pt;
	font-style: normal;
	line-height: 12pt;
	font-weight: normal;
}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #CCCCCC;
}
.buttonNA {
	PADDING-LEFT: 4px;
	PADDING-RIGHT: 4px;
	CURSOR: hand;
}
.buttonActive {
	PADDING-LEFT: 3px;
	PADDING-RIGHT: 3px;
	BACKGROUND-COLOR: #E7E7E7;
	BORDER: 1px solid #CCD0D9;
	CURSOR: hand;
}
.buttonfloat {
	PADDING-LEFT: 4px;
	PADDING-RIGHT: 4px;
	CURSOR: hand;
}
</style>
</head>
<body style="MARGIN:0px">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" ID="Table1">
  <tr height="1">
    <th> <table border="0" width="100%" id="table27" class="bodybar" cellspacing="0" cellpadding="0">
        <tr>
          <td><table width="100%" border="0" cellspacing="0" cellpadding="0" class="titlebarx"  onmousedown="external.hitCaption()">
              <tr>
                <td class="titlebar" width="562" align="left">&nbsp;</td>
                <td class="titlebar" width="224" align="right"><table border="0" cellspacing="0" cellpadding="0" height="22" ID="Table3">
                    <tr>
                      <td width="5"></td>
                      <td width="22" align="center" nowrap class="buttonNA" onMouseOver="SetButton(this,0)"
onMouseOut="SetButton(this,1)"><table border="0" cellspacing="0" cellpadding="0" ID="Table5">
                          <tr>
                            <td id="min" class="minbutton" onmousedown="javascript:external.hitMin();">0</td>
                          </tr>
                        </table></td>
                      <td width="5"></td>
                      <td width="22" align="center" nowrap class="buttonNA" onMouseOver="SetButton(this,0)"
onMouseOut="SetButton(this,1)"><table border="0" cellspacing="0" cellpadding="0" ID="Table6">
                          <tr>
                            <td id="minmax" class="minbutton" onmousedown="
                            
                     		javascript:
                     		
                     			if(external.hitMax()){
                     				this.innerText='2';
                     			}
                     			else{
                     				this.innerText='1';
                     			}
                     			
                     		">1</td>
                          </tr>
                        </table></td>
                      <td width="5"></td>
                      <td width="35" align="center" nowrap class="buttonNA" onMouseOver="SetButton(this,0)"
onMouseOut="SetButton(this,1)"><table border="0" cellspacing="0" cellpadding="0" ID="Table7">
                          <tr>
                            <td id="close" class="minbutton" onmousedown="javascript:external.close();">r</td>
                          </tr>
                        </table></td>
                    </tr>
                  </table></td>
              </tr>
            </table></td>
        </tr>
        <tr>
          <td><table width="100%" border="0" cellspacing="0" cellpadding="0" ID="Table8">
              <tr>
                <th align="left"> <table width="100%" border="1" cellpadding="4" cellspacing="0" bgcolor="#f7f7f7" id="table28"
style="BORDER-COLLAPSE: collapse">
                    <tr>
                      <td class="toolbar"><table width="433" border="0" cellpadding="0" cellspacing="0" id="table29">
                          <tr>
                            <td nowrap><table border="0" width="2" cellspacing="0" cellpadding="1" id="table30">
                                <tr>
                                  <td><img style="BORDER-RIGHT:1px inset; BORDER-TOP:1px inset; BORDER-LEFT:1px inset; BORDER-BOTTOM:1px inset"
height="1" width="1"></td>
                                </tr>
                                <tr>
                                  <td><img style="BORDER-RIGHT:1px inset; BORDER-TOP:1px inset; BORDER-LEFT:1px inset; BORDER-BOTTOM:1px inset"
height="1" width="1"></td>
                                </tr>
                                <tr>
                                  <td><img style="BORDER-RIGHT:1px inset; BORDER-TOP:1px inset; BORDER-LEFT:1px inset; BORDER-BOTTOM:1px inset"
height="1" width="1"></td>
                                </tr>
                                <tr>
                                  <td><img style="BORDER-RIGHT:1px inset; BORDER-TOP:1px inset; BORDER-LEFT:1px inset; BORDER-BOTTOM:1px inset"
height="1" width="1"></td>
                                </tr>
                              </table></td>
                            <td nowrap class="caption">用户名</td>
                            <td nowrap><input name="usernae" type="text" class="textNA" onFocus='this.className="textActive";this.gf="1"'
onBlur='this.className="textNA";this.gf="0"' onMouseOver='this.className="textActive"' onMouseOut='if (this.gf=="0") this.className="textNA"' size="20"></td>
                            <td nowrap>密码</td>
                            <td align="left" nowrap><div align="left">
                                <input name="password" type="password" class="textNA" id="password" onFocus='this.className="textActive";this.gf="1"'
onBlur='this.className="textNA";this.gf="0"' onMouseOver='this.className="textActive"' onMouseOut='if (this.gf=="0") this.className="textNA"' size="20">
                              </div></td>
                            <td align="center" nowrap class="buttonNA" onMouseOver="SetButton(this,0)"
onmouseout="SetButton(this,1)"><table cellspacing="0" cellpadding="0" id="table31" width="39">
                                <tr>
                                  <td nowrap></td>
                                  <td class="caption"><input name="call" type="button" id="call" value="登录"></td>
                                </tr>
                              </table></td>
                          </tr>
                        </table></td>
                    </tr>
                  </table>
                </th>
              </tr>
            </table></td>
        </tr>
        <tr>
          <td height="5%">&nbsp;</td>
        </tr>
      </table>
    </th>
  </tr>
  <tr>
    <th height="100%"> <table width="100%" height="100%" border="0" cellpadding="5" cellspacing="5" ID="Table17">
        <tr>
          <th height="100%" align="left" valign="top" bgcolor="#ffffff"> <p>&nbsp;</p>
          </th>
        </tr>
      </table>
    </th>
  </tr>
</table>
<span id="userdata" style="DISPLAY:none"></span>
</body>
</html>*/

wb.write(html)
winform.show(true)


//进入消息循环
win.loopMessage();
return wb,winform;
 

