* WindowManager need to track zoom across window as well

* Fixed error message prompt twice bug when changing tab
* Disallow change to detail tab when parent tab is new and not saved yet
This commit is contained in:
Heng Sin Low 2006-12-06 03:47:37 +00:00
parent 50e3281ddd
commit 3e8d4b530f
3 changed files with 22 additions and 0 deletions

View File

@ -931,6 +931,8 @@ public final class APanel extends CPanel
VTabbedPane tp = (VTabbedPane)e.getSource();
boolean back = false;
boolean isAPanelTab = false;
int previousIndex = 0;
// Workbench Tab Change
if (tp.isWorkbench())
@ -958,6 +960,8 @@ public final class APanel extends CPanel
log.info("Tab=" + tp);
m_curWinTab = tp;
int tpIndex = m_curWinTab.getSelectedIndex();
// detect no tab change
if (tpIndex == m_curTabIndex) return;
back = tpIndex < m_curTabIndex;
GridController gc = null;
if (m_curWinTab.getSelectedComponent() instanceof GridController)
@ -1013,6 +1017,7 @@ public final class APanel extends CPanel
// if (m_curTabIndex >= 0)
// m_curWinTab.setForegroundAt(m_curTabIndex, AdempierePLAF.getTextColor_Normal());
// m_curWinTab.setForegroundAt(tpIndex, AdempierePLAF.getTextColor_OK());
previousIndex = m_curTabIndex;
m_curTabIndex = tpIndex;
if (!isAPanelTab)
m_curGC = gc;
@ -1037,6 +1042,14 @@ public final class APanel extends CPanel
{
MRole role = MRole.getDefault();
m_curGC.query (m_onlyCurrentRows, m_onlyCurrentDays, role.getMaxQueryRecords());
if (m_curGC.isNeedToSaveParent())
{
// there is a problem, so we go back
ADialog.error(m_curWindowNo, this, "SaveParentFirst");
m_curWinTab.setSelectedIndex(previousIndex);
setBusy(false, true);
return;
}
}
// Set initial record

View File

@ -190,6 +190,11 @@ public class AZoomAcross implements ActionListener
AWindow frame = new AWindow();
if (!frame.initWindow(AD_Window_ID, m_query))
return;
JFrame top = Env.getWindow(0);
if (top instanceof AMenu)
{
((AMenu)top).getWindowManager().add(frame);
}
AEnv.showCenterScreen(frame);
frame = null;
} // launchZoom

View File

@ -582,6 +582,10 @@ public class GridController extends CPanel
vTable.autoSize(true);
} // query
public boolean isNeedToSaveParent()
{
return m_mTab.isNeedToSaveParent();
}
/**************************************************************************
* Switch from single to multi & vice versa