-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi all!
I'm facing a very strange situation.
I have an application where it simulates a desktop enviroment (like Windows, for example). When i open a window, i put a button in a toolbar to represent it's state (open) and highligh it with a css property. When i minimize this window, i remove the highlight effect from the button. The problem is when i try to maximize this window. I click the button in the toolbar to reopen the window and it highlighs and remove the highligh effect almost instantly. I debugged and found that when i click in the button to reopen the window, the method .setVisibile(true) calls the method onMinize from my window (where the "remove highlight" effect is located).
Why the .setVisible(true) calls onMinimize?
Here's a sample of my code:
The button's onClick definition (where it "maximizes" the open window):
btnWindowMinimized.addEventListener("onClick", new EventListener() { @Override public void onEvent(Event arg0) throws Exception { materialWindow.setVisible(true); materialWindow.setFocus(true); btnWindowMinimized.setStyle("background: transparent"); }
The onMinimize method:
public void onMinimize$purchaseStorageWindow() throws InterruptedException{ btnWindowMinimized.setStyle("background: #ADD8E6"); }
Am i doing something wrong? Is there a better way of implementing the maximize and minimize function? I read here in the forums that the window minimize button only sets the window attribute visible to false. Is this correct?
Any help would be appreciated. Thanks in advance!
you didn't do anything wrong.
The default handle of ZK Window will invoke setMinimize (Source Here)
or you can customize some effect for looks like a really minimize (From ZK Demo)
Asked: 2011-10-24 14:35:02 +0800
Seen: 268 times
Last updated: Oct 25 '11