Fix [2691063] - Add SaveAndCreate toolbar button

https://sourceforge.net/tracker/index.php?func=detail&aid=2691063&group_id=176962&atid=879335
Enable new button just after change on a new record
Enable copy record button
This commit is contained in:
Carlos Ruiz 2009-09-24 22:53:49 +00:00
parent 47794798aa
commit 8e36264857
1 changed files with 4 additions and 2 deletions

View File

@ -467,6 +467,7 @@ public final class APanel extends CPanel
toolBar.addSeparator();
toolBar.add(aHelp.getButton()); // F1
toolBar.add(aNew.getButton());
toolBar.add(aCopy.getButton());
toolBar.add(aDelete.getButton());
toolBar.add(aDeleteSelection.getButton());
toolBar.add(aSave.getButton());
@ -1041,6 +1042,8 @@ public final class APanel extends CPanel
// update Change
boolean changed = e.isChanged() || e.isInserting();
int changedColumn = e.getChangedColumn();
boolean inserting = e.isInserting();
if(e.getAD_Message() != null && e.getAD_Message().equals("Saved"))
changed = false;
@ -1048,8 +1051,7 @@ public final class APanel extends CPanel
boolean insertRecord = !readOnly;
if (insertRecord)
insertRecord = m_curTab.isInsertRecord();
// aNew.setEnabled(!changed && insertRecord);
aNew.setEnabled(insertRecord);
aNew.setEnabled(((inserting && changedColumn>0) || !inserting) && insertRecord);
aCopy.setEnabled(!changed && insertRecord);
aRefresh.setEnabled(!changed);
aDelete.setEnabled(!changed && !readOnly);