BF [ 1824621 ] History button can't be canceled

http://sourceforge.net/tracker/index.php?func=detail&aid=1824621&group_id=176962&atid=879332
This commit is contained in:
teo_sarca 2007-11-02 12:42:36 +00:00
parent 8793fa8f6b
commit 8c7f9eacaa
2 changed files with 43 additions and 16 deletions

View File

@ -50,6 +50,8 @@ import org.compiere.util.*;
* Colin Rooney 2007/03/20 RFE#1670185 & related BUG#1684142 - Extend Sec to Info Queries
* @contributor Victor Perez , e-Evolution.SC FR [ 1757088 ]
* @contributor fer_luck@centuryon.com , FR [ 1757088 ]
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
* <li>BF [ 1824621 ] History button can't be canceled
*/
public final class APanel extends CPanel
implements DataStatusListener, ChangeListener, ActionListener, ASyncProcess
@ -1996,6 +1998,7 @@ public final class APanel extends CPanel
Point pt = new Point (0, aHistory.getButton().getBounds().height);
SwingUtilities.convertPointToScreen(pt, aHistory.getButton());
VOnlyCurrentDays ocd = new VOnlyCurrentDays(Env.getFrame(this), pt);
if (!ocd.isCancel()) {
m_onlyCurrentDays = ocd.getCurrentDays();
if (m_onlyCurrentDays == 1) // Day
{
@ -2014,6 +2017,12 @@ public final class APanel extends CPanel
+ ", MaxRows=" + maxRows);
m_curGC.query(m_onlyCurrentRows, m_onlyCurrentDays, maxRows ); // autoSize
}
// Restore history button's pressed status
else {
if (isFirstTab())
aHistory.setPressed(!m_curTab.isOnlyCurrentRows());
}
}
} // cmd_history
/**

View File

@ -28,6 +28,9 @@ import org.compiere.util.*;
*
* @author Jorg Janke
* @version $Id: VOnlyCurrentDays.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $
*
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
* <li>BF [ 1824621 ] History button can't be canceled
*/
public class VOnlyCurrentDays extends CDialog
implements ActionListener
@ -64,6 +67,8 @@ public class VOnlyCurrentDays extends CDialog
/** Days (0=all) */
private int m_days = 0;
/** Is cancel */
private boolean m_isCancel = false;
/** Margin */
private static Insets s_margin = new Insets (2, 2, 2, 2);
/** Logger */
@ -102,6 +107,13 @@ public class VOnlyCurrentDays extends CDialog
mainPanel.setToolTipText(Msg.getMsg(Env.getCtx(), "VOnlyCurrentDays", false));
this.getContentPane().add(mainPanel, BorderLayout.CENTER);
this.getRootPane().setDefaultButton(bShowDay);
//
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
m_isCancel = true;
}
});
} // jbInit
/**
@ -132,4 +144,10 @@ public class VOnlyCurrentDays extends CDialog
return m_days;
} // getCurrentDays
/**
* @return true if user has canceled this form
*/
public boolean isCancel() {
return m_isCancel;
}
} // VOnlyCurrentDays