import win.ui;
/*DSG{{*/
var winform = win.form(text="HTMLayout 无边框窗体";right=759;bottom=469;border="none";parent=...)
winform.add()
/*}}*/
import web.layout;
import web.layout.behavior.windowCommand;//导入behavior:windowCommand;
var wbLayout = web.layout( winform );//在窗体上创建HTMLayout对象
//开发环境中启用HTMLayout调试功能
if( _STUDIO_INVOKED ){
import web.layout.debug;
wbLayout.attachEventHandler( web.layout.debug );
}
wbLayout.html = /**
**/
wbLayout.css = /**
html,body{
margin:0; /*去掉默认的页面边距*/
height:100%;/*因为HTML元素的高度默认是按需增加的,所有需要显示指定根节点高度*/
background:#fff;/*网页背景色*/
}
body{
overflow:hidden;/*避免出现滚动条*/
}
/*最大化后body会自动添加maximize属性,如果是圆角界面可以在这里移除圆角*/
body[maximize]{
border-radius:0;
}
body[maximize] #header{
border-radius:0;
}
#header{
height:32px;
background:rgb(52,152,220);
cursor:default;
behavior:windowCommand;
overflow:hidden;/*清除浮动*/
}
#header .title-bar{
margin-right:95px;
padding-left:15px;
height:28px;
line-height: 28px;
font:system;
color:#fff;
}
#header .titlebox{
width:max-intrinsic;
height:28px;
float:right;
margin-right:8px;
overflow-x:hidden;
}
#header .titlebox a{
display:inline-block; //显示为块节点
width:max-intrinsic;
height:14px;
font-family:"Marlett";/*该字体显示按钮符号*/
font-size:14px;
padding:4px;
color:#fff;
cursor:default;
}
/*CSS选择器中,方括号指定节点拥有的属性*/
#header .titlebox a[command]:hover{
background:#6ebccf;
}
#header .titlebox a[command]:active{
background:#FF0000;
}
#header a[command="window-restore"]{
content:"2";/*Marlett字体为还原按钮符号*/
}
#header .window-menu{
display:block;
float:right;
behavior:popup-menu;
width:max-intrinsic;
height:14px;
font-family:"Marlett";/*该字体显示按钮符号*/
font-size:14px;
padding:4px;
color:#fff;
}
#header .window-menu:hover{
background:#6ebccf;
}
#header .window-menu:owns-popup /*菜单已弹出*/
{
background-color: #FF0000;
color: #FFFFFF;
}
#container{
width:100%;
height:100%%; /*撑满剩余可用空间*/
flow: horizontal; /*将容器内部块元素变为横向布局 - 比具有破坏性的float浮动布局更方便*/
margin:0 auto;
overflow:hidden;
background:#ac0;
}
#container .lside{
height:100%;
width:150px;
background:rgb(110,179,210);
}
#container .rside{
height:100%;
background:#FFF;
}
#container .lside > *{
margin:38px 0px;
}
#container .rside > *{
margin:38px 10px;
font-size:9pt;
}
#footer {
background:rgb(239,237,238);
height:25px;
text-align:right;
padding:10px 20px;
}
#footer button{
padding:4px 13px;
font-size:12px;
background:rgb(27,174,93);
color:white;
}
#footer button:hover {
background:rgb(33,127,188);
outline: 1px glow rgb(91,171,230) 1px;
cursor:pointer;
}
**/
// 响应菜单点击事件
wbLayout.onMenuItemClick = {
// 事件可以是一个函数或列表,如果是列表键名匹配节点的id或name属性
exit = function (ltTarget,ltOwner,reason,behaviorParams) {
winform.close();
}
//匹配不到id的节点会触发default函数*/
default = function (ltTarget,ltOwner,reason,behaviorParams) {
var ltPopupOwner = web.layout.element( behaviorParams.he );//这是弹出菜单的按钮节点
winform.msgbox( ltTarget.innerText )
}
}
import process;
wbLayout.onButtonClick = {
help = function (ltTarget,ltOwner,reason,behaviorParams) {
process.execute("http://api.aardio.com/v10/pages/htmlayout-introduction");
}
}
import win.ui.shadow;
win.ui.shadow(winform); //添加阴影边框
winform.show();
win.loopMessage();