From fe5f84af7b93fc6980c868fe45b99c677e6e73bf Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Fri, 16 Mar 2007 08:25:34 +0000 Subject: [PATCH] * [ 1662485 ] Zoom functionality doesn't open maximized window --- client/src/org/compiere/apps/AEnv.java | 30 +++++++++++++++++-- .../src/org/compiere/apps/AMenuStartItem.java | 15 ++-------- client/src/org/compiere/apps/AZoomAcross.java | 9 +++++- client/src/org/compiere/grid/ed/VLookup.java | 9 +++++- 4 files changed, 47 insertions(+), 16 deletions(-) diff --git a/client/src/org/compiere/apps/AEnv.java b/client/src/org/compiere/apps/AEnv.java index 1d3119b64c..70f513a96b 100644 --- a/client/src/org/compiere/apps/AEnv.java +++ b/client/src/org/compiere/apps/AEnv.java @@ -52,6 +52,18 @@ public final class AEnv window.setVisible(true); window.toFront(); } // showCenterScreen + + /** + * Show frame as maximized. + * @param frame + */ + public static void showMaximized(Frame frame) + { + frame.pack(); + frame.setExtendedState(Frame.MAXIMIZED_BOTH); + frame.setVisible(true); + frame.toFront(); + } /** * Position window in center of the screen @@ -493,7 +505,14 @@ public final class AEnv if (!frame.initWindow(AD_Window_ID, MQuery.getEqualQuery(TableName + "_ID", Record_ID))) return; addToWindowManager(frame); - AEnv.showCenterScreen(frame); + if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED)) + { + AEnv.showMaximized(frame); + } + else + { + AEnv.showCenterScreen(frame); + } frame = null; } // zoom @@ -544,7 +563,14 @@ public final class AEnv if (!frame.initWindow(AD_Window_ID, query)) return; addToWindowManager(frame); - AEnv.showCenterScreen(frame); + if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED)) + { + AEnv.showMaximized(frame); + } + else + { + AEnv.showCenterScreen(frame); + } frame = null; } // zoom diff --git a/client/src/org/compiere/apps/AMenuStartItem.java b/client/src/org/compiere/apps/AMenuStartItem.java index 7963d63d87..bf5123fc75 100644 --- a/client/src/org/compiere/apps/AMenuStartItem.java +++ b/client/src/org/compiere/apps/AMenuStartItem.java @@ -236,18 +236,12 @@ public class AMenuStartItem extends Thread implements ActionListener SwingUtilities.invokeLater(m_updatePB); // 2 if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED) ) { - frame.pack(); - frame.setExtendedState(Frame.MAXIMIZED_BOTH); + AEnv.showMaximized(frame); } // Center the window SwingUtilities.invokeLater(m_updatePB); // 3 - if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED) ) - { - frame.setVisible(true); - frame.toFront(); - } - else + if (!(Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED)) ) { frame.validate(); AEnv.showCenterScreen(frame); @@ -343,10 +337,7 @@ public class AMenuStartItem extends Thread implements ActionListener // Center the window SwingUtilities.invokeLater(m_updatePB); // 3 if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED) ) { - ff.pack(); - ff.setExtendedState(Frame.MAXIMIZED_BOTH); - ff.setVisible(true); - ff.toFront(); + AEnv.showMaximized(ff); } else AEnv.showCenterScreen(ff); } // startForm diff --git a/client/src/org/compiere/apps/AZoomAcross.java b/client/src/org/compiere/apps/AZoomAcross.java index 906ab10d91..89fe147f3f 100644 --- a/client/src/org/compiere/apps/AZoomAcross.java +++ b/client/src/org/compiere/apps/AZoomAcross.java @@ -206,7 +206,14 @@ public class AZoomAcross implements ActionListener if (!frame.initWindow(AD_Window_ID, m_query)) return; AEnv.addToWindowManager(frame); - AEnv.showCenterScreen(frame); + if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED) ) + { + AEnv.showMaximized(frame); + } + else + { + AEnv.showCenterScreen(frame); + } frame = null; } // launchZoom diff --git a/client/src/org/compiere/grid/ed/VLookup.java b/client/src/org/compiere/grid/ed/VLookup.java index 3f1b94eea1..5c2bde7063 100644 --- a/client/src/org/compiere/grid/ed/VLookup.java +++ b/client/src/org/compiere/grid/ed/VLookup.java @@ -1135,7 +1135,14 @@ public class VLookup extends JComponent else { AEnv.addToWindowManager(frame); - AEnv.showCenterScreen(frame); + if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED)) + { + AEnv.showMaximized(frame); + } + else + { + AEnv.showCenterScreen(frame); + } } // async window - not able to get feedback frame = null;