From 947138c8eb9d6adca005177a22681d649073f327 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Fri, 1 Dec 2006 10:28:21 +0000 Subject: [PATCH] * Restored window size not correct if open window maximized is turn on. --- client/src/org/compiere/apps/AEnv.java | 1 + .../src/org/compiere/apps/AMenuStartItem.java | 20 ++++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/client/src/org/compiere/apps/AEnv.java b/client/src/org/compiere/apps/AEnv.java index 5411e78858..4f2961eeff 100644 --- a/client/src/org/compiere/apps/AEnv.java +++ b/client/src/org/compiere/apps/AEnv.java @@ -637,6 +637,7 @@ public final class AEnv if (!frame.initWindow(s_workflow_Window_ID, query)) return; if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED) ) { + frame.pack(); frame.setExtendedState(Frame.MAXIMIZED_BOTH); frame.setVisible(true); frame.toFront(); diff --git a/client/src/org/compiere/apps/AMenuStartItem.java b/client/src/org/compiere/apps/AMenuStartItem.java index f86a7bff02..bffd9c83a4 100644 --- a/client/src/org/compiere/apps/AMenuStartItem.java +++ b/client/src/org/compiere/apps/AMenuStartItem.java @@ -231,18 +231,18 @@ public class AMenuStartItem extends Thread implements ActionListener return; SwingUtilities.invokeLater(m_updatePB); // 2 + frame.pack(); if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED) ) frame.setExtendedState(Frame.MAXIMIZED_BOTH); - else - frame.pack(); // Center the window SwingUtilities.invokeLater(m_updatePB); // 3 - if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED) ) + if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED) ) { frame.setVisible(true); - else + frame.toFront(); + } else AEnv.showCenterScreen(frame); - frame.toFront(); + m_menu.getWindowManager().add(frame); // if (wfPanel.isVisible()) @@ -329,13 +329,15 @@ public class AMenuStartItem extends Thread implements ActionListener SwingUtilities.invokeLater(m_updatePB); // 1 ff.openForm(AD_Form_ID); SwingUtilities.invokeLater(m_updatePB); // 2 - if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED) == false) - ff.pack(); + // Center the window SwingUtilities.invokeLater(m_updatePB); // 3 - if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED) ) + if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED) ) { + ff.pack(); ff.setExtendedState(Frame.MAXIMIZED_BOTH); - else + ff.setVisible(true); + ff.toFront(); + } else AEnv.showCenterScreen(ff); } // startForm