|
发表于 2012-12-22 20:05:23
|
显示全部楼层
哇哈哈,偶也来一下,修改好的,可以同步了。代码如下:- import win.ui;
- /*DSG{{*/
- mainForm = ..win.form( text="Web UI";bottom=600;parent=...;right=800;border="none" )
- mainForm.add( )
- /*}}*/
- import web.layout;
- import win.util.round
- import web.layout.behavior.collapsibleList;
- win.util.round(mainForm)
- mainLayout = web.layout(mainForm);
- mainLayout.go("/layout/index.html");
- header = mainLayout.getEle("header")
- header.onMouseDown = function() {
- mainForm.hitCaption()
- }
- header.onMouseDblClick = function() {
- mainForm.hitmax();
- var btn = mainLayout.getEle("sysbtn_max");
- if(btn){
- with header.child(2) {
- id = "sysbtn_restore"
- title = "还原"
- }
- }else{
- with header.child(2) {
- id = "sysbtn_max"
- title = "最大化"
- }
- }
- }
- header.attachEventHandler()
- mainLayout.onButtonClick = function (ltEle) {
- select(ltEle.id) {
- case "sysbtn_close" {
- mainForm.close()
- }
- case "sysbtn_min" {
- mainForm.hitmin()
- }
- case "sysbtn_max" {
- mainForm.hitmax()
- with header.child(2) {
- id = "sysbtn_restore"
- title = "还原"
- }
- }
- case "sysbtn_restore" {
- mainForm.hitmax()
- with header.child(2) {
- id = "sysbtn_max"
- title = "最大化"
- }
- }
- }
- }
- //防止与 browserMain 控件重叠时 改变窗体大小时重绘覆盖 browserMain
- mainForm.modifyStyle(,0x4000000/*_WS_CLIPSIBLINGS*/)
- mainForm.wndproc = function(hwnd,message,wParam,lParam){
- if (message === 0x14/*_WM_ERASEBKGND*/) {
- return 1;
- }
- }
-
- mainForm.show( );
- win.loopMessage();
复制代码 |
|