Changed logic too support unlimited levels of alphabetical tabs.

Save current changes to a step before doing a restore.
Only show expander if a step has children
Added Westinghouse RO Copy logic to Context Menu for Grid.
This commit is contained in:
Rich 2013-02-20 14:07:13 +00:00
parent 55f1561a71
commit a60badb58f
4 changed files with 22 additions and 11 deletions

View File

@ -166,6 +166,12 @@ namespace VEPROMS.CSLA.Library
Save();
}
}
// RHM Moving Change
//else
//{
// MyPrevious = null;
// Save();
//}
// newPreviousInfo == null if moving into first child, and wasfirstchild == true if moving out of first child.
// This will require adjusting the DocVersion to point to the correct first child if a procedure is moved.
if (newPreviousInfo == null || wasfirstchild)
@ -2688,10 +2694,8 @@ namespace VEPROMS.CSLA.Library
// 'bb', 'cc'. The Westinghouse work required this and 16bit was tested and it worked the
// same way as the Westinghouse requirement. The original code to do 'aa', 'ab' was left here,
// commented out, in case a future plant needs it and then should tie it to a format flag.
// And Westinghouse had so many steps, added in to do 'aaa'
if (number > 52) retval += Letter(1 + ((number - 1) % 52));
if (number > 26) retval += Letter(1 + ((number - 1) % 26)); // Letter((number - 1) / 26);
retval += Letter(1 + ((number - 1) % 26));
// Changed logic to support unlimited cases ('aa','aaa','aaaa', etc.)
retval = retval.PadRight(1 + ((number-1)/26), Letter(1 + ((number - 1) % 26))[0]);
return retval;
}
private string Letter(int number)

View File

@ -575,6 +575,7 @@ namespace Volian.Controls.Library
}
private void btnRestore_Click(object sender, EventArgs e)
{
MyEditItem.SaveContents();
TreeNode tn = tvAudits.SelectedNode;
if (tn.Tag is ContentAuditInfo)
{

View File

@ -863,7 +863,7 @@ namespace Volian.Controls.Library
if(MyStepPanel.AutoExpand)
CanExpand = itemInfo.IsHigh && !MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && itemInfo.HasChildren; // TemporaryFormat.IsHigh(item); ;
else
CanExpand = true;
CanExpand = itemInfo.HasChildren;
break;
default://Procedures cannot expand, because they automatically expand
CanExpand = false;

View File

@ -99,17 +99,23 @@ namespace Volian.Controls.Library
private Dictionary<string, string> MyAvailableROs;
public void SetContextMenu()
{
AddWROContext(btnCMRtfEdit);
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMRtfEdit);
}
#region set up save ro menu jcb 20121221
private void AddWROContext(DevComponents.DotNetBar.ButtonItem myButtonItem)
{
MyAvailableROs = new Dictionary<string, string>();
DevComponents.DotNetBar.BaseItem btnSaveRO = null;
if (!btnCMRtfEdit.SubItems.Contains("btnSaveRO"))
if (!myButtonItem.SubItems.Contains("btnSaveRO"))
{
btnSaveRO = new DevComponents.DotNetBar.ButtonItem("btnSaveRO", "Save RO");
btnSaveRO.Visible = false;
btnCMRtfEdit.SubItems.Add(btnSaveRO);
myButtonItem.SubItems.Add(btnSaveRO);
}
else
btnSaveRO = btnCMRtfEdit.SubItems["btnSaveRO"];
btnSaveRO = myButtonItem.SubItems["btnSaveRO"];
if (Clipboard.ContainsData(System.Windows.Forms.DataFormats.Text))
{
MyLookupData = Clipboard.GetData(System.Windows.Forms.DataFormats.Text).ToString();
@ -147,9 +153,8 @@ namespace Volian.Controls.Library
}
}
}
#endregion
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMRtfEdit);
}
#endregion
private bool IsValidRO(string data)
{
bool rv = false;
@ -320,6 +325,7 @@ namespace Volian.Controls.Library
public void SetGridCellContextMenu()
{
AddWROContext(btnCMRtfCellEdit);
_ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMRtfCellEdit);
}
public void SetGridContextMenu()