[ 1707221 ] Windows are not showing when they are minimize

http://sourceforge.net/tracker/index.php?func=detail&aid=1707221&group_id=176962&atid=879332
This commit is contained in:
teo_sarca 2007-04-25 09:37:25 +00:00
parent 9c866f255c
commit 2fa77ea831
3 changed files with 26 additions and 9 deletions

View File

@ -41,6 +41,21 @@ import org.compiere.util.*;
*/
public final class AEnv
{
/**
* Show window: de-iconify and bring it to front
* @author teo_sarca [ 1707221 ]
*/
public static void showWindow(Window window) {
window.setVisible(true);
if (window instanceof Frame) {
Frame f = (Frame)window;
int state = f.getExtendedState();
if ((state & Frame.ICONIFIED) > 0)
f.setExtendedState(state & ~Frame.ICONIFIED);
}
window.toFront();
}
/**
* Show in the center of the screen.
* (pack, set location and set visibility)
@ -49,8 +64,7 @@ public final class AEnv
public static void showCenterScreen(Window window)
{
positionCenterScreen(window);
window.setVisible(true);
window.toFront();
showWindow(window);
} // showCenterScreen
/**
@ -83,8 +97,7 @@ public final class AEnv
public static void showScreen(Window window, int position)
{
positionScreen(window, position);
window.setVisible(true);
window.toFront();
showWindow(window);
} // showScreen
@ -164,8 +177,7 @@ public final class AEnv
public static void showCenterWindow(Window parent, Window window)
{
positionCenterWindow(parent, window);
window.setVisible(true);
window.toFront();
showWindow(window);
} // showCenterWindow
/**
@ -223,7 +235,7 @@ public final class AEnv
// + " - Parent loc x=" + pLoc.x + " y=" + y + " w=" + pSize.getWidth() + " h=" + pSize.getHeight());
window.setLocation(x + insets.left, y + insets.top);
} // positionCenterScreen
/*************************************************************************
* Get Button
@ -382,7 +394,7 @@ public final class AEnv
}
else if (actionCommand.equals("Home"))
{
Env.getWindow(0).toFront();
showWindow(Env.getWindow(0));
}
// Tools Menu ------------------------

View File

@ -127,7 +127,7 @@ public class WindowMenu extends JMenu {
menu.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
CFrame frame = ((ChildMenuItem)ae.getSource()).getWindow();
frame.toFront();
AEnv.showWindow(frame);
}
});
//menu.setIcon(array[i].getIconImage());

View File

@ -1474,6 +1474,11 @@ public final class Env
s_hiddenWindows.remove(i);
s_log.info(hidden.toString());
hidden.setVisible(true);
// De-iconify window - teo_sarca [ 1707221 ]
int state = hidden.getExtendedState();
if ((state & CFrame.ICONIFIED) > 0)
hidden.setExtendedState(state & ~CFrame.ICONIFIED);
//
hidden.toFront();
return hidden;
}