|
import win.ui;
/*DSG{{*/
winform = win.form(text="sciter";right=759;bottom=469;exmode="none")
winform.add()
/*}}*/
import win.ui;
import web.sciter;
//winform.enableDpiScaling();
wbSciter = web.sciter( winform );
if( _STUDIO_INVOKED ){
import web.sciter.debug;
wbSciter.attachEventHandler( web.sciter.debug );
}
/*---------------------------------------------------------------*/
winform.adjust = function( cx,cy,wParam ) {
var ltRoot = wbSciter.documentElement;
var elMax = ltRoot.querySelector('btn.max[role="window-maximize"]')
ltRoot.querySelector('caption').innerText=winform.text;
select(wParam) {
case 0x2 {
if (elMax) {
elMax.innerText = "2";//最大化时替换为还原按钮符号
ltRoot["window-resizable"]="false";//关闭resizable
}
}
case 0x0 {
if (elMax) {
elMax.innerText = "1";//还原时替换为最大化按钮符号
ltRoot["window-resizable"]="true";//打开resizable
}
} else {
return;
}
}
import console;
//console.dump(ltRoot["window-resizable"])
}
/*---------------------------------------------------------------*/
wbSciter.html = /**
<!doctype html>
<html window-frame="solid-with-shadow" window-resizable >
<head>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<header id="window" role="window-maximize">
<icon role=window-icon></icon><!-- 窗口图标按钮 -->
<caption role="window-caption">edit</caption><!-- 窗口标题元素 – 用户可以在它之上按住鼠标来拖动窗口。 -->
<btn.min role="window-minimize">0</btn><!-- 最小化按钮 -->
<btn.max role="window-maximize">1</btn><!-- 最大化/还原按钮 -->
<btn.close role="window-close">r</btn><!-- 关闭按钮 -->
</header>
<body>
<main>
<frameset cols="200dip,*"> <!-- 一侧200dip,另一侧占满 -->
<div id="left">
</div>
<div id="right">
</div>
</frameset>
</main>
</body>
</html>
**/
wbSciter.css = /**
html {
//background:transparent;
font:system;
color:#ddd;
max-width:1000dip;/*最大宽度*/
max-height:600dip;
min-width:500dip;/*最小宽度*/
min-height:300dip;
}
body {
margin:0;
padding:0;
}
header#window {
height:30dip;
flow:horizontal;
font:system;
background:#47484B;
}
header#window > icon {
margin:* 5dip;
width:16dip;
height:16dip;
display:inline-block;
text-align:center;
background-image:url(https://im.qq.com/favicon.ico) cover;
background-size:cover;
}
header#window > caption {
width:*;
text-align:center;
margin:* 0;
}
header#window > btn {
background-color:#47484B;
behavior:clickable;/*可点击*/
width:30dip;
font-family:"Marlett";/*该字体显示按钮符号*/
display:inline-block;
font-size:16dip;
padding:4dip;
text-align:center;
}
header#window > btn.close:hover {
background-color:#ff4b00;
}
header#window > btn:hover {
background-color:#0000002c;
color:#fff;
}
main {
size:*;
flow:horizontal;
background-color:#fff;
}
frameset {
background-color:#fff;
}
div#left {
font:system;
border:none;
size:*;
overflow-y:scroll-indicator;
background-color:#00a2ff;
}
div#right {
font:system;
border:none;
size:*;
overflow-y:scroll-indicator;
}
**/
winform.show();
return win.loopMessage();
|
|