0

how to change window position

asked 2012-09-04 02:47:54 +0800

kleponboy gravatar image kleponboy flag of Indonesia
54 5
http://stupidprogrammers....

i wanna ask, how to change the window position in zk, everytime i make a new window, the position always on the top left screen,

i already change the position parameter in the .zul, but still the windows stay on top left of the screen

here's my code

<window title="WMS Login" border="normal" width="300px" id="login" position="center">

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2012-09-24 09:31:41 +0800

gganassin gravatar image gganassin flag of Luxembourg
540 6
http://www.hybris.com/

position="center" mode="overlapped"

will work :)

link publish delete flag offensive edit

answered 2012-10-04 10:10:43 +0800

aros54 gravatar image aros54
66

If you want to open a stack of windows in "cascade" style you must use the "overlapped" feature. Provided you create the window as a component in your code you can use something like this:

	private static final int TOP = 15;
	private static final int LEFT = 115;
	private static final int INCREMENT = 15;
	private static final int MAX_INCREMENT = 150;
	private int windows = 0;

	Window window = (Window) Executions.createComponents(windowName, null, null);
	int incr = INCREMENT * windows++;
	incr = incr > MAX_INCREMENT  ? 0 : incr;
	window.setLeft((LEFT  + incr) + "px");
	window.setTop((TOP + incr) + "px");
	window.doOverlapped();

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2012-09-04 02:47:54 +0800

Seen: 146 times

Last updated: Oct 04 '12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More