b30-1568393.zul

来自「ZK是一个Ajax Java Web框架」· ZUL 代码 · 共 73 行

ZUL
73
字号
<?xml version="1.0" encoding="UTF-8"?>

<!--
bug1568393.zul

{{IS_NOTE
	Purpose:
		
	Description:
		
	History:
		Thu Mar 15 21:13:50     2007, Created by tomyeh
}}IS_NOTE

Copyright (C) 2007 Potix Corporation. All Rights Reserved.

{{IS_RIGHT
}}IS_RIGHT
-->
<window title="Test" id="root">
1. keep on clicking on the title-bar of the overlapped-window(not on the "close_button")
<separator/>
2. sometimes the window jumps to the upper right corner without dragging it.(If not, it is right)
<zscript><![CDATA[
public class ContentPanel extends Window implements EventListener{
	private Caption top;
	private Label closeLabel;

	public ContentPanel(){
		init0();
	}

	private void init0(){
		top = new Caption();
		top.setStyle("cursor:hand;");
	
		closeLabel = new Label();
		Label l = closeLabel;
		l.setValue("CLOSE X");
		//l.setId(ImageLoader.IMG_MINI);
		l.addEventListener("onClick", this);
	
		l.setStyle("cusror:position; cursor:hand;");
		top.appendChild(l);
		appendChild(top);	
	}

	public boolean setVisible(boolean v){
		if(!inOverlapped())
			doOverlapped();
		return super.setVisible(v);
	}


	public void onEvent(Event arg0) {
		if(arg0.getName().equals("onClick") &&
		(arg0.getTarget() instanceof Component) ){
			super.setVisible(false);
			arg0.stopPropagation();
			//EventHandler.get().notifyObservers(this, new CloseEvent());
		}
	}
}


	ContentPanel cp = new ContentPanel();
	cp.setTitle("hello");
	cp.setStyle("width: 400px; max-width: 400px; height: 350px; max-height: 350px; top:25%; left: 25%; position:absolute;");
	cp.setParent(root);
	cp.doOverlapped();
]]></zscript>
</window> 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?