Changed the code that was presenting a message that the step had been deleted when the step had not been deleted.
Allow a transition to be modified. The current code does not allow an existing transition to be modified unless you change the Step Number of the destintation. Add a hardspace bewteen multiple returns. This assures that blank lines will be printed.
This commit is contained in:
parent
abe3e723ea
commit
e668a71b43
@ -197,10 +197,22 @@ namespace Volian.Controls.Library
|
||||
ContentAuditInfo cai = lbChanges.SelectedItem as ContentAuditInfo;
|
||||
if (cai != null)
|
||||
{
|
||||
if (cai.DeleteStatus > 0 || (cai.DeleteStatus == 0 && cai.ActionWhen.Year == DateTime.MinValue.Year))
|
||||
MessageBox.Show("This item has been deleted.","Deleted Item",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
|
||||
// The following line was incorrectly showing a message stating that the item was deleted when it was noot.
|
||||
//if (cai.DeleteStatus > 0 || (cai.DeleteStatus == 0 && cai.ActionWhen.Year == DateTime.MinValue.Year))
|
||||
if (cai.DeleteStatus > 0)
|
||||
MessageBox.Show("This item has been deleted.", "Deleted Item", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
else
|
||||
OnHistorySelectionChanged(new DisplayHistoryEventArgs(cai.ItemID));
|
||||
{
|
||||
try
|
||||
{
|
||||
OnHistorySelectionChanged(new DisplayHistoryEventArgs(cai.ItemID));
|
||||
}
|
||||
// If the selected item is deleted display a message rather than crashing
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("This item has been deleted.", "Deleted Item", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -45,6 +45,36 @@ namespace Volian.Controls.Library
|
||||
_SavCurItemFrom = _CurItemFrom;
|
||||
_SavTranFmtIndx = _TranFmtIndx;
|
||||
TransitionFillIn();
|
||||
SaveSettings();
|
||||
}
|
||||
}
|
||||
private int _II_Format;
|
||||
private bool _II_PageNumber;
|
||||
private bool _II_IncStepNumber;
|
||||
private int _II_Procedure;
|
||||
private int _II_Section;
|
||||
private int _II_ItemID;
|
||||
private void SaveSettings()
|
||||
{
|
||||
_II_Format=listBoxTranFmt.SelectedIndex;
|
||||
_II_PageNumber=cbPageNum.Checked;
|
||||
_II_IncStepNumber=cbIncStepNum.Checked;
|
||||
_II_Procedure=cbTranProcs.SelectedIndex;
|
||||
_II_Section=cbTranSects.SelectedIndex;
|
||||
_II_ItemID=(tvTran.SelectedNode.Tag as ItemInfo).ItemID;
|
||||
}
|
||||
private bool SettingsChanged
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_CurTrans == null) return true;
|
||||
if (_II_Format != listBoxTranFmt.SelectedIndex) return true;
|
||||
if (_II_PageNumber != cbPageNum.Checked) return true;
|
||||
if (_II_IncStepNumber != cbIncStepNum.Checked) return true;
|
||||
if (_II_Procedure != cbTranProcs.SelectedIndex) return true;
|
||||
if (_II_Section != cbTranSects.SelectedIndex) return true;
|
||||
if (_II_ItemID != (tvTran.SelectedNode.Tag as ItemInfo).ItemID) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// use the following if user selects 'cancel' button
|
||||
@ -787,6 +817,7 @@ namespace Volian.Controls.Library
|
||||
// tree was the selected node which was throwing off the logic for defining the _RangeNode1
|
||||
// and _RangeNode2
|
||||
if (_DoingRange) tvTran.SelectedNode = null;
|
||||
SaveCancelEnabling();
|
||||
}
|
||||
//private void btnUp1_Click(object sender, EventArgs e)
|
||||
//{
|
||||
@ -819,8 +850,7 @@ namespace Volian.Controls.Library
|
||||
tvTran.Enabled = false;
|
||||
// Set Save & Cancel enabling, depending on whether section can be an endpoint.
|
||||
E_TransUI etm = (E_TransUI)_CurItemFrom.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[_TranFmtIndx].TransUI;
|
||||
bool noStepNeeded = (etm & E_TransUI.StepAllowNone) == E_TransUI.StepAllowNone;
|
||||
SaveCancelEnabling(noStepNeeded, secitm);
|
||||
SaveCancelEnabling();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -838,6 +868,7 @@ namespace Volian.Controls.Library
|
||||
if (_RangeNode1 != null || _RangeNode2 != null) _RangeNode1 = _RangeNode2 = null;
|
||||
}
|
||||
_InitializingTrans = false;
|
||||
SaveCancelEnabling();
|
||||
}
|
||||
}
|
||||
private int FindSectionStart(ItemInfo prcitm)
|
||||
@ -919,6 +950,7 @@ namespace Volian.Controls.Library
|
||||
IList chldrn = prcitm.GetChildren();
|
||||
cbTranSectsFillIn((ItemInfo)chldrn[0], sectstartid, true);
|
||||
btnTranSave.Enabled = true;
|
||||
SaveCancelEnabling();
|
||||
}
|
||||
private void tvTran_AfterSelect(object sender, TreeViewEventArgs e)
|
||||
{
|
||||
@ -931,23 +963,14 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
// check if node is a true end-point, i.e. not a 'part' node. If part node, don't
|
||||
// allow selection.
|
||||
bool allowSave = false;
|
||||
VETreeNode vt = tvTran.SelectedNode as VETreeNode;
|
||||
ItemInfo selii = vt.VEObject as ItemInfo;
|
||||
if (vt != null)
|
||||
{
|
||||
if (selii != null) allowSave = true;
|
||||
}
|
||||
if (!_DoingRange)
|
||||
{
|
||||
SaveCancelEnabling(allowSave, selii);
|
||||
return;
|
||||
}
|
||||
if (!allowSave)
|
||||
if (selii == null)
|
||||
{
|
||||
MessageBox.Show("Must select a valid step, not a grouping part such as 'RNO', 'Steps', etc");
|
||||
return;
|
||||
}
|
||||
SaveCancelEnabling();
|
||||
if (_DoingRange)
|
||||
{
|
||||
if (_RangeNode1 == null || (_RangeNode1 != null && _RangeNode2 != null))
|
||||
@ -972,27 +995,32 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
private void SaveCancelEnabling(bool allowSave, ItemInfo selii)
|
||||
private void SaveCancelEnabling()
|
||||
{
|
||||
btnTranSave.Enabled = allowSave;
|
||||
if (CurTrans != null)
|
||||
{
|
||||
if (CurTrans.ToID == selii.ItemID)
|
||||
{
|
||||
// if the checkbox for including a page number (UseTransitionModifier flag is true)
|
||||
// then need to check if this has been changed, and allow a save/cancel if so.
|
||||
if (cbPageNum.Visible && _ModExistingPageNum != cbPageNum.Checked)
|
||||
btnTranCancel.Enabled = btnTranSave.Enabled = true;
|
||||
else
|
||||
btnTranCancel.Enabled = btnTranSave.Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
btnTranCancel.Enabled = true;
|
||||
btnTranSave.Enabled = allowSave;
|
||||
}
|
||||
}
|
||||
else btnTranSave.Enabled = allowSave;
|
||||
//bool hasChanged = _CurItemFrom != _SavCurItemFrom || _TranFmtIndx != _SavTranFmtIndx
|
||||
// || ( selii != null && _CurTrans.ToID != selii.ItemID);
|
||||
bool hasChanged = SettingsChanged;
|
||||
btnTranSave.Enabled = hasChanged;
|
||||
btnTranCancel.Enabled = _CurTrans != null && hasChanged;
|
||||
//btnTranSave.Enabled = allowSave;
|
||||
//if (CurTrans != null && selii != null)
|
||||
//{
|
||||
// if (CurTrans.ToID == selii.ItemID)
|
||||
// {
|
||||
// // if the checkbox for including a page number (UseTransitionModifier flag is true)
|
||||
// // then need to check if this has been changed, and allow a save/cancel if so.
|
||||
// if (cbPageNum.Visible && _ModExistingPageNum != cbPageNum.Checked)
|
||||
// btnTranCancel.Enabled = btnTranSave.Enabled = true;
|
||||
// else
|
||||
// btnTranCancel.Enabled = btnTranSave.Enabled = false;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// btnTranCancel.Enabled = true;
|
||||
// btnTranSave.Enabled = allowSave;
|
||||
// }
|
||||
//}
|
||||
//else btnTranCancel.Enabled = btnTranSave.Enabled = allowSave;
|
||||
}
|
||||
private void btnTranCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
@ -1255,6 +1283,7 @@ namespace Volian.Controls.Library
|
||||
private void cbIncStepNum_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
tvTran.Enabled=cbIncStepNum.Checked;
|
||||
if (!_InitializingTrans) SaveCancelEnabling();
|
||||
}
|
||||
private void cbPageNum_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
@ -114,6 +114,10 @@ namespace Volian.Print.Library
|
||||
{
|
||||
int profileDepth = ProfileTimer.Push(">>>> VlnPrintObject.IParagraph");
|
||||
string myRtf = Rtf;
|
||||
// Add a printable character (hard space) between multiple newlines
|
||||
// this asssures that the blank line will be printed
|
||||
if (myRtf.Contains(@"\line \line "))
|
||||
myRtf= myRtf.Replace(@"\line \line ", @"\line \u160? \line ");
|
||||
_IParagraph = RtfToParagraph(myRtf, HasIndent);
|
||||
ProfileTimer.Pop(profileDepth);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user