* [ 1662485 ] Zoom functionality doesn't open maximized window

This commit is contained in:
Heng Sin Low 2007-03-16 08:25:34 +00:00
parent 3e9beb2dd8
commit fe5f84af7b
4 changed files with 47 additions and 16 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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;