diff --git a/PROMS/Formats/fmtall/VEGPBckStpsall.xml b/PROMS/Formats/fmtall/VEGPBckStpsall.xml index cefcac07..5ac01487 100644 Binary files a/PROMS/Formats/fmtall/VEGPBckStpsall.xml and b/PROMS/Formats/fmtall/VEGPBckStpsall.xml differ diff --git a/PROMS/Formats/fmtall/VEGPBckall.xml b/PROMS/Formats/fmtall/VEGPBckall.xml index 40d5726d..366e73df 100644 Binary files a/PROMS/Formats/fmtall/VEGPBckall.xml and b/PROMS/Formats/fmtall/VEGPBckall.xml differ diff --git a/PROMS/Formats/genmacall/VEGPBck.svg b/PROMS/Formats/genmacall/VEGPBck.svg index 5c1a41f7..e7cff7b4 100644 Binary files a/PROMS/Formats/genmacall/VEGPBck.svg and b/PROMS/Formats/genmacall/VEGPBck.svg differ diff --git a/PROMS/Formats/genmacall/VEGPBckStps.svg b/PROMS/Formats/genmacall/VEGPBckStps.svg index ecb258a2..e36a95fb 100644 Binary files a/PROMS/Formats/genmacall/VEGPBckStps.svg and b/PROMS/Formats/genmacall/VEGPBckStps.svg differ diff --git a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/FieldCombFrm.cs b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/FieldCombFrm.cs index d3dcb25c..e7dc3a49 100644 --- a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/FieldCombFrm.cs +++ b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/FieldCombFrm.cs @@ -77,6 +77,7 @@ using System.Xml.Schema; using System.Text; using ROFields; using RODBInterface; +using System.Linq; namespace ROEditor { @@ -280,6 +281,7 @@ namespace ROEditor this.tbXYPlotWid.Size = new System.Drawing.Size(40, 22); this.tbXYPlotWid.TabIndex = 11; this.tbXYPlotWid.Text = ""; + this.tbXYPlotWid.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtBox_KeyDown); // // tbTableWid // @@ -288,6 +290,7 @@ namespace ROEditor this.tbTableWid.Size = new System.Drawing.Size(40, 22); this.tbTableWid.TabIndex = 10; this.tbTableWid.Text = ""; + this.tbTableWid.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtBox_KeyDown); // // tbVariableTxtWid // @@ -296,6 +299,7 @@ namespace ROEditor this.tbVariableTxtWid.Size = new System.Drawing.Size(40, 22); this.tbVariableTxtWid.TabIndex = 9; this.tbVariableTxtWid.Text = ""; + this.tbVariableTxtWid.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtBox_KeyDown); // // tbSingleTxtWid // @@ -304,6 +308,7 @@ namespace ROEditor this.tbSingleTxtWid.Size = new System.Drawing.Size(40, 22); this.tbSingleTxtWid.TabIndex = 8; this.tbSingleTxtWid.Text = ""; + this.tbSingleTxtWid.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtBox_KeyDown); // // lblW4 // @@ -586,5 +591,18 @@ namespace ROEditor this.Close(); } + private void txtBox_KeyDown(object sender, KeyEventArgs e) + { + if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) + { + string clpBrd = Clipboard.GetText(); + if (clpBrd.Any(c => c > 166)) + { + MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'"); + Clipboard.Clear(); + } + } + } } } + diff --git a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/FieldTextFrm.cs b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/FieldTextFrm.cs index 30e33bd9..3d4c9770 100644 --- a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/FieldTextFrm.cs +++ b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/FieldTextFrm.cs @@ -77,6 +77,7 @@ using System.Xml.Schema; using System.Text; using ROFields; using RODBInterface; +using System.Linq; namespace ROEditor { @@ -316,6 +317,22 @@ namespace ROEditor } base.Dispose( disposing ); } + private void txtBox_KeyDown(object sender, KeyEventArgs e) + { + bool symFlg = false; + if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) + { + if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) + { + string clpBrd = Clipboard.GetText(); + if (clpBrd.Any(c => c > 166)) + { + MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'"); + Clipboard.Clear(); + } + } + } + } #region Windows Form Designer generated code /// @@ -357,6 +374,7 @@ namespace ROEditor this.tbFieldName.Size = new System.Drawing.Size(320, 22); this.tbFieldName.TabIndex = 2; this.tbFieldName.Text = ""; + this.tbFieldName.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtBox_KeyDown); // // tbWidth // @@ -365,6 +383,7 @@ namespace ROEditor this.tbWidth.Size = new System.Drawing.Size(32, 22); this.tbWidth.TabIndex = 3; this.tbWidth.Text = ""; + this.tbWidth.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtBox_KeyDown); // // btnOK // @@ -402,6 +421,7 @@ namespace ROEditor this.tbPattern.TabIndex = 7; this.tbPattern.Text = ""; this.tbPattern.Visible = false; + this.tbPattern.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtBox_KeyDown); // // FieldTextFrm // @@ -425,3 +445,4 @@ namespace ROEditor #endregion } } + diff --git a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/FieldTypeDefFrm.cs b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/FieldTypeDefFrm.cs index b79ac3ba..f66cef98 100644 --- a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/FieldTypeDefFrm.cs +++ b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/FieldTypeDefFrm.cs @@ -72,6 +72,7 @@ using System.Xml; using System.Text; using RODBInterface; using ROFields; +using System.Linq; namespace ROEditor { @@ -277,6 +278,22 @@ namespace ROEditor this.Close(); } + private void txtBox_KeyDown(object sender, KeyEventArgs e) + { + bool symFlg = false; + if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) + { + if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) + { + string clpBrd = Clipboard.GetText(); + if (clpBrd.Any(c => c > 166)) + { + MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'"); + Clipboard.Clear(); + } + } + } + } #region Windows Form Designer generated code /// /// Required method for Designer support - do not modify @@ -315,6 +332,7 @@ namespace ROEditor this.tbFieldName.Size = new System.Drawing.Size(368, 22); this.tbFieldName.TabIndex = 1; this.tbFieldName.Text = ""; + this.tbFieldName.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtBox_KeyDown); // // gbFldType // @@ -437,3 +455,4 @@ namespace ROEditor #endregion } } + diff --git a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/GroupNewFrm.cs b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/GroupNewFrm.cs index eb4a300a..2bda460d 100644 --- a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/GroupNewFrm.cs +++ b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/GroupNewFrm.cs @@ -52,6 +52,7 @@ using System.Xml; using System.Text; using ROFields; using RODBInterface; +using System.Linq; namespace ROEditor { @@ -155,6 +156,7 @@ namespace ROEditor this.tbGroup.Size = new System.Drawing.Size(248, 22); this.tbGroup.TabIndex = 8; this.tbGroup.Text = ""; + this.tbGroup.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtBox_KeyDown); // // lblGroup // @@ -421,5 +423,21 @@ namespace ROEditor GroupDefFrm grdef = new GroupDefFrm(nelem,myrodb,nelem.InnerText,dbtype); grdef.ShowDialog(); } + private void txtBox_KeyDown(object sender, KeyEventArgs e) + { + if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) + { + if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) + { + string clpBrd = Clipboard.GetText(); + if (clpBrd.Any(c => c > 166)) + { + MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'"); + Clipboard.Clear(); + } + } + } + } } } + diff --git a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/RODefFrm.cs b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/RODefFrm.cs index e60a329c..34406f94 100644 --- a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/RODefFrm.cs +++ b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/RODefFrm.cs @@ -106,6 +106,7 @@ using ROFields; using RODBInterface; using VlnStatus; using System.Collections.Generic; +using System.Linq; namespace ROEditor @@ -1311,6 +1312,22 @@ namespace ROEditor } } } + private void txtBox_KeyDown(object sender, KeyEventArgs e) + { + bool symFlg = false; + if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) + { + if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) + { + string clpBrd = Clipboard.GetText(); + if (clpBrd.Any(c => c > 166)) + { + MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'"); + Clipboard.Clear(); + } + } + } + } #region Windows Form Designer generated code /// @@ -1375,6 +1392,7 @@ namespace ROEditor this.tbRetVal.Size = new System.Drawing.Size(464, 22); this.tbRetVal.TabIndex = 4; this.tbRetVal.Text = "textBox1"; + this.tbRetVal.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtBox_KeyDown); // // tbMenuVal // @@ -1383,6 +1401,7 @@ namespace ROEditor this.tbMenuVal.Size = new System.Drawing.Size(464, 22); this.tbMenuVal.TabIndex = 5; this.tbMenuVal.Text = "textBox1"; + this.tbMenuVal.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtBox_KeyDown); // // lblGroupText // @@ -1608,3 +1627,4 @@ namespace ROEditor #endregion } } + diff --git a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.cs b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.cs index 806ee734..3c5a5e99 100644 --- a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.cs +++ b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.cs @@ -302,9 +302,10 @@ using Org.Mentalis.Files; using System.Runtime.InteropServices; using System.Linq; using System.Collections.Generic; -//using IniFileIO; - - +using System.Xml; +using System.Drawing.Text; +using System.Drawing.Drawing2D; +using System.Text.RegularExpressions; namespace ROEditor { @@ -312,7 +313,6 @@ namespace ROEditor /// Summary description for Form1. /// /// - public class Form1 : System.Windows.Forms.Form { private ctlXMLEditLib.ctlXMLEdit ctlXMLEdit2; @@ -343,7 +343,6 @@ namespace ROEditor private System.Windows.Forms.MenuItem menuROProperties; private System.Windows.Forms.MenuItem menuROExit; private System.Windows.Forms.MenuItem menuItem1; - private XmlDocument myroXmlDoc; private VlnXmlElement newone; private TreeNode TreeNewparent; @@ -353,25 +352,39 @@ namespace ROEditor private System.Windows.Forms.MenuItem menuEditDelete; private System.Windows.Forms.MenuItem menuEditSelAll; private TreeNode LastSelectedNode; - private TextBox _CurrentTextBox; // currently selected TextBox field + private roRichTextBox _CurrentTextBox; // currently selected TextBox field public static string[] PCChildren; //C2021-026 list of Parent/Child Children - public TextBox CurrentTextBox + public roRichTextBox CurrentTextBox { get { return _CurrentTextBox; } set { _CurrentTextBox = value; } } + public static string _RO_IDEN; + public static string RO_IDEN + { + get + { + return _RO_IDEN; + } + set + { + _RO_IDEN = value; + } + } + public List ROsSelectedforMultiMove { get; set; } //to allow multiple RO nodes to be selected public bool ROCutWasSelected { get; set; } = false; private VlnXmlElement rootXml; private TreeNode rootNode; - + private System.Windows.Forms.ImageList imageListRoTree; private System.Windows.Forms.TreeView roTreeView; private System.Windows.Forms.ListView roListView; private System.Windows.Forms.ToolBar tbar; + private bool _duplicate_active; private bool duplicate_active { @@ -389,15 +402,9 @@ namespace ROEditor private const int ROIMAGE = 1; private Color MULTISELECTCOLOR = Color.LightGreen; //back color that multiselected ROs will show - private ToolBarButton tbtnSave; - private ToolBarButton tbtnRestore; - private ToolBarButton tbtnCancel; - private ToolBarButton tbtnSaveAs; - private ToolBarButton tbtnDuplicate; private System.Windows.Forms.MenuItem menuItem2; private System.Windows.Forms.ImageList imageListToolBar; private Label lblDuplicateRO; - private ToolBarButton tbtnZoom; public Form1(string PassedInPath, string specificro) { @@ -405,6 +412,7 @@ namespace ROEditor // Required for Windows Form Designer support // InitializeComponent(); + getSymbols(); // RO Editor add symbols C2022 - 003 // B2019-082 set the date format on the VEPROMS.exe thread to U.S. for i/o of a date string // this is to correct an issue for a UAE customer who could not open some procedures due to the desktop date setting using the "DD/MM/YYYY" instead of the "MM/DD/YYYY" format // NOTE: not doing the "Using System.Threading;" statement at beginning of file because it conflicts with the declaration of the "Timer" variable @@ -412,10 +420,10 @@ namespace ROEditor // The data path the was passed in. DbConnectPath = PassedInPath; - + // Setup the context menu MenuItem[] ContextMenuItemList = new MenuItem[8]; - ContextMenuItemList[0] = new MenuItem("Expand/Collaspe",new EventHandler(roTreeView_ToggleExpandCollapse)); + ContextMenuItemList[0] = new MenuItem("Expand/Collaspe", new EventHandler(roTreeView_ToggleExpandCollapse)); ContextMenuItemList[1] = menuRONew.CloneMenu(); ContextMenuItemList[2] = menuROEdit.CloneMenu(); ContextMenuItemList[3] = menuROCut.CloneMenu(); @@ -463,12 +471,12 @@ namespace ROEditor } } myroXmlDoc = myrodb.RODB_GetRoot(); - rootXml = (VlnXmlElement) myroXmlDoc.FirstChild; + rootXml = (VlnXmlElement)myroXmlDoc.FirstChild; rootNode = new TreeNode("Referenced Objects",ROGROUPIMAGE,ROGROUPIMAGE); rootNode.Tag = rootXml; roTreeView.Nodes.Add(rootNode); roTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.roTreeView_AfterSelect); - roTreeView.DoubleClick += new System.EventHandler(this.roTreeView_OnDoubleClick); + roTreeView.DoubleClick += new System.EventHandler(this.roTreeView_OnDoubleClick); roTreeView.BeforeExpand += new System.Windows.Forms.TreeViewCancelEventHandler(this.roTreeView_BeforeExpand); roTreeView.Sorted = true; roTreeView.ContextMenu = treePopupMenu; @@ -477,7 +485,7 @@ namespace ROEditor // For each group, get its subgroup. bool success = myrodb.RODB_GetRootGroups((VlnXmlElement)myroXmlDoc.FirstChild); if (success == false) this.Close(); - VlnXmlElement group = (VlnXmlElement) myroXmlDoc.FirstChild.FirstChild; + VlnXmlElement group = (VlnXmlElement)myroXmlDoc.FirstChild.FirstChild; while (group != null) { // Add the top groups to tree control as a node. @@ -492,13 +500,14 @@ namespace ROEditor subch.Tag = group; grnode.Nodes.Add(subch); } - group = (VlnXmlElement) group.NextSibling; + group = (VlnXmlElement)group.NextSibling; } newone = null; rootNode.Expand(); duplicate_active = false; if (specificro != null) DoSpecificRO(specificro); } + private void DoSpecificRO(string specificro) { // if a specific RO was passed in. Load the xml tree from it to the root & then @@ -543,18 +552,18 @@ namespace ROEditor else parentid = null; } - + // Now hook this into the top part of tree by loading data into // xml & hooking it into the tree control. string attrele; string attrspro; TreeNode trnd = rootNode.FirstNode; VlnXmlElement ele; - for (int i=levelRecids.Count-1; i>=0; i--) + for (int i = levelRecids.Count-1;i>=0;i--) { ele = (VlnXmlElement) trnd.Tag; attrele = ele.GetAttribute((i==levelRecids.Count-1)?"Table":"RecID"); - if (i==levelRecids.Count-1) + if (i == levelRecids.Count-1) attrspro = spro.GetAttribute("Table"); else attrspro = (string) levelRecids[i]; @@ -562,8 +571,8 @@ namespace ROEditor { // get next one. trnd = trnd.NextNode; - ele = (VlnXmlElement) trnd.Tag; - attrele = ele.GetAttribute((i==levelRecids.Count-1)?"Table":"RecID"); + ele = (VlnXmlElement)trnd.Tag; + attrele = ele.GetAttribute((i==levelRecids.Count - 1)?"Table":"RecID"); } if (trnd == null) { @@ -574,7 +583,7 @@ namespace ROEditor trnd = trnd.FirstNode; } // lastly select the active node, this will load up everything we need. - if (trnd == null) + if (trnd == null) { MessageBox.Show("Error editting RO"); return; @@ -587,7 +596,7 @@ namespace ROEditor ele = (VlnXmlElement) trnd.Tag; attrele = ele.GetAttribute("RecID"); } - if (trnd == null) + if (trnd == null) { MessageBox.Show("Error editting RO"); return; @@ -602,7 +611,7 @@ namespace ROEditor // if the same node was selected, don't do anything. if (LastSelectedNode != null && LastSelectedNode.Equals(roTreeView.SelectedNode)) return; - + TreeNode CurrentNode = roTreeView.SelectedNode; if (LastSelectedNode == null) LastSelectedNode = CurrentNode; @@ -614,7 +623,7 @@ namespace ROEditor if (retval == -1) // cancel { roTreeView.SelectedNode = LastSelectedNode; - + return; } LastSelectedNode = CurrentNode; @@ -625,15 +634,15 @@ namespace ROEditor { XmlNode parent = newone.ParentNode; parent.RemoveChild(newone); - newone=null; + newone = null; } /* enable/disable menu items */ // Enable the Save item if changes were made // Just copy the state of the Save Button - menuROSave.Enabled = tbtnSave.Enabled; - roTreeView.ContextMenu.MenuItems[6].Enabled = tbtnSave.Enabled; + menuROSave.Enabled = rbtnSave.Enabled; //RO Editor add symbols C2022-003 + roTreeView.ContextMenu.MenuItems[6].Enabled = rbtnSave.Enabled; // Should the properties menu item be available? VlnXmlElement curelem = (VlnXmlElement) CurrentNode.Tag; @@ -690,7 +699,7 @@ namespace ROEditor { VlnXmlElement curelemforNodeIter = (VlnXmlElement)nodeIter.Tag; if (curelemforNodeIter.Name != "RO_Root" && curelemforNodeIter.Name != "vlnGroup") - { +{ nodeIter.BackColor = MULTISELECTCOLOR; ROsSelectedforMultiMove.Add(nodeIter); } @@ -765,7 +774,7 @@ namespace ROEditor while (cnt < len) { char tmpchr = tmpstr[cnt]; - if(!char.IsLetterOrDigit(tmpchr)&& (OKpunch.IndexOf(tmpchr) == -1) ) + if (!char.IsLetterOrDigit(tmpchr) && (OKpunch.IndexOf(tmpchr) == -1)) { decval = tmpchr; outstr += OKpunch + decval.ToString("D3"); @@ -802,7 +811,7 @@ namespace ROEditor if (tmpstr.Length <6) indx = -1; else - indx=tmpstr.IndexOf(OKpunch,cur); + indx=tmpstr.IndexOf(OKpunch, cur); string asc_spchar; while (indx>=0) { @@ -814,9 +823,9 @@ namespace ROEditor if (cur+6 > len) indx = -1; else - indx = tmpstr.IndexOf(OKpunch,cur); + indx = tmpstr.IndexOf(OKpunch, cur); } - if (cur 0); } - tbtnSave.Enabled = true; - tbtnRestore.Enabled = true; + rbtnSave.Enabled = true; + rbtnRestore.Enabled = true; if (newone == null) - { tbtnSaveAs.Enabled = true; } + { rbtnSaveAs.Enabled = true; } else - { tbtnSaveAs.Enabled = false; } - tbtnCancel.Enabled = true; - menuROSave.Enabled = tbtnSave.Enabled; + { rbtnSaveAs.Enabled = false; } + rbtnCancel.Enabled = true; + + menuROSave.Enabled = rbtnSave.Enabled; //B2021-080 set the mysavexml flag to true to ensure the text change will be saved - if (this.CurrentTextBox != null && this.CurrentTextBox.Parent !=null) + if (this.CurrentTextBox != null && this.CurrentTextBox.Parent != null) (this.CurrentTextBox.Parent as ctlXMLEdit).mysavexml = true; } @@ -1221,10 +1251,10 @@ namespace ROEditor haskids1 = echild.GetAttribute("HasChild"); if (echild.HasAttribute("ChildLoaded")==true) kidsloaded1 = echild.GetAttribute("ChildLoaded"); - if (haskids1=="True" && kidsloaded1=="False") + if (haskids1 == "True" && kidsloaded1=="False") { TreeNode subch = new TreeNode("VLN_DUMMY_FOR_TREE"); - chldnd.Nodes.Add(subch); + chldnd.Nodes.Add(subch); } } else @@ -1260,7 +1290,7 @@ namespace ROEditor /// protected override void Dispose( bool disposing ) { - if( disposing ) + if ( disposing ) { if (components != null) { @@ -1277,124 +1307,310 @@ namespace ROEditor /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); - this.imageListRoTree = new System.Windows.Forms.ImageList(this.components); - this.splitter1 = new System.Windows.Forms.Splitter(); - this.mainMenu1 = new System.Windows.Forms.MainMenu(this.components); - this.menuRO = new System.Windows.Forms.MenuItem(); - this.menuRONew = new System.Windows.Forms.MenuItem(); - this.menuNewGroup = new System.Windows.Forms.MenuItem(); - this.menuNewRefObj = new System.Windows.Forms.MenuItem(); - this.menuItem1 = new System.Windows.Forms.MenuItem(); - this.menuROEdit = new System.Windows.Forms.MenuItem(); + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); + this.imageListRoTree = new System.Windows.Forms.ImageList(this.components); + this.splitter1 = new System.Windows.Forms.Splitter(); + this.ribbonControl1 = new DevComponents.DotNetBar.RibbonControl(); + this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); // RO Editor add symbols C2022 - 003 + this.ribbonBar1 = new DevComponents.DotNetBar.RibbonBar(); // RO Editor add symbols C2022 - 003 + this.rbtnSave = new DevComponents.DotNetBar.ButtonItem(); + this.rbtnCancel = new DevComponents.DotNetBar.ButtonItem(); + this.rbtnRestore = new DevComponents.DotNetBar.ButtonItem(); + this.rbtnSaveAs = new DevComponents.DotNetBar.ButtonItem(); + this.rbtnDuplicate = new DevComponents.DotNetBar.ButtonItem(); + this.rbtnZoom = new DevComponents.DotNetBar.ButtonItem(); + this.rbtnSymbols = new DevComponents.DotNetBar.ButtonItem(); + this.galleryContainerSymbols = new DevComponents.DotNetBar.GalleryContainer(); + this.mainMenu1 = new System.Windows.Forms.MainMenu(this.components); + this.menuRO = new System.Windows.Forms.MenuItem(); + this.menuRONew = new System.Windows.Forms.MenuItem(); + this.menuNewGroup = new System.Windows.Forms.MenuItem(); + this.menuNewRefObj = new System.Windows.Forms.MenuItem(); + this.menuItem1 = new System.Windows.Forms.MenuItem(); + this.menuROEdit = new System.Windows.Forms.MenuItem(); this.menuROCut = new System.Windows.Forms.MenuItem(); this.menuROPaste = new System.Windows.Forms.MenuItem(); this.menuRODelete = new System.Windows.Forms.MenuItem(); - this.menuROSave = new System.Windows.Forms.MenuItem(); - this.menuROProperties = new System.Windows.Forms.MenuItem(); - this.menuItem10 = new System.Windows.Forms.MenuItem(); - this.menuROExit = new System.Windows.Forms.MenuItem(); - this.menuEdit = new System.Windows.Forms.MenuItem(); - this.menuEditUndo = new System.Windows.Forms.MenuItem(); - this.menuItem3 = new System.Windows.Forms.MenuItem(); - this.menuEditCut = new System.Windows.Forms.MenuItem(); - this.menuEditCopy = new System.Windows.Forms.MenuItem(); - this.menuEditPaste = new System.Windows.Forms.MenuItem(); - this.menuEditDelete = new System.Windows.Forms.MenuItem(); - this.menuItem5 = new System.Windows.Forms.MenuItem(); - this.menuEditSelAll = new System.Windows.Forms.MenuItem(); - this.menuTools = new System.Windows.Forms.MenuItem(); - this.menuToolsROFST = new System.Windows.Forms.MenuItem(); - this.menuHelp = new System.Windows.Forms.MenuItem(); - this.menuHelpAbout = new System.Windows.Forms.MenuItem(); - this.menuItem2 = new System.Windows.Forms.MenuItem(); - this.panel1 = new System.Windows.Forms.Panel(); - this.panel2 = new System.Windows.Forms.Panel(); - this.roTreeView = new System.Windows.Forms.TreeView(); - this.tbar = new System.Windows.Forms.ToolBar(); - this.tbtnSave = new System.Windows.Forms.ToolBarButton(); - this.tbtnCancel = new System.Windows.Forms.ToolBarButton(); - this.tbtnRestore = new System.Windows.Forms.ToolBarButton(); - this.tbtnSaveAs = new System.Windows.Forms.ToolBarButton(); - this.tbtnDuplicate = new System.Windows.Forms.ToolBarButton(); - this.tbtnZoom = new System.Windows.Forms.ToolBarButton(); - this.imageListToolBar = new System.Windows.Forms.ImageList(this.components); - this.lblDuplicateRO = new System.Windows.Forms.Label(); - this.panel1.SuspendLayout(); - this.SuspendLayout(); - // - // imageListRoTree - // - this.imageListRoTree.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageListRoTree.ImageStream"))); - this.imageListRoTree.TransparentColor = System.Drawing.Color.Transparent; - this.imageListRoTree.Images.SetKeyName(0, ""); - this.imageListRoTree.Images.SetKeyName(1, ""); - // - // splitter1 - // - this.splitter1.Location = new System.Drawing.Point(220, 28); - this.splitter1.Name = "splitter1"; - this.splitter1.Size = new System.Drawing.Size(8, 591); - this.splitter1.TabIndex = 4; - this.splitter1.TabStop = false; - // - // mainMenu1 - // - this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.menuROSave = new System.Windows.Forms.MenuItem(); + this.menuROProperties = new System.Windows.Forms.MenuItem(); + this.menuItem10 = new System.Windows.Forms.MenuItem(); + this.menuROExit = new System.Windows.Forms.MenuItem(); + this.menuEdit = new System.Windows.Forms.MenuItem(); + this.menuEditUndo = new System.Windows.Forms.MenuItem(); + this.menuItem3 = new System.Windows.Forms.MenuItem(); + this.menuEditCut = new System.Windows.Forms.MenuItem(); + this.menuEditCopy = new System.Windows.Forms.MenuItem(); + this.menuEditPaste = new System.Windows.Forms.MenuItem(); + this.menuEditDelete = new System.Windows.Forms.MenuItem(); + this.menuItem5 = new System.Windows.Forms.MenuItem(); + this.menuEditSelAll = new System.Windows.Forms.MenuItem(); + this.menuTools = new System.Windows.Forms.MenuItem(); + this.menuToolsROFST = new System.Windows.Forms.MenuItem(); + this.menuHelp = new System.Windows.Forms.MenuItem(); + this.menuHelpAbout = new System.Windows.Forms.MenuItem(); + this.menuItem2 = new System.Windows.Forms.MenuItem(); + this.panel1 = new System.Windows.Forms.Panel(); + this.panel2 = new System.Windows.Forms.Panel(); + this.roTreeView = new System.Windows.Forms.TreeView(); + this.tbar = new System.Windows.Forms.ToolBar(); + this.imageListToolBar = new System.Windows.Forms.ImageList(this.components); + this.lblDuplicateRO = new System.Windows.Forms.Label(); + this.ribbonControl1.SuspendLayout(); + this.ribbonPanel1.SuspendLayout(); + this.panel1.SuspendLayout(); + this.SuspendLayout(); + // + // imageListRoTree + // + this.imageListRoTree.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageListRoTree.ImageStream"))); + this.imageListRoTree.TransparentColor = System.Drawing.Color.Transparent; + this.imageListRoTree.Images.SetKeyName(0, ""); + this.imageListRoTree.Images.SetKeyName(1, ""); + // + // splitter1 + // + this.splitter1.Location = new System.Drawing.Point(220, 50); + this.splitter1.Name = "splitter1"; + this.splitter1.Size = new System.Drawing.Size(8, 569); + this.splitter1.TabIndex = 4; + this.splitter1.TabStop = false; + // + // ribbonControl1 + // + this.ribbonControl1.BackColor = System.Drawing.Color.White; + // + // + // + this.ribbonControl1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; // RO Editor add symbols C2022 - 003 + this.ribbonControl1.CaptionVisible = true; + this.ribbonControl1.Controls.Add(this.ribbonPanel1); + this.ribbonControl1.Dock = System.Windows.Forms.DockStyle.Top; + this.ribbonControl1.ForeColor = System.Drawing.Color.Black; + this.ribbonControl1.KeyTipsFont = new System.Drawing.Font("Tahoma", 7F); + this.ribbonControl1.Location = new System.Drawing.Point(0, 0); + this.ribbonControl1.Name = "ribbonControl1"; + this.ribbonControl1.Padding = new System.Windows.Forms.Padding(0, 0, 0, 3); + this.ribbonControl1.QuickToolbarItems.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.rbtnSave, + this.rbtnCancel, + this.rbtnRestore, + this.rbtnSaveAs, + this.rbtnDuplicate, + this.rbtnZoom, + this.rbtnSymbols}); + this.ribbonControl1.Size = new System.Drawing.Size(980, 50); + this.ribbonControl1.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonControl1.SystemText.MaximizeRibbonText = "&Maximize the Ribbon"; + this.ribbonControl1.SystemText.MinimizeRibbonText = "Mi&nimize the Ribbon"; + this.ribbonControl1.SystemText.QatAddItemText = "&Add to Quick Access Toolbar"; + this.ribbonControl1.SystemText.QatCustomizeMenuLabel = "Customize Quick Access Toolbar"; + this.ribbonControl1.SystemText.QatCustomizeText = "&Customize Quick Access Toolbar..."; + this.ribbonControl1.SystemText.QatDialogAddButton = "&Add >>"; + this.ribbonControl1.SystemText.QatDialogCancelButton = "Cancel"; + this.ribbonControl1.SystemText.QatDialogCaption = "Customize Quick Access Toolbar"; + this.ribbonControl1.SystemText.QatDialogCategoriesLabel = "&Choose commands from:"; + this.ribbonControl1.SystemText.QatDialogOkButton = "OK"; + this.ribbonControl1.SystemText.QatDialogPlacementCheckbox = "&Place Quick Access Toolbar below the Ribbon"; + this.ribbonControl1.SystemText.QatDialogRemoveButton = "&Remove"; + this.ribbonControl1.SystemText.QatPlaceAboveRibbonText = "&Place Quick Access Toolbar above the Ribbon"; + this.ribbonControl1.SystemText.QatPlaceBelowRibbonText = "&Place Quick Access Toolbar below the Ribbon"; + this.ribbonControl1.SystemText.QatRemoveItemText = "&Remove from Quick Access Toolbar"; + this.ribbonControl1.TabGroupHeight = 14; + this.ribbonControl1.TabIndex = 0; + this.ribbonControl1.Text = "ribbonControl1"; + // + // ribbonPanel1 + // + this.ribbonPanel1.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; // RO Editor add symbols C2022 - 003 + this.ribbonPanel1.Controls.Add(this.ribbonBar1); + this.ribbonPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.ribbonPanel1.Location = new System.Drawing.Point(0, 0); + this.ribbonPanel1.Name = "ribbonPanel1"; + this.ribbonPanel1.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.ribbonPanel1.Size = new System.Drawing.Size(980, 47); + // + // + // + this.ribbonPanel1.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel1.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonPanel1.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonPanel1.TabIndex = 1; + // + // ribbonBar1 + // + this.ribbonBar1.AutoOverflowEnabled = true; + // + // + // + this.ribbonBar1.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.ribbonBar1.ContainerControlProcessDialogKey = true; + this.ribbonBar1.Dock = System.Windows.Forms.DockStyle.Left; + this.ribbonBar1.DragDropSupport = true; + this.ribbonBar1.LicenseKey = "F962CEC7-CD8F-4911-A9E9-CAB39962FC1F"; + this.ribbonBar1.Location = new System.Drawing.Point(3, 0); + this.ribbonBar1.Name = "ribbonBar1"; + this.ribbonBar1.Size = new System.Drawing.Size(794, 44); + this.ribbonBar1.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.ribbonBar1.TabIndex = 0; + this.ribbonBar1.Text = "ribbonBar1"; + // + // + // + this.ribbonBar1.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.ribbonBar1.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // rbtnSave + // + this.rbtnSave.Enabled = false; + this.rbtnSave.Name = "rbtnSave"; + this.rbtnSave.Text = "Save"; + this.rbtnSave.Click += new System.EventHandler(this.rbtnSave_Click); + // + // rbtnCancel + // + this.rbtnCancel.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.rbtnCancel.Enabled = false; + this.rbtnCancel.Name = "rbtnCancel"; + this.rbtnCancel.SubItemsExpandWidth = 24; + this.rbtnCancel.Text = "Cancel"; + this.rbtnCancel.Click += new System.EventHandler(this.rbtnCancel_Click); + // + // rbtnRestore + // + this.rbtnRestore.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.rbtnRestore.Enabled = false; + this.rbtnRestore.Name = "rbtnRestore"; + this.rbtnRestore.SubItemsExpandWidth = 24; + this.rbtnRestore.Text = "Restore"; + this.rbtnRestore.Click += new System.EventHandler(this.rbtnRestore_Click); + // + // rbtnSaveAs + // + this.rbtnSaveAs.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.rbtnSaveAs.Enabled = false; + this.rbtnSaveAs.Name = "rbtnSaveAs"; + this.rbtnSaveAs.SubItemsExpandWidth = 24; + this.rbtnSaveAs.Text = "Save As"; + this.rbtnSaveAs.Click += new System.EventHandler(this.rbtnSaveAs_Click); + // + // rbtnDuplicate + // + this.rbtnDuplicate.BeginGroup = true; + this.rbtnDuplicate.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.rbtnDuplicate.Enabled = false; + this.rbtnDuplicate.Name = "rbtnDuplicate"; + this.rbtnDuplicate.SubItemsExpandWidth = 24; + this.rbtnDuplicate.Text = "Duplicate"; + this.rbtnDuplicate.Click += new System.EventHandler(this.rbtnDuplicate_Click); + // + // rbtnZoom + // + this.rbtnZoom.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; + this.rbtnZoom.Enabled = false; + this.rbtnZoom.Name = "rbtnZoom"; + this.rbtnZoom.SubItemsExpandWidth = 24; + this.rbtnZoom.Text = "Zoom"; + this.rbtnZoom.Click += new System.EventHandler(this.rbtnZoom_Click); + // + // rbtnSymbols + // + this.rbtnSymbols.AutoExpandOnClick = true; + this.rbtnSymbols.Enabled = false; + this.rbtnSymbols.KeyTips = "CS"; + this.rbtnSymbols.Name = "rbtnSymbols"; + this.rbtnSymbols.SubItems.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.galleryContainerSymbols}); + this.rbtnSymbols.SubItemsExpandWidth = 14; + this.rbtnSymbols.Text = "Symbols"; + // + // galleryContainerSymbols + // + // + // + // + this.galleryContainerSymbols.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.galleryContainerSymbols.DefaultSize = new System.Drawing.Size(205, 150); + this.galleryContainerSymbols.MinimumSize = new System.Drawing.Size(58, 58); + this.galleryContainerSymbols.Name = "galleryContainerSymbols"; + // + // + // + this.galleryContainerSymbols.TitleMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.galleryContainerSymbols.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // mainMenu1 + // + this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuRO, this.menuEdit, this.menuTools, this.menuHelp, this.menuItem2}); - // - // menuRO - // - this.menuRO.Index = 0; - this.menuRO.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + // + // menuRO + // + this.menuRO.Index = 0; + this.menuRO.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuRONew, this.menuItem1, this.menuROEdit, - this.menuROCut, - this.menuROPaste, + this.menuROCut, + this.menuROPaste, this.menuRODelete, this.menuROSave, this.menuROProperties, this.menuItem10, this.menuROExit}); - this.menuRO.Text = "RO"; - // - // menuRONew - // - this.menuRONew.Index = 0; - this.menuRONew.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.menuRO.Text = "RO"; + // + // menuRONew + // + this.menuRONew.Index = 0; + this.menuRONew.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuNewGroup, this.menuNewRefObj}); - this.menuRONew.Text = "New ..."; - // - // menuNewGroup - // - this.menuNewGroup.Index = 0; - this.menuNewGroup.Text = "Group"; - this.menuNewGroup.Click += new System.EventHandler(this.menuNewGroup_Click); - // - // menuNewRefObj - // - this.menuNewRefObj.Index = 1; - this.menuNewRefObj.Text = "Referenced Object"; - this.menuNewRefObj.Click += new System.EventHandler(this.menuNewRefObj_Click); - // - // menuItem1 - // - this.menuItem1.Index = 1; - this.menuItem1.Text = "-"; - // - // menuROEdit - // - this.menuROEdit.Enabled = false; - this.menuROEdit.Index = 2; - this.menuROEdit.Text = "Edit"; - this.menuROEdit.Click += new System.EventHandler(this.menuROEdit_Click); + this.menuRONew.Text = "New ..."; + // + // menuNewGroup + // + this.menuNewGroup.Index = 0; + this.menuNewGroup.Text = "Group"; + this.menuNewGroup.Click += new System.EventHandler(this.menuNewGroup_Click); + // + // menuNewRefObj + // + this.menuNewRefObj.Index = 1; + this.menuNewRefObj.Text = "Referenced Object"; + this.menuNewRefObj.Click += new System.EventHandler(this.menuNewRefObj_Click); + // + // menuItem1 + // + this.menuItem1.Index = 1; + this.menuItem1.Text = "-"; + // + // menuROEdit + // + this.menuROEdit.Enabled = false; + this.menuROEdit.Index = 2; + this.menuROEdit.Text = "Edit"; + this.menuROEdit.Click += new System.EventHandler(this.menuROEdit_Click); // // menuROCut // @@ -1413,37 +1629,37 @@ namespace ROEditor // menuRODelete // this.menuRODelete.Index = 5; - this.menuRODelete.Text = "Delete"; - this.menuRODelete.Click += new System.EventHandler(this.menuRODelete_Click); - // - // menuROSave - // - this.menuROSave.Enabled = false; - this.menuROSave.Index = 6; - this.menuROSave.Text = "Save"; - this.menuROSave.Click += new System.EventHandler(this.menuROSave_Click); - // - // menuROProperties - // - this.menuROProperties.Index = 7; - this.menuROProperties.Text = "Properties"; - this.menuROProperties.Click += new System.EventHandler(this.menuROProperties_Click); - // - // menuItem10 - // - this.menuItem10.Index = 8; - this.menuItem10.Text = "-"; - // - // menuROExit - // - this.menuROExit.Index = 9; - this.menuROExit.Text = "Exit RO Editor"; - this.menuROExit.Click += new System.EventHandler(this.menuROExit_Click); - // - // menuEdit - // - this.menuEdit.Index = 1; - this.menuEdit.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.menuRODelete.Text = "Delete"; + this.menuRODelete.Click += new System.EventHandler(this.menuRODelete_Click); + // + // menuROSave + // + this.menuROSave.Enabled = false; + this.menuROSave.Index = 6; + this.menuROSave.Text = "Save"; + this.menuROSave.Click += new System.EventHandler(this.menuROSave_Click); + // + // menuROProperties + // + this.menuROProperties.Index = 7; + this.menuROProperties.Text = "Properties"; + this.menuROProperties.Click += new System.EventHandler(this.menuROProperties_Click); + // + // menuItem10 + // + this.menuItem10.Index = 8; + this.menuItem10.Text = "-"; + // + // menuROExit + // + this.menuROExit.Index = 9; + this.menuROExit.Text = "Exit RO Editor"; + this.menuROExit.Click += new System.EventHandler(this.menuROExit_Click); + // + // menuEdit + // + this.menuEdit.Index = 1; + this.menuEdit.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuEditUndo, this.menuItem3, this.menuEditCut, @@ -1452,231 +1668,188 @@ namespace ROEditor this.menuEditDelete, this.menuItem5, this.menuEditSelAll}); - this.menuEdit.Text = "Edit"; - // - // menuEditUndo - // - this.menuEditUndo.Enabled = false; - this.menuEditUndo.Index = 0; - this.menuEditUndo.Text = "&Undo"; - this.menuEditUndo.Click += new System.EventHandler(this.menuEditUndo_Click); - // - // menuItem3 - // - this.menuItem3.Index = 1; - this.menuItem3.Text = "-"; - // - // menuEditCut - // - this.menuEditCut.Enabled = false; - this.menuEditCut.Index = 2; - this.menuEditCut.Text = "Cu&t"; - this.menuEditCut.Click += new System.EventHandler(this.menuEditCut_Click); - // - // menuEditCopy - // - this.menuEditCopy.Enabled = false; - this.menuEditCopy.Index = 3; - this.menuEditCopy.Text = "&Copy"; - this.menuEditCopy.Click += new System.EventHandler(this.menuEditCopy_Click); - // - // menuEditPaste - // - this.menuEditPaste.Enabled = false; - this.menuEditPaste.Index = 4; - this.menuEditPaste.Text = "&Paste"; - this.menuEditPaste.Click += new System.EventHandler(this.menuEditPaste_Click); - // - // menuEditDelete - // - this.menuEditDelete.Enabled = false; - this.menuEditDelete.Index = 5; - this.menuEditDelete.Text = "&Delete"; - this.menuEditDelete.Click += new System.EventHandler(this.menuEditDelete_Click); - // - // menuItem5 - // - this.menuItem5.Index = 6; - this.menuItem5.Text = "-"; - // - // menuEditSelAll - // - this.menuEditSelAll.Enabled = false; - this.menuEditSelAll.Index = 7; - this.menuEditSelAll.Text = "Select &All"; - this.menuEditSelAll.Click += new System.EventHandler(this.menuEditSelAll_Click); - // - // menuTools - // - this.menuTools.Index = 2; - this.menuTools.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.menuEdit.Text = "Edit"; + // + // menuEditUndo + // + this.menuEditUndo.Enabled = false; + this.menuEditUndo.Index = 0; + this.menuEditUndo.Text = "&Undo"; + this.menuEditUndo.Click += new System.EventHandler(this.menuEditUndo_Click); + // + // menuItem3 + // + this.menuItem3.Index = 1; + this.menuItem3.Text = "-"; + // + // menuEditCut + // + this.menuEditCut.Enabled = false; + this.menuEditCut.Index = 2; + this.menuEditCut.Text = "Cu&t"; + this.menuEditCut.Click += new System.EventHandler(this.menuEditCut_Click); + // + // menuEditCopy + // + this.menuEditCopy.Enabled = false; + this.menuEditCopy.Index = 3; + this.menuEditCopy.Text = "&Copy"; + this.menuEditCopy.Click += new System.EventHandler(this.menuEditCopy_Click); + // + // menuEditPaste + // + this.menuEditPaste.Enabled = false; + this.menuEditPaste.Index = 4; + this.menuEditPaste.Text = "&Paste"; + this.menuEditPaste.Click += new System.EventHandler(this.menuEditPaste_Click); + // + // menuEditDelete + // + this.menuEditDelete.Enabled = false; + this.menuEditDelete.Index = 5; + this.menuEditDelete.Text = "&Delete"; + this.menuEditDelete.Click += new System.EventHandler(this.menuEditDelete_Click); + // + // menuItem5 + // + this.menuItem5.Index = 6; + this.menuItem5.Text = "-"; + // + // menuEditSelAll + // + this.menuEditSelAll.Enabled = false; + this.menuEditSelAll.Index = 7; + this.menuEditSelAll.Text = "Select &All"; + this.menuEditSelAll.Click += new System.EventHandler(this.menuEditSelAll_Click); + // + // menuTools + // + this.menuTools.Index = 2; + this.menuTools.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuToolsROFST}); - this.menuTools.Text = "Tools"; - // - // menuToolsROFST - // - this.menuToolsROFST.Index = 0; - this.menuToolsROFST.Text = "Create RO.FST"; - this.menuToolsROFST.Click += new System.EventHandler(this.menuToolsROFST_Click); - // - // menuHelp - // - this.menuHelp.Index = 3; - this.menuHelp.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.menuTools.Text = "Tools"; + // + // menuToolsROFST + // + this.menuToolsROFST.Index = 0; + this.menuToolsROFST.Text = "Create RO.FST"; + this.menuToolsROFST.Click += new System.EventHandler(this.menuToolsROFST_Click); + // + // menuHelp + // + this.menuHelp.Index = 3; + this.menuHelp.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuHelpAbout}); - this.menuHelp.Text = "Help"; - // - // menuHelpAbout - // - this.menuHelpAbout.Index = 0; - this.menuHelpAbout.Text = "About"; - this.menuHelpAbout.Click += new System.EventHandler(this.menuHelpAbout_Click); - // - // menuItem2 - // - this.menuItem2.Index = 4; - this.menuItem2.Text = ""; - // - // panel1 - // - this.panel1.AutoScroll = true; - this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - this.panel1.Controls.Add(this.panel2); - this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel1.Location = new System.Drawing.Point(228, 28); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(752, 591); - this.panel1.TabIndex = 5; - // - // panel2 - // - this.panel2.AutoScroll = true; - this.panel2.Location = new System.Drawing.Point(0, 0); - this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(235, 118); - this.panel2.TabIndex = 0; - this.panel2.Visible = false; - // - // roTreeView - // - this.roTreeView.Dock = System.Windows.Forms.DockStyle.Left; - this.roTreeView.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.roTreeView.ImageIndex = 0; - this.roTreeView.ImageList = this.imageListRoTree; - this.roTreeView.ItemHeight = 18; - this.roTreeView.Location = new System.Drawing.Point(0, 28); - this.roTreeView.Name = "roTreeView"; - this.roTreeView.SelectedImageIndex = 0; - this.roTreeView.Size = new System.Drawing.Size(220, 591); - this.roTreeView.TabIndex = 3; - this.roTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.roTreeView_AfterSelect_1); - // - // tbar - // - this.tbar.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] { - this.tbtnSave, - this.tbtnCancel, - this.tbtnRestore, - this.tbtnSaveAs, - this.tbtnDuplicate, - this.tbtnZoom}); - this.tbar.DropDownArrows = true; - this.tbar.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tbar.ImageList = this.imageListToolBar; - this.tbar.Location = new System.Drawing.Point(0, 0); - this.tbar.Name = "tbar"; - this.tbar.ShowToolTips = true; - this.tbar.Size = new System.Drawing.Size(980, 28); - this.tbar.TabIndex = 0; - this.tbar.TextAlign = System.Windows.Forms.ToolBarTextAlign.Right; - this.tbar.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.tbar_OnClick); - // - // tbtnSave - // - this.tbtnSave.Enabled = false; - this.tbtnSave.ImageIndex = 0; - this.tbtnSave.Name = "tbtnSave"; - this.tbtnSave.Text = "Save"; - // - // tbtnCancel - // - this.tbtnCancel.Enabled = false; - this.tbtnCancel.ImageIndex = 1; - this.tbtnCancel.Name = "tbtnCancel"; - this.tbtnCancel.Text = "Cancel"; - // - // tbtnRestore - // - this.tbtnRestore.Enabled = false; - this.tbtnRestore.ImageIndex = 2; - this.tbtnRestore.Name = "tbtnRestore"; - this.tbtnRestore.Text = "Restore"; - // - // tbtnSaveAs - // - this.tbtnSaveAs.Enabled = false; - this.tbtnSaveAs.ImageIndex = 3; - this.tbtnSaveAs.Name = "tbtnSaveAs"; - this.tbtnSaveAs.Text = "Save As"; - // - // tbtnDuplicate - // - this.tbtnDuplicate.Enabled = false; - this.tbtnDuplicate.ImageIndex = 4; - this.tbtnDuplicate.Name = "tbtnDuplicate"; - this.tbtnDuplicate.Text = "Duplicate"; - // - // tbtnZoom - // - this.tbtnZoom.Enabled = false; - this.tbtnZoom.ImageIndex = 5; - this.tbtnZoom.Name = "tbtnZoom"; - this.tbtnZoom.Text = "Zoom"; - // - // imageListToolBar - // - this.imageListToolBar.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageListToolBar.ImageStream"))); - this.imageListToolBar.TransparentColor = System.Drawing.Color.Transparent; - this.imageListToolBar.Images.SetKeyName(0, ""); - this.imageListToolBar.Images.SetKeyName(1, ""); - this.imageListToolBar.Images.SetKeyName(2, ""); - this.imageListToolBar.Images.SetKeyName(3, ""); - this.imageListToolBar.Images.SetKeyName(4, ""); - this.imageListToolBar.Images.SetKeyName(5, ""); - // - // lblDuplicateRO - // - this.lblDuplicateRO.AutoSize = true; - this.lblDuplicateRO.ForeColor = System.Drawing.Color.Red; - this.lblDuplicateRO.Location = new System.Drawing.Point(570, 9); - this.lblDuplicateRO.Name = "lblDuplicateRO"; - this.lblDuplicateRO.Size = new System.Drawing.Size(139, 13); - this.lblDuplicateRO.TabIndex = 6; - this.lblDuplicateRO.Text = "Working With Duplicate RO"; - this.lblDuplicateRO.Visible = false; - // - // Form1 - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(980, 619); - this.Controls.Add(this.lblDuplicateRO); - this.Controls.Add(this.panel1); - this.Controls.Add(this.splitter1); - this.Controls.Add(this.roTreeView); - this.Controls.Add(this.tbar); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Menu = this.mainMenu1; - this.Name = "Form1"; - this.Text = "RO Edit"; - this.panel1.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); + this.menuHelp.Text = "Help"; + // + // menuHelpAbout + // + this.menuHelpAbout.Index = 0; + this.menuHelpAbout.Text = "About"; + this.menuHelpAbout.Click += new System.EventHandler(this.menuHelpAbout_Click); + // + // menuItem2 + // + this.menuItem2.Index = 4; + this.menuItem2.Text = ""; + // + // panel1 + // + this.panel1.AutoScroll = true; + this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.panel1.Controls.Add(this.panel2); + this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel1.Location = new System.Drawing.Point(228, 50); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(752, 569); + this.panel1.TabIndex = 5; + // + // panel2 + // + this.panel2.AutoScroll = true; + this.panel2.Location = new System.Drawing.Point(0, 0); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(235, 118); + this.panel2.TabIndex = 0; + this.panel2.Visible = false; + // + // roTreeView + // + this.roTreeView.Dock = System.Windows.Forms.DockStyle.Left; + this.roTreeView.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.roTreeView.ImageIndex = 0; + this.roTreeView.ImageList = this.imageListRoTree; + this.roTreeView.ItemHeight = 18; + this.roTreeView.Location = new System.Drawing.Point(0, 50); + this.roTreeView.Name = "roTreeView"; + this.roTreeView.SelectedImageIndex = 0; + this.roTreeView.Size = new System.Drawing.Size(220, 569); + this.roTreeView.TabIndex = 3; + + // + // imageListToolBar + // + this.imageListToolBar.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageListToolBar.ImageStream"))); + this.imageListToolBar.TransparentColor = System.Drawing.Color.Transparent; + this.imageListToolBar.Images.SetKeyName(0, ""); + this.imageListToolBar.Images.SetKeyName(1, ""); + this.imageListToolBar.Images.SetKeyName(2, ""); + this.imageListToolBar.Images.SetKeyName(3, ""); + this.imageListToolBar.Images.SetKeyName(4, ""); + this.imageListToolBar.Images.SetKeyName(5, ""); + // + // lblDuplicateRO + // + this.lblDuplicateRO.AutoSize = true; + this.lblDuplicateRO.ForeColor = System.Drawing.Color.Red; + this.lblDuplicateRO.Location = new System.Drawing.Point(570, 9); + this.lblDuplicateRO.Name = "lblDuplicateRO"; + this.lblDuplicateRO.Size = new System.Drawing.Size(139, 13); + this.lblDuplicateRO.TabIndex = 6; + this.lblDuplicateRO.Text = "Working With Duplicate RO"; + this.lblDuplicateRO.Visible = false; + // + // + // Form1 + // + this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); + this.ClientSize = new System.Drawing.Size(980, 619); + this.Controls.Add(this.lblDuplicateRO); + this.Controls.Add(this.panel1); + this.Controls.Add(this.splitter1); + this.Controls.Add(this.roTreeView); + //this.Controls.Add(this.tbar); + this.Controls.Add(this.ribbonControl1); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Menu = this.mainMenu1; + this.Name = "Form1"; + this.Text = "RO Edit"; + this.ribbonControl1.ResumeLayout(false); + this.ribbonControl1.PerformLayout(); + this.ribbonPanel1.ResumeLayout(false); + this.panel1.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); } + private DevComponents.DotNetBar.RibbonControl ribbonControl1; + private DevComponents.DotNetBar.RibbonPanel ribbonPanel1; + private DevComponents.DotNetBar.RibbonBar ribbonBar1; + private DevComponents.DotNetBar.ButtonItem rbtnCancel; + private DevComponents.DotNetBar.ButtonItem rbtnRestore; + private DevComponents.DotNetBar.ButtonItem rbtnSaveAs; + private DevComponents.DotNetBar.ButtonItem rbtnDuplicate; + private DevComponents.DotNetBar.ButtonItem rbtnZoom; + private DevComponents.DotNetBar.ButtonItem rbtnSymbols; + private DevComponents.DotNetBar.ButtonItem rbtnSave; + private DevComponents.DotNetBar.GalleryContainer galleryContainerSymbols; + private DevComponents.DotNetBar.GalleryContainer galSymbols; + + //Cut/Paste (Move ROs) added as part of CSM-C2024-027 / Part of 2024 PROMS Upgrades private void menuROCut_Click(object sender, EventArgs e) - { + { ROCutWasSelected = true; string msgstr = "It is recommended that after moving ROs, you create a FST and use it to update RO Values in PROMS to ensure RO Links properly move to the new location as well.\n\n Are you sure you wish to move the RO(s)?"; @@ -1687,6 +1860,8 @@ namespace ROEditor } + + //part of CSM-C2024-027 / Part of 2024 PROMS Upgrades //Paste Selected - will move individual ROs private void menuROPaste_Click(object sender, EventArgs e) @@ -1699,7 +1874,7 @@ namespace ROEditor foreach (TreeNode tnToCut in ROsSelectedforMultiMove) { - VlnXmlElement ROtoCut = ((VlnXmlElement) tnToCut.Tag); + VlnXmlElement ROtoCut = ((VlnXmlElement)tnToCut.Tag); if (((VlnXmlElement)roTreeView.SelectedNode.Tag).GetAttribute("Table") != ROtoCut.GetAttribute("Table")) { MessageBox.Show("You can only move a RO within the same table."); @@ -1727,11 +1902,13 @@ namespace ROEditor } roTreeView_ClearAllMultiSelect(); - tbtnRestore.Enabled = false; - tbtnSave.Enabled = false; - tbtnCancel.Enabled = true; - tbtnSaveAs.Enabled = false; - tbtnDuplicate.Enabled = true; + + rbtnRestore.Enabled = false; // RO Editor add symbols C2022 - 003 + rbtnSave.Enabled = false; + rbtnCancel.Enabled = true; + rbtnSaveAs.Enabled = false; + rbtnDuplicate.Enabled = true; + duplicate_active = false; ROCutWasSelected = false; menuROCut.Enabled = false; @@ -1739,7 +1916,7 @@ namespace ROEditor menuROPaste.Enabled = false; roTreeView.ContextMenu.MenuItems[4].Enabled = menuROPaste.Enabled; roTreeView.Refresh(); - + } //part of CSM-C2024-027 / Part of 2024 PROMS Upgrades @@ -1810,7 +1987,7 @@ namespace ROEditor { string fname_inxml = fldname.Split(new string[] { "\t" }, StringSplitOptions.None)[0]; string fname = CvtFldToUserFld(fname_inxml); - if (!InUseList_ROtoMove.Any(x=> x.GetFieldname == CvtFldToUserFld(fldname.Split(new string[] { "\t" }, StringSplitOptions.None)[0])) || newro.ChildNodes.Cast().Any(x => x.Name == fname_inxml && x.InnerText.Length == 0)) + if (!InUseList_ROtoMove.Any(x => x.GetFieldname == CvtFldToUserFld(fldname.Split(new string[] { "\t" }, StringSplitOptions.None)[0])) || newro.ChildNodes.Cast().Any(x => x.Name == fname_inxml && x.InnerText.Length == 0)) { MessageBox.Show($"RO: {orig_title}. Required field \"{fname}\" is missing a value that is required. Please be sure RO has a value for this field before moving the RO.", "Problem saving data"); placetomoveroto.RemoveChild(newro); @@ -1958,7 +2135,7 @@ namespace ROEditor // Try to delete the owner file. If another process has the file open, this delete will fail. // If the file is closed, it will be deleted, and the user will be placed in the editor. The users // name and the time when this session began will be placed in the owner file. - fiown.Delete(); + fiown.Delete(); } catch(Exception ex) { @@ -1977,7 +2154,7 @@ namespace ROEditor return; } } - catch(Exception e) + catch (Exception e) { MessageBox.Show(e.Message,"fileinfo"); } @@ -1988,27 +2165,16 @@ namespace ROEditor TextWriter tw = new StreamWriter(fsown); tw.WriteLine("Current User: {0}, Date and Time Started: {1}", Environment.UserName.ToUpper(), DateTime.Now.ToString("MM/dd/yyyy @ hh:mm")); tw.Flush(); - } + } catch (IOException ex) { fsown = fiown.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite); TextReader tr = new StreamReader(fsown); string who = tr.ReadToEnd(); tr.Close(); - if(who.Contains(Environment.UserName.ToUpper())) + if (who.Contains(Environment.UserName.ToUpper())) { BringWindowToFront(); - - //Process[] p = Process.GetProcessesByName("ROEditor"); - //Process cp = Process.GetCurrentProcess(); - //for (int i = 0; i < p.Length; i++) - //{ - // if (p[i].SessionId != cp.SessionId) - // { - // SetForegroundWindow(p[i].MainWindowHandle); - // break; - // } - //} } else MessageBox.Show(who, "Another user is executing the RoEditor"); @@ -2032,15 +2198,15 @@ namespace ROEditor } } - if (StartupROEditor) + if (StartupROEditor) { Application.Run(new Form1(ConnectionPath,specificro)); - + if (fsown != null) { fsown.Close(); fiown.Delete(); - } + } Application.Exit(); } } @@ -2070,7 +2236,7 @@ namespace ROEditor { InProcdureDir = true; IniReader ini = new IniReader("PROC.INI"); - RtnStr = ini.ReadString("RO Defaults","ROPATH",""); + RtnStr = ini.ReadString("RO Defaults", "ROPATH", ""); } if (RtnStr.Equals("")) // no ROPATH specified { @@ -2091,9 +2257,9 @@ namespace ROEditor // Instruct the user to create one. DialogResult AnswerYN; int idx = CurDir.LastIndexOf("\\"); - RtnStr = CurDir.Substring(0,idx+1) + "RO"; // default location + RtnStr = CurDir.Substring(0, idx + 1) + "RO"; // default location string msgstr = "A RO directory (folder) does not exist.\n\n Create a RO directory in the default location (" + RtnStr + ")?"; - AnswerYN = MessageBox.Show(msgstr,"RO Editor",MessageBoxButtons.YesNo); + AnswerYN = MessageBox.Show(msgstr, "RO Editor", MessageBoxButtons.YesNo); if (AnswerYN == DialogResult.Yes) { Directory.CreateDirectory(RtnStr); @@ -2114,7 +2280,7 @@ namespace ROEditor // using sql if there is a connection string or if defined in roapp.ini if (SqlConnectionStr != null && SqlConnectionStr != "") return true; bool Rtn = false; - + string ROiniPath = ROdir + "\\ROAPP.INI"; IniReader ini = new IniReader(ROiniPath); SqlConnectionStr = ini.ReadString("Database Server", "Path", ""); @@ -2136,10 +2302,9 @@ namespace ROEditor testParadoxFile += "\\"; testAccessFile += "\\"; } - + testParadoxFile += "ROMASTER.DB"; // Paradox file testAccessFile += "ROMaster.mdb"; // Access file -// if (File.Exists(testParadoxFile)) if (File.Exists(testParadoxFile) && !(File.Exists(testAccessFile) || UsingSQLServer(ROdir))) { // Display a message to the user that the data needs converted @@ -2152,15 +2317,15 @@ namespace ROEditor if (ROdir.Equals("")) argstr = Directory.GetCurrentDirectory(); string ConversionExePath = Application.StartupPath + "\\ParadoxConversion.exe "; - + // Need to move out of RO directory to convert it Directory.SetCurrentDirectory("..\\"); - + // create a process & wait until it exits. Process myProcess = new Process(); myProcess.StartInfo.FileName = ConversionExePath; myProcess.StartInfo.Arguments=argstr; - + myProcess.Start(); myProcess.WaitForExit(); @@ -2216,7 +2381,7 @@ namespace ROEditor if (ndkid is VlnXmlElement) { kid = (VlnXmlElement) ndkid; - if (kid.HasAttribute("RecID"))delkid = kid; + if (kid.HasAttribute("RecID")) delkid = kid; } ndkid = ndkid.NextSibling; if (delkid != null) curelem.RemoveChild(delkid); @@ -2236,7 +2401,7 @@ namespace ROEditor roListView_ClearListDisplay(); bool didcleanup=false; // flags whether we needed to remove elements from trees // to match xml data to tree. - VlnXmlElement curelem = (VlnXmlElement) roTreeView.SelectedNode.Tag; + VlnXmlElement curelem = (VlnXmlElement)roTreeView.SelectedNode.Tag; LoadKids(roTreeView.SelectedNode); if (curelem.Name == "vlnGroup") { @@ -2245,7 +2410,7 @@ namespace ROEditor // if the group text was modified, update the tree. If it was a subgroup, // tree nodes are deleted and reread in. - if (curelem.ParentNode != null && curelem.ParentNode.Name == "RO_Root") + if (curelem.ParentNode != null && curelem.ParentNode.Name == "RO_Root") roTreeView.SelectedNode.Text = CvtFldToUserFld(curelem.FirstChild.Value); // menu, field or accpageid changes may have had to load data which // makes the xmltree not be in sync with the tree control. if so clear it. @@ -2255,31 +2420,31 @@ namespace ROEditor CleanUpTree(curelem, roTreeView.SelectedNode); curelem.RemoveAttribute("TreeNotData"); } - VlnXmlElement topele = (VlnXmlElement) rootXml.FirstChild; + VlnXmlElement topele = (VlnXmlElement)rootXml.FirstChild; while (topele != null) { if (topele.HasAttribute("TreeNotData")) { topele.RemoveAttribute("TreeNotData"); int cnt = rootNode.GetNodeCount(false); - for(int i=0;i Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString()); // RO Editor add symbols C2022 - 003 TreeNewparent.Nodes.Add(newt); } } @@ -2722,12 +2873,14 @@ namespace ROEditor } else roTreeView.Refresh(); - - tbtnCancel.Enabled = true; - tbtnDuplicate.Enabled = true; - tbtnRestore.Enabled=false; - tbtnSave.Enabled = false; - tbtnSaveAs.Enabled = false; + + menuROSave.Enabled = false; + + rbtnCancel.Enabled = true; + rbtnDuplicate.Enabled = true; + rbtnRestore.Enabled = false; + rbtnSave.Enabled = false; + rbtnSaveAs.Enabled = false; menuROSave.Enabled = false; } @@ -2742,10 +2895,10 @@ namespace ROEditor success = ctlXMLEdit2.SaveData(); if (!success) { - tbtnRestore.Enabled = false; // old data may not be around + rbtnRestore.Enabled = false; // old data may not be around return; } - + string mnutmp; // set attributes for access id, retval (if RRO) and menu value for // rro and group. @@ -2757,7 +2910,7 @@ namespace ROEditor // check for duplicates on accessory page id, if it changed. acctmpl = newro.GetAccPageIDTemplate(); string newacc = newro.GetAccPageIDString(acctmpl); - + //isduplicateaccpageid needs no recid attribute for any new // ros (which is what we have hear for saveas or duplicate) newro.RemoveAttribute("RecID"); @@ -2767,7 +2920,7 @@ namespace ROEditor { MessageBox.Show("The fields used for the \"Accessory Pages Access\" values must be unique. The fields used in these values can be found under \"Properties\" of an RO Group. Cannot save.", "Problem saving data"); ctlXMLEdit2.SetNotSaved(); - tbtnRestore.Enabled = false; // can't restore data, may have saved + rbtnRestore.Enabled = false; // can't restore data, may have saved ctlXMLEdit2.RestoreInnerXml(savedInnerXML); //B2017-089 - restore the inner xml so orignial does not get new changes return; } @@ -2779,14 +2932,14 @@ namespace ROEditor dup = newro.IsDuplicateMenuTitle(mnutitle); if (dup==true) { - MessageBox.Show( "The fields used for the \"Menu\" values must be unique. The fields used in these values can be found under \"Properties\" of an RO Group. Cannot save.","Problem saving data"); + MessageBox.Show("The fields used for the \"Menu\" values must be unique. The fields used in these values can be found under \"Properties\" of an RO Group. Cannot save.","Problem saving data"); parent.RemoveChild(origro); - tbtnRestore.Enabled = false; + rbtnRestore.Enabled = false; ctlXMLEdit2.SetNotSaved(); ctlXMLEdit2.RestoreInnerXml(savedInnerXML); //B2017-089 - restore the inner xml so orignial does not get new changes return; } - if (acctmpl!=null)newro.SetAttribute("AccPageID", newro.GetAccPageIDString(acctmpl)); + if (acctmpl!=null)newro.SetAttribute("AccPageID", newro.GetAccPageIDString(acctmpl)); newro.SetAttribute("MenuTitle",mnutitle); newro.RemoveAttribute("RecID"); // get a new one. @@ -2802,27 +2955,30 @@ namespace ROEditor LastSelectedNode = newt; //do this so that no prompt for data save on node select newt.TreeView.SelectedNode = newt; roTreeView.Refresh(); - tbtnRestore.Enabled = false; - tbtnSave.Enabled = false; - tbtnCancel.Enabled = true; - tbtnSaveAs.Enabled = false; - tbtnDuplicate.Enabled = true; + + duplicate_active = false; + + rbtnRestore.Enabled = false; + rbtnSave.Enabled = false; + rbtnCancel.Enabled = true; + rbtnSaveAs.Enabled = false; + rbtnDuplicate.Enabled = true; duplicate_active = false; } else newro.SetAttribute("RecID", savrec); newone = null; - } + } private void tbar_DuplicateClick() { duplicate_active = true; // disable duplicate until save or saveas. - tbtnDuplicate.Enabled = false; + rbtnDuplicate.Enabled = false; } - protected void tbar_ZoomClick (object sender, System.EventArgs e) + protected void tbar_ZoomClick(object sender, System.EventArgs e) { ctlXMLEdit2.btnZoom_click(sender, e); @@ -2863,8 +3019,8 @@ namespace ROEditor break; } } - if (ele.Name != "vlnGroup" && attop==false) - EditRO(ele); + if (ele.Name != "vlnGroup" && attop==false) + EditRO(ele); } @@ -2885,7 +3041,7 @@ namespace ROEditor // Put out fields and their associated data. if (InUseList != null) { - for (int i=0; i< InUseList.Count; i++) + for (int i=0;i< InUseList.Count; i++) { rof = (ROField) InUseList[i]; if (rof.GetFieldname != null) @@ -2893,7 +3049,7 @@ namespace ROEditor uint ftype = rof.GetFieldType; if (ftype == (uint)ROFields.FieldTypes.SingleTxt || ftype == (uint)ROFields.FieldTypes.VariableTxt || ftype == (uint)ROFields.FieldTypes.FrmtSingleTxt || ftype == (uint)ROFields.FieldTypes.Combination) - roListView.Columns.Add(rof.GetFieldname, 100,HorizontalAlignment.Left); + roListView.Columns.Add(rof.GetFieldname, 100, HorizontalAlignment.Left); } } } @@ -2925,7 +3081,7 @@ namespace ROEditor AllGroups = false; ListViewItem item=null; bool first = true; - for (int i=0; i< InUseList.Count; i++) + for (int i = 0; i < InUseList.Count; i++) { rof = (ROField) InUseList[i]; if (rof.GetFieldname != null) @@ -2937,22 +3093,22 @@ namespace ROEditor string nm0 = rof.GetFieldname; nm = rof.MakeFieldName(nm0); nd = curele.SelectSingleNode(nm); - if (nd==null)nd = curele.SelectSingleNode("*/"+nm); - if (nd==null) - nd = curele.GetCurrentOfMultiFields(curele,nm); -// if (nd==null)nd = curele.SelectSingleNode(nm+"a"); -// if (nd==null)nd = curele.SelectSingleNode(nm+"b"); -// if (nd==null)nd = curele.SelectSingleNode(nm+"c"); -// if (nd==null)nd = curele.SelectSingleNode(nm+"d"); + if (nd == null) nd = curele.SelectSingleNode("*/" + nm); + if (nd == null) + nd = curele.GetCurrentOfMultiFields(curele, nm); // RO Editor add symbols C2022 - 003 + string data; - if(nd==null) - data=" "; + if (nd == null) + data = " "; else - data=nd.InnerText; - if(first==true) { - item = new ListViewItem(data,ROIMAGE); - first=false; + data = nd.InnerText; + data = Regex.Replace(data, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString()); // RO Editor add symbols C2022 - 003 + } + if (first == true) + { + item = new ListViewItem(data, ROIMAGE); + first = false; item.Tag = curele; } else @@ -2964,17 +3120,17 @@ namespace ROEditor } } } - curnd = curnd.NextSibling; + curnd = curnd.NextSibling; } if (AllGroups == true) { roListView.Columns.Clear(); roListView.Columns.Add("Group",250,HorizontalAlignment.Left); } - + roListView.Visible=true; } - + private void updateRoListView(TreeNode node) { VlnXmlElement selele; @@ -2984,9 +3140,9 @@ namespace ROEditor // if we already have a list view, and we're still under the same parent, // leave the list view, otherwise clear it. VlnXmlElement curele = null; - if (roListView != null && roListView.Items.Count > 0) + if (roListView != null && roListView.Items.Count > 0) { - curele = (VlnXmlElement) roListView.Items[0].Tag; + curele = (VlnXmlElement)roListView.Items[0].Tag; if (selele.ParentNode != curele.ParentNode)roListView_ClearListDisplay(); } return; @@ -3011,7 +3167,7 @@ namespace ROEditor this.roListView.ListViewItemSorter = LVCompare; roListView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.roListView_Column_Header_OnClick); } - + DisplayGroupElements(selele); } @@ -3025,49 +3181,254 @@ namespace ROEditor roListView.Sort(); } - private void roTreeView_AfterSelect_1(object sender, System.Windows.Forms.TreeViewEventArgs e) + public void getSymbols() // RO Editor add symbols C2022 - 003 { - + Dictionary ROSymbols = buildsymbols(); + + foreach (KeyValuePair ROSymbol in ROSymbols) + { + Bitmap symCharBtmp = createTextBitmap((char)ROSymbol.Key); + DevComponents.DotNetBar.ButtonItem btn = new DevComponents.DotNetBar.ButtonItem(); + btn.Image = symCharBtmp; + + btn.Text = string.Format("{0}", ROSymbol.Key); + + // to name button use unicode rather than desc, desc may have spaces or odd chars + btn.Name = "btn" + string.Format("{0}", ROSymbol.Key); + + btn.Tooltip = string.Format("{0}", ROSymbol.Value); + btn.Tag = string.Format(@"{0}", ROSymbol.Key); + btn.FontBold = true; + btn.Click += new System.EventHandler(rbtnSymbols_Click); + galleryContainerSymbols.SubItems.Add(btn); + } + } - } - - // This class is used to sort by the selected list view column - public class MyListViewComparer : IComparer - { - int column; - - public int Compare (object x, object y) + private Dictionary buildsymbols() // RO Editor add symbols C2022 - 003 { - ListViewItem xitm = (ListViewItem) x; - ListViewItem yitm = (ListViewItem) y; + Dictionary symbols1 = new Dictionary() + { + {176,"degree" }, + {8805,"greater than or equal" }, + {8804,"less than or equal" }, + {177,"plus minus" }, + {189,"half" }, + {9604,"accum" }, + {9679,"bullet" }, + {8776,"approx eq" }, + {8773,"similar eq" }, + {8800,"Not Equal To" }, + {247,"division" }, + {8730,"square root" }, + {8733,"Proportional To" }, + {8734,"Infinity" }, + {8486,"Ohm Sign" }, + {188,"quarter" }, + {8539,"one eighth" }, + {216,"dist zero" }, + {274,"energy" }, + {236,"grave" }, + {9474,"bar" }, + {8857,"dot in oval" }, + {9830,"diamond" }, + {8594,"right arrow" }, + {8592,"left arrow" }, + {8593,"up arrow" }, + {8595,"down arrow" }, + {8711,"nabla" }, + {913,"ALPHA" }, + {914,"BETA" }, + {915,"GAMMA" }, + {916,"DELTA" }, + {917,"EPSILON" }, + {918,"ZETA" }, + {919,"ETA" }, + {920,"THETA" }, + {921,"IOTA" }, + {922,"KAPPA" }, + {923,"LAMDA" }, + {924,"MU" }, + {925,"NU" }, + {926,"XI" }, + {927,"OMICRON" }, + {928,"PI" }, + {929,"RHO" }, + {931,"SIGMA" }, + {932,"TAU" }, + {933,"UPSILON" }, + {934,"PHI" }, + {935,"CHI" }, + {936,"PSI" }, + {937,"OMEGA" }, + {945,"alpha" }, + {946,"beta" }, + {947,"gamma" }, + {948,"delta" }, + {949,"epsilon" }, + {950,"zeta" }, + {951,"eta" }, + {952,"theta" }, + {953,"iota" }, + {954,"kappa" }, + {955,"lamda" }, + {956,"mu" }, + {957,"nu" }, + {958,"xi" }, + {959,"omicron" }, + {960,"pi" }, + {961,"rho" }, + {963,"sigma" }, + {964,"tau" }, + {965,"upsilon" }, + {966,"phi" }, + {967,"chi" }, + {968,"psi" }, + {969,"omega" }, + {9650,"Solid Up Triangle" }, + {9660,"Solid Down Triangle" }, + {9654,"Solid Right Triangle" }, + {9664,"Solid Left Triangle" }, + {169,"Copyright Sign" }, + {174,"Registered Sign" }, + {8480,"Service Mark" }, + {8482,"Trade Mark" }, + {167,"Section Sign" }, + {9745,"Box with Check" }, + {9746,"Box with X" }, + {9633,"Blank Checkbox" }, + {9774,"Clock" }, + {8643,"Check Mark" }, + {9747,"Heavy X" }, + {8629,"Corner Arrow Down Left" }, + {9678,"Circle Zero" }, + {9312,"Circle One" }, + {9313,"Circle Two" }, + {9314,"Circle Three" }, + {9315,"Circle Four" }, + {9316,"Circle Five" }, + {9317,"Circle Six" }, + {9318,"Circle Seven" }, + {9319,"Circle Eight" }, + {9320,"Circle Nine" }, + {9321,"Circle Ten" }, + {9655,"Triangle Right" }, + {9665,"Triangle Left" }, + {8856,"Universal No" }, + }; + return symbols1; + } - string xbuff = xitm.SubItems[column].Text; - string ybuff = yitm.SubItems[column].Text; - int rtnval = 0; - int xcnt=0,ycnt=0; - int xlen,ylen; - byte xbyte, ybyte; - xlen = xbuff.Length; - ylen = ybuff.Length; - if (xbuff.Length > 0 && xbuff[0] == '<') - rtnval = 0; - if (ybuff.Length > 0 && ybuff[0] == '<') - rtnval = 0; - while ((rtnval==0) && ((xcnt < xlen) || (ycnt < ylen))) + private Bitmap createTextBitmap(char ch) + { + string txt = string.Format("{0}", ch); + Bitmap objBmpImage = new Bitmap(1, 1); + + int intWidth = 0; + int intHeight = 0; + + // Create the Font object for the image text drawing. + // later on, we could add logic to use either FreeMono or Arial Unicode MS based on the format being used + // but for now, we are going to use FreeMono to create the symbol list + Font objFont = new Font("FreeMono", 18, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); + + // Create a graphics object to measure the text's width and height. + Graphics objGraphics = Graphics.FromImage(objBmpImage); + + // This is where the bitmap size is determined. + intWidth = (int)objGraphics.MeasureString(txt, objFont).Width; + intHeight = (int)objGraphics.MeasureString(txt, objFont).Height; + + // Create the bmpImage again with the correct size for the text and font. + objBmpImage = new Bitmap(objBmpImage, new Size(intWidth, intHeight)); + + // Add the colors to the new bitmap. + objGraphics = Graphics.FromImage(objBmpImage); + + // Set Background color + objGraphics.Clear(Color.Transparent); //.White); + objGraphics.SmoothingMode = SmoothingMode.AntiAlias; + objGraphics.TextContrast = 0; + objGraphics.TextRenderingHint = TextRenderingHint.AntiAlias; + objGraphics.DrawString(txt, objFont, new SolidBrush(Color.Black), 0, 0); + objGraphics.Flush(); + return (objBmpImage); + } + + // This class is used to sort by the selected list view column + public class MyListViewComparer : IComparer + { + int column; + + public int Compare(object x, object y) { - xbyte = (xcnt == xlen)? (byte)0 : (byte)xbuff[xcnt++]; - ybyte = (ycnt == ylen)? (byte)0 : (byte)ybuff[ycnt++]; - rtnval = xbyte - ybyte; + ListViewItem xitm = (ListViewItem)x; + ListViewItem yitm = (ListViewItem)y; + + string xbuff = xitm.SubItems[column].Text; + string ybuff = yitm.SubItems[column].Text; + int rtnval = 0; + int xcnt = 0, ycnt = 0; + int xlen, ylen; + byte xbyte, ybyte; + xlen = xbuff.Length; + ylen = ybuff.Length; + if (xbuff.Length > 0 && xbuff[0] == '<') + rtnval = 0; + if (ybuff.Length > 0 && ybuff[0] == '<') + rtnval = 0; + while ((rtnval == 0) && ((xcnt < xlen) || (ycnt < ylen))) + { + xbyte = (xcnt == xlen) ? (byte)0 : (byte)xbuff[xcnt++]; + ybyte = (ycnt == ylen) ? (byte)0 : (byte)ybuff[ycnt++]; + rtnval = xbyte - ybyte; + } + + return rtnval; } - - return rtnval; + + public void SetColumnToSortBy(int col) + { + column = col; + } + } - public void SetColumnToSortBy(int col) + private void rbtnSave_Click(object sender, EventArgs e) // RO Editor add symbols C2022 - 003 { - column = col; + tbar_SaveClick(); } - + + private void rbtnCancel_Click(object sender, EventArgs e) + { + rbtnSymbols.Enabled = false; + tbar_CancelClick(); + } + + private void rbtnSaveAs_Click(object sender, EventArgs e) + { + tbar_SaveAsClick(); + } + + private void rbtnDuplicate_Click(object sender, EventArgs e) + { + tbar_DuplicateClick(); + } + + private void rbtnRestore_Click(object sender, EventArgs e) + { + tbar_RestoreClick(); + } + + private void rbtnZoom_Click(object sender, EventArgs e) + { + ctlXMLEdit2.btnZoom_click(null, null); + } + + private void rbtnSymbols_Click(object sender, EventArgs e) // RO Editor add symbols C2022 - 003 + { + DevComponents.DotNetBar.ButtonItem b = (DevComponents.DotNetBar.ButtonItem)sender; + ctlXMLEdit2.TextBoxFocus.InsertSymbol(Convert.ToInt32(b.Tag)); + } + } - } diff --git a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.csproj b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.csproj index 37501190..3c06601e 100644 --- a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.csproj +++ b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.csproj @@ -109,6 +109,10 @@ false + + False + ..\..\..\..\..\..\..\3rdPartyLibraries\DotNetBar\DotNetBar4.6Build\DevComponents.DotNetBar2.dll + System @@ -124,10 +128,6 @@ System.XML - - False - ..\..\..\..\Volian.Base.Library\bin\Debug\Volian.Base.Library.dll - @@ -168,6 +168,7 @@ Code + Designer AboutROEditor.cs diff --git a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.resx b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.resx index 5c3b99ac..3c09032b 100644 --- a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.resx +++ b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.resx @@ -125,7 +125,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACE - CAAAAk1TRnQBSQFMAgEBAgEAASwBAAEsAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CAAAAk1TRnQBSQFMAgEBAgEAAUQBAAFEAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -175,7 +175,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAe - CwAAAk1TRnQBSQFMAgEBBgEAASwBAAEsAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CwAAAk1TRnQBSQFMAgEBBgEAAUQBAAFEAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA diff --git a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/RO_FST.cs b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/RO_FST.cs index 0a2451f9..44283442 100644 --- a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/RO_FST.cs +++ b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/RO_FST.cs @@ -101,7 +101,6 @@ using System.Runtime.InteropServices; using VlnStatus; using System.Collections.Specialized; using ROFST_FILE; -using Volian.Base.Library; //using VlnProfiler; //don't forget to add VlnProfiler to the reference list @@ -885,3 +884,4 @@ namespace ROEditor } } + diff --git a/PROMS/ReferencedObjects/LibSource/RODBInterface/RODBInterface.cs b/PROMS/ReferencedObjects/LibSource/RODBInterface/RODBInterface.cs index e90ede1e..d4f5b170 100644 --- a/PROMS/ReferencedObjects/LibSource/RODBInterface/RODBInterface.cs +++ b/PROMS/ReferencedObjects/LibSource/RODBInterface/RODBInterface.cs @@ -263,6 +263,7 @@ using System.Collections.Specialized; using Org.Mentalis.Files; using System.Data.SqlClient; using System.Collections.Generic; +using System.Text.RegularExpressions; namespace RODBInterface @@ -1909,6 +1910,8 @@ namespace RODBInterface string Info = DBE.GetString(3); //B2022-043 &pos; was missing the ; Info = Info.Replace("'", "\'"); // B2021-071: crash when getting/saving field names + Info = Regex.Replace(Info, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString()); // RO Editor add symbols C2022 - 003 + node.SetAttribute("HasChild", "True"); // Store data in the VlnXmlElement as a subgroup @@ -2139,7 +2142,20 @@ namespace RODBInterface wraccid = accid; string dt = string.Format("{0:yyyyMMddHHmmss}", System.DateTime.Now); string xmlstr = GenerateXmlString(ro, false); - string strUpdate = "UPDATE " + ro.GetAttribute("Table") + " SET Info = '" + xmlstr + "'"; + StringBuilder xmlstrTmp = new StringBuilder(); // B2026-025 prep the info field data so it will be saved correctly. + char[] chrAry = xmlstr.ToCharArray(); + foreach (int chr in chrAry) + { + if (chr > 166) + { + xmlstrTmp.Append($"\\u{(int)chr}?"); + } + else + { + xmlstrTmp.Append((char)chr); + } + } + string strUpdate = "UPDATE " + ro.GetAttribute("Table") + " SET Info = '" + xmlstrTmp.ToString() + "'"; if (movedRO) { VlnXmlElement parent = (VlnXmlElement)ro.ParentNode; @@ -2182,10 +2198,27 @@ namespace RODBInterface parent.SetAttribute("ChildLoaded", "True"); } string xmlstr = GenerateXmlString(ro, false); + + StringBuilder xmlstrTmp = new StringBuilder(); // B2026-025 prep the info field data so it will be saved correctly. + char[] chrAry = xmlstr.ToCharArray(); + foreach (int chr in chrAry) + { + if (chr > 166) + { + xmlstrTmp.Append($"\\u{(int)chr}?"); + } + else + { + xmlstrTmp.Append((char)chr); + } + } + string wraccid = null; if (ro.HasAttribute("AccPageID")) { string accid = ro.GetAttribute("AccPageID"); + + int quote = accid.IndexOf("'"); if (quote >= 0) wraccid = accid.Insert(quote, "'"); @@ -2203,13 +2236,13 @@ namespace RODBInterface // strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, AccPageID, ModDateTime, Info ) "; strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, ModDateTime, AccPageID, Info ) "; strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint)RecordType.Group + ",'" + ro.GetAttribute("ParentID"); - strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstr + "');"; + strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstrTmp.ToString() + "');"; } else { strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, ModDateTime, Info ) "; strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint)RecordType.Group + ",'" + ro.GetAttribute("ParentID"); - strInsert = strInsert + "','" + dt + "','" + xmlstr + "');"; + strInsert = strInsert + "','" + dt + "','" + xmlstrTmp.ToString() + "');"; } } @@ -2217,7 +2250,7 @@ namespace RODBInterface { strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, AccPageId, ModDateTime, Info ) "; strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint)RecordType.RRO + ",'" + ro.GetAttribute("ParentID"); - strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstr + "');"; + strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstrTmp.ToString() + "');"; } try @@ -2251,7 +2284,7 @@ namespace RODBInterface // select all of the field definition records in this table. // strGetFields = "SELECT RecID, Info from " + elem.GetAttribute("Table"); strGetFields = "SELECT RecID, Info from " + TableName; - strGetFields = strGetFields + " where RecType = 2"; // + rtype.ToString(); + strGetFields = strGetFields + " where RecType = 2"; DBE.Command(strGetFields); DBE.Reader(); @@ -2625,7 +2658,20 @@ namespace RODBInterface } } StatMsgWindow.StatusMessage = echild.GetAttribute("MenuTitle"); - str = "UPDATE " + echild.GetAttribute("Table") + " SET Info = '" + tinfo2 + "'"; + StringBuilder tinfo2Tmp = new StringBuilder(); // B2026-025 prep the info field data so it will be saved correctly. + char[] chrAry = tinfo2.ToCharArray(); + foreach (int chr in chrAry) + { + if (chr > 166) + { + tinfo2Tmp.Append($"\\u{(int)chr}?"); + } + else + { + tinfo2Tmp.Append((char)chr); + } + } + str = "UPDATE " + echild.GetAttribute("Table") + " SET Info = '" + tinfo2Tmp.ToString() + "'"; str = str + ", ModDateTime = '" + dt + "' WHERE RecID = '" + echild.GetAttribute("RecID") + "';"; DBE.Command(str); DBE.Reader(); diff --git a/PROMS/ReferencedObjects/LibSource/RODBInterface/VlnXml.cs b/PROMS/ReferencedObjects/LibSource/RODBInterface/VlnXml.cs index eb5f1c20..6a0c10db 100644 --- a/PROMS/ReferencedObjects/LibSource/RODBInterface/VlnXml.cs +++ b/PROMS/ReferencedObjects/LibSource/RODBInterface/VlnXml.cs @@ -96,6 +96,7 @@ using System.IO; using System.Windows.Forms; using ROFields; using VlnStatus; +using System.Text.RegularExpressions; //using VlnProfiler; //don't forget to add VlnProfiler to the reference list namespace RODBInterface @@ -517,7 +518,8 @@ namespace RODBInterface strtmp.Append(" "); cnt++; } - if ((cnt + text.Length) > frmt2) // longer than the field length? + text = Regex.Replace(text, @"\\u([0-9]{1,4})\?", m => int.TryParse(m?.Groups[1]?.Value, out int result) ? Convert.ToChar(result).ToString() : ""); //B2026-025 Unicode removed from RO menu titles in treeview. + if ((cnt + text.Length) > frmt2) // longer than the field length? strtmp.Append(text.Substring(0,frmt2-cnt)); else strtmp.Append(text); diff --git a/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/ZoomDialog.cs b/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/ZoomDialog.cs index c2f238c7..85d8bccb 100644 --- a/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/ZoomDialog.cs +++ b/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/ZoomDialog.cs @@ -39,7 +39,7 @@ namespace ctlXMLEditLib { private System.Windows.Forms.Button btnSave; private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.TextBox tbZoom; + private ctlXMLEditLib.roRichTextBox tbZoom; // RO Editor add symbols C2022 - 003 /// /// Required designer variable. /// @@ -88,7 +88,7 @@ namespace ctlXMLEditLib /// private void InitializeComponent() { - this.tbZoom = new System.Windows.Forms.TextBox(); + this.tbZoom = new ctlXMLEditLib.roRichTextBox(); // RO Editor add symbols C2022 - 003 this.btnSave = new System.Windows.Forms.Button(); this.btnCancel = new System.Windows.Forms.Button(); this.SuspendLayout(); @@ -99,7 +99,7 @@ namespace ctlXMLEditLib this.tbZoom.Location = new System.Drawing.Point(24, 16); this.tbZoom.Multiline = true; this.tbZoom.Name = "tbZoom"; - this.tbZoom.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; + this.tbZoom.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical; // RO Editor add symbols C2022 - 003 this.tbZoom.Size = new System.Drawing.Size(576, 392); this.tbZoom.TabIndex = 0; // @@ -149,3 +149,4 @@ namespace ctlXMLEditLib } } + diff --git a/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/ctlXMLEdit.cs b/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/ctlXMLEdit.cs index e181526c..95beb6ce 100644 --- a/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/ctlXMLEdit.cs +++ b/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/ctlXMLEdit.cs @@ -200,7 +200,11 @@ using System.Xml.Schema; using System.Text; using RODBInterface; using Org.Mentalis.Files; -//using IniFileIO; +using System.Windows; +using System.Text.RegularExpressions; +using System.Linq; +using Volian.Base.Library; + @@ -221,6 +225,7 @@ namespace ctlXMLEditLib /// /// /// + public class ctlXMLEdit : System.Windows.Forms.UserControl { /// @@ -237,12 +242,12 @@ namespace ctlXMLEditLib private bool dosaveflag; private VlnXmlElement editelem; private XmlDocument editdoc; - private TextBox zoomtextbox; + private roRichTextBox zoomtextbox; // the following is used for handling images. Note that if we want to have more // than one image defined in an ro, this should be become a list. - private TextBox GraphicsFiletextbox; - private TextBox GraphicsWdtextbox; - private TextBox GraphicsHttextbox; + private roRichTextBox GraphicsFiletextbox; + private roRichTextBox GraphicsWdtextbox; + private roRichTextBox GraphicsHttextbox; private System.Windows.Forms.Button btnFindFile; private string GraphicsText; private ToolTip zmtooltip; @@ -265,6 +270,19 @@ namespace ctlXMLEditLib private GroupBox pcGrpBox = null; /** end C2021-026 **/ + public string _RO_IDEN; + public string RO_IDEN + { + get + { + return _RO_IDEN; + } + set + { + _RO_IDEN = value; + } + } + // use this struct to define attributes for the text box fields, storing // the pattern, radio button association, required field flag, etc. struct TextBoxAttrTag @@ -311,10 +329,19 @@ namespace ctlXMLEditLib public string GetParentHTId { get { return parenthtid; } } public void SetParentHTId(string id) { this.parenthtid = id; } } - + private roRichTextBox _TextBoxFocus; // RO Editor add symbols C2022 - 003 + public roRichTextBox TextBoxFocus + { + get { return _TextBoxFocus; } + set + { + _TextBoxFocus = value; + } + } public ctlXMLEdit(VlnXmlElement myelem, XmlSchema myschema, ArrayList reqfields, ArrayList fldsWithApplic, string [] pckids) { // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); FieldsWithApplic = fldsWithApplic; PCChildren = pckids; //C2021-026 list of Parent/Child children @@ -359,11 +386,12 @@ namespace ctlXMLEditLib // Set required fields based on list. (can add message later). SetRequiredFields(reqfields); dosaveflag=true; + RO_IDEN = myelem.GetAccPageIDTemplate(); } // set the required fields tag on those fields which are included in the passed // in required fields list. - private void DoSet(TextBox hwnd, string msg) + private void DoSet(roRichTextBox hwnd, string msg) // RO Editor add symbols C2022 - 003 { if (hwnd == null) return; if (hwnd.Tag != null) @@ -378,7 +406,7 @@ namespace ctlXMLEditLib private void SetRequiredFields(ArrayList reqfields) { Object o; - TextBox hwnd; + roRichTextBox hwnd; string field, msg; int indx; foreach (string strfld in reqfields) @@ -397,15 +425,15 @@ namespace ctlXMLEditLib o = myHT[field+"a"]; if (o != null) // set all combo types required, the checker { - DoSet((TextBox)o,msg); - DoSet((TextBox)myHT[field+"b"],msg); - DoSet((TextBox)myHT[field+"c"],msg); - DoSet((TextBox)myHT[field+"d"],msg); + DoSet((roRichTextBox)o,msg); + DoSet((roRichTextBox)myHT[field+"b"],msg); + DoSet((roRichTextBox)myHT[field+"c"],msg); + DoSet((roRichTextBox)myHT[field+"d"],msg); } } else if (o != null) { - hwnd = (TextBox) o; + hwnd = (roRichTextBox) o; if (hwnd.Tag != null) { TextBoxAttrTag tag = (TextBoxAttrTag) hwnd.Tag; @@ -419,7 +447,7 @@ namespace ctlXMLEditLib // C2021-026 If this is a Parent/Child field that has no value saved in the database // then use the parent's value and display it as grey colored text. - private void GetDefaultParentValue(TextBox tb, XmlNode node, string chldName) + private void GetDefaultParentValue(roRichTextBox tb, XmlNode node, string chldName) { XmlNode parentNode = null; // PCChildren contains a list strings reprenting the Children setup in the current Working Draft Parent/Child property @@ -463,21 +491,23 @@ namespace ctlXMLEditLib private void DisplayFieldContents(XmlNode node) { Object o; - TextBox hwnd; + roRichTextBox hwnd; XmlNode nd; // if we have an image, check it for validity, i.e. file exists, etc.?? foreach (string str in myHT.Keys) { o = myHT[str]; - hwnd = (TextBox) o; + hwnd = (roRichTextBox) o; nd = node.SelectSingleNode(str); // if not found with just the string, search the tree. if (nd==null)nd = node.SelectSingleNode("*/"+str); if (nd == null || nd.InnerText.Length==0) // B2024-004 use Parent value if Child text length is zero GetDefaultParentValue(hwnd, node, str); // C2021-026 Parent/Child Field has no value so use parent's value else - { - hwnd.Text = nd.InnerText; // set the field's text from XML + { + + hwnd.Text = Regex.Replace(nd.InnerText, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString()); // set the field's text from XML + Size size = hwnd.Size; // check if this window has a button name as part of its tag. If // so it's a combo type & the radio button/visibility may need to @@ -546,7 +576,7 @@ namespace ctlXMLEditLib // height/width data of the image. if (GraphicsFiletextbox != null && GraphicsFiletextbox.Text != "") UpdateHtWd(); } - public TextBox GetGraphicsFiletextbox() + public roRichTextBox GetGraphicsFiletextbox() { return GraphicsFiletextbox; } @@ -585,13 +615,13 @@ namespace ctlXMLEditLib { dosaveflag=false; mysavexml=false; - TextBox hwnd; + roRichTextBox hwnd; // first, clear out all of the text boxes. foreach (string str in myHT.Keys) { object o = myHT[str]; - hwnd = (TextBox) o; + hwnd = (roRichTextBox) o; hwnd.Text = ""; TextBoxAttrTag tag = (TextBoxAttrTag) hwnd.Tag; RadioButton radio; @@ -623,7 +653,7 @@ namespace ctlXMLEditLib // to the parent's value, then clear the child's textbox so that nothing is saved // to the database. This allow us to know that a specific value was not set // for this Parent/Child child - private void RemovePCChildTextIfSameAsParent(XmlNode node, TextBox tb, string chldName) + private void RemovePCChildTextIfSameAsParent(XmlNode node, roRichTextBox tb, string chldName) { XmlNode parentNode = null; // if this is a child node get the parent's value @@ -660,18 +690,35 @@ namespace ctlXMLEditLib // true if success, false if fail. // Note that the Parent and Child XML node variables below are not coding for Parent/Child Applicabily Fields public bool SaveData() + { if (mysavexml) { - TextBox hwnd; + roRichTextBox hwnd; TextBoxAttrTag tag; string imgdate; //go thru the hash table to get textboxes. Find the ones that have text. - foreach (string str in myHT.Keys) + foreach (string str in myHT.Keys) // RO Editor add symbols C2022 - 003 { object o = myHT[str]; - hwnd = (TextBox) o; + hwnd = (roRichTextBox) o; + + StringBuilder result1 = new StringBuilder(); + char[] chrAry = hwnd.Text.ToCharArray(); + foreach (int chr in chrAry) + { + if (chr > 166) + { + result1.Append($"\\u{(int)chr}?"); + } + else + { + result1.Append((char)chr); + } + } + hwnd.Text = result1.ToString(); + imgdate = null; // if this is a required field and there is no text, put out an error // message and get out of here. @@ -788,6 +835,7 @@ namespace ctlXMLEditLib return (false); } + #region Component Designer generated code /// /// Required method for Designer support - do not modify @@ -858,7 +906,7 @@ namespace ctlXMLEditLib // 'normalizedString') or a multiline text box(type is 'string'). Also, a radio // button is passed in if this was called to handle an element within a combo type. // This button is saved for a given text box so that initialization of these combo types can occur. - private string DisplayXmlSchemaSimpleType(XmlSchemaSimpleType simpleType, TextBox mytextbox, RadioButton radio, + private string DisplayXmlSchemaSimpleType(XmlSchemaSimpleType simpleType, roRichTextBox mytextbox, RadioButton radio, bool img, string imgname) { // set up for text box tag, which stores whether field is required and @@ -888,12 +936,17 @@ namespace ctlXMLEditLib if (getannot.IndexOf("Lines")>=0) { GraphicsHttextbox = mytextbox; + + Size size = GraphicsHttextbox.Size; mytextbox.LostFocus += new System.EventHandler(this.GraphicsHt_lostfocus); + } if (getannot.IndexOf("Character")>=0) { GraphicsWdtextbox = mytextbox; + mytextbox.LostFocus += new System.EventHandler(this.GraphicsWd_lostfocus); + } } } @@ -904,14 +957,17 @@ namespace ctlXMLEditLib { // A Schema Type Restriction is used to define single or multi-line boxes. XmlSchemaSimpleTypeRestriction myRestrictions = (XmlSchemaSimpleTypeRestriction) simpleType.Content; - if (myRestrictions.BaseTypeName.Name == "normalizedString") + if (myRestrictions.BaseTypeName.Name == "normalizedString") + { mytextbox.Multiline = false; + mytextbox.Size = new Size(300, 40); + } else { mytextbox.Multiline = true; - mytextbox.AcceptsReturn = true; + mytextbox.AcceptsTab = true; mytextbox.Height = (int) mytextbox.Font.GetHeight() * 4; - mytextbox.ScrollBars = ScrollBars.Vertical; + mytextbox.ScrollBars = RichTextBoxScrollBars.Vertical; zmtooltip.SetToolTip(mytextbox, "Press Shift F2 To Zoom"); } @@ -992,7 +1048,8 @@ namespace ctlXMLEditLib radio.CheckedChanged += new System.EventHandler(this.radiocheckchg); gbox.Controls.Add(radio); - TextBox tb = new TextBox(); + roRichTextBox tb = new roRichTextBox(); + Size size3 = tb.Size; tb.Location = new Point(boxx+20, y+25); if (!first) tb.Visible = false; myHT.Add(element.Name,tb); @@ -1001,7 +1058,7 @@ namespace ctlXMLEditLib // the groupbox. Controls.Add(tb); tb.TextChanged += new System.EventHandler(this.textbox_change); - tb.GotFocus += new System.EventHandler(this.textbox_zoombtn); + tb.GotFocus += new System.EventHandler(this.currentTextBox); tb.KeyDown += new KeyEventHandler(MyOnKeyDown); gbox.Contains(tb); // the following will set attributes on the text boxes such as maxlength, multiline, etc. @@ -1144,8 +1201,9 @@ namespace ctlXMLEditLib } else { - TextBox mytextbox; - mytextbox = new TextBox(); + roRichTextBox mytextbox; + mytextbox = new roRichTextBox(); + Size size3 = mytextbox.Size; mytextbox.Location = new Point(screenx+indent, screeny); string tFieldName = (pcChildIdx == 0) ? CvtUserFldToFld(element.Name) : CvtUserFldToFld(pcChildFldName); mytextbox.Name = tFieldName; @@ -1155,7 +1213,7 @@ namespace ctlXMLEditLib screeny = screeny + 10; mytextbox.TextChanged += new System.EventHandler(this.textbox_change); mytextbox.Validating += new System.ComponentModel.CancelEventHandler(this.textbox_Validating); - mytextbox.GotFocus += new System.EventHandler(this.textbox_zoombtn); + mytextbox.GotFocus += new System.EventHandler(this.currentTextBox); mytextbox.KeyDown += new KeyEventHandler(MyOnKeyDown); if (pcChildIdx > 0) { @@ -1192,9 +1250,18 @@ namespace ctlXMLEditLib // the following is needed to load the control. private void ctlXMLEdit_Load(object sender, System.EventArgs e) { - + } - + + + public delegate void ctlXMLEditEvent(object sender, ctlXMLEditEventArgs args); // RO Editor add symbols C2022 - 003 for turning off symbols btn for RO ID field. + public event ctlXMLEditEvent EnableDisableSymbolsBtn; + private void OnEnableDisableSymbolsBtn(ctlXMLEditEventArgs args) + { + if (EnableDisableSymbolsBtn != null) + EnableDisableSymbolsBtn(this, args); + } + // when data in a text box has changed, flag it (except for when this // happens during loading of original data). This flag will be used // later to know whether to save data. @@ -1210,7 +1277,7 @@ namespace ctlXMLEditLib // When leaving the textbox private void txtBox_Leave(object sender, EventArgs e) { - TextBox tb = sender as TextBox; + roRichTextBox tb = sender as roRichTextBox; string dfTxt = ""; try { @@ -1219,7 +1286,7 @@ namespace ctlXMLEditLib { object o = myHT[parentid]; if (o != null) - dfTxt = (o as TextBox).Text; // set to use the parent's value (default) + dfTxt = (o as roRichTextBox).Text; // set to use the parent's value (default) } else { @@ -1227,7 +1294,7 @@ namespace ctlXMLEditLib string parName = pcGrpBox.Name.Substring(5); object o = myHT[parName]; if (o != null) - dfTxt = (o as TextBox).Text; // set to use the parent's value (default) + dfTxt = (o as roRichTextBox).Text; // set to use the parent's value (default) } } catch @@ -1235,7 +1302,7 @@ namespace ctlXMLEditLib string parName = pcGrpBox.Name.Substring(5); object o = myHT[parName]; if (o != null) - dfTxt = (o as TextBox).Text; // set to use the parent's value (default) + dfTxt = (o as roRichTextBox).Text; // set to use the parent's value (default) } if (dosaveflag) mysavexml = true; @@ -1251,7 +1318,7 @@ namespace ctlXMLEditLib // so clear the textbox so that user can enter the value for that child private void txtBox_Enter(object sender, EventArgs e) { - TextBox tb = sender as TextBox; + roRichTextBox tb = sender as roRichTextBox; if (tb.ForeColor == SystemColors.GrayText) // currently no value set - using parent's value { tb.Text = ""; @@ -1264,7 +1331,7 @@ namespace ctlXMLEditLib private void radiocheckchg(object sender, System.EventArgs e) { RadioButton btnsel = (RadioButton) sender; - TextBox assocbox; + roRichTextBox assocbox; string btntext, str; if(dosaveflag)mysavexml = true; @@ -1277,7 +1344,7 @@ namespace ctlXMLEditLib str = btnsel.Name.Replace(btntext,""); object o = myHT[str]; if (o == null) return; - assocbox = (TextBox) o; + assocbox = (roRichTextBox) o; // make the text box visible if checked, otherwise, invisible assocbox.Visible = btnsel.Checked; // C2021-026 show or hide the Parent/Child appicability group box @@ -1299,7 +1366,7 @@ namespace ctlXMLEditLib c.Visible = vsblState; // show or hide the lable inside the group box object oo = myHT[c.Name]; if (oo != null) - (oo as TextBox).Visible = vsblState; // show or hide the associated text box + (oo as roRichTextBox).Visible = vsblState; // show or hide the associated text box } } } @@ -1391,7 +1458,7 @@ namespace ctlXMLEditLib // The following can be used to validate the text, i.e. check the text against // the pattern. this needs written yet (5/16/02) - private void MyValidatingCode(TextBox tb) + private void MyValidatingCode(roRichTextBox tb) { //get the text box's tag which contains a flag for whether this is required & //if it has a pattern. If it has a pattern, validate the field against the pattern. @@ -1420,20 +1487,33 @@ namespace ctlXMLEditLib } // save which box we're on, for zoom processing. - private void textbox_zoombtn(object sender, System.EventArgs e) + private void currentTextBox(object sender, System.EventArgs e) { - TextBox textbox = (TextBox) sender; + roRichTextBox textbox = (roRichTextBox) sender; if (textbox.Multiline == true || textbox == GraphicsFiletextbox) zoomtextbox = textbox; else zoomtextbox = null; + + TextBoxFocus = textbox; + + string RO_IDENDITY = RO_IDEN.Substring(1, RO_IDEN.Length - 2); // RO Editor add symbols C2022 - 003 for turning off symbols btn for RO ID. + if (textbox.Name == RO_IDENDITY) + { + OnEnableDisableSymbolsBtn(new ctlXMLEditEventArgs(DisplaySymBolBtn:false)); + } + else + { + OnEnableDisableSymbolsBtn(new ctlXMLEditEventArgs(DisplaySymBolBtn:true)); + } + } private void textbox_Validating(object sender, System.ComponentModel.CancelEventArgs e) { try { - MyValidatingCode((TextBox) sender); + MyValidatingCode((roRichTextBox) sender); } catch(Exception ex) @@ -1459,11 +1539,18 @@ namespace ctlXMLEditLib } btnZoom_click(null, null); } + if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) + { + if (((kea.Modifiers & Keys.ControlKey) == Keys.ControlKey) && kea.KeyCode == Keys.V) + { + roRichTextBox o = (roRichTextBox)objSender; + o.rchtxtBox_KeyDown(objSender, RO_IDEN); + } + } } - + public void btnZoom_click(object sender, System.EventArgs e) { - //TextBox tb = (TextBox) sender; TextBoxAttrTag tag; bool doimage = false; if (zoomtextbox.Tag != null) @@ -1507,7 +1594,7 @@ namespace ctlXMLEditLib // file local & keep width/height of file proportional. private void GraphicText_lostfocus(object sender, System.EventArgs e) { - TextBox fnamebox = (TextBox) sender; + roRichTextBox fnamebox = (roRichTextBox) sender; if (fnamebox.Text != "" && fnamebox.Modified == true) { FileInfo ifi = new FileInfo(fnamebox.Text); @@ -1716,7 +1803,7 @@ namespace ctlXMLEditLib // if changed height, calculate associated width private void GraphicsHt_lostfocus(object sender, System.EventArgs e) { - TextBox ht = (TextBox) sender; + roRichTextBox ht = (roRichTextBox) sender; if (ht.Modified == true) { try @@ -1733,7 +1820,7 @@ namespace ctlXMLEditLib // if changed width, calculate associated height private void GraphicsWd_lostfocus(object sender, System.EventArgs e) { - TextBox wd = (TextBox) sender; + roRichTextBox wd = (roRichTextBox) sender; if (wd.Modified == true) { try @@ -1888,7 +1975,7 @@ namespace ctlXMLEditLib * and overload a couple of it's functions in order to use it. * - called in CalculatePromsDate() above. */ - public class ThisTimeZone : TimeZone + public class ThisTimeZone : TimeZone { private TimeZone curTZ; public TimeSpan SpanTZ; @@ -1929,5 +2016,31 @@ namespace ctlXMLEditLib return curTZ.GetDaylightChanges(year); } } + + public class ctlXMLEditEventArgs : EventArgs // RO Editor add symbols C2022 - 003 for turning off symbols btn for RO ID. + { + public ctlXMLEditEventArgs() {; } + public ctlXMLEditEventArgs(bool DisplaySymBolBtn) + { + _DisplaySymBolBtn = DisplaySymBolBtn; + } + private bool _DisplaySymBolBtn; + + public bool DisplaySymBolBtn + { + get { return _DisplaySymBolBtn; } + set { _DisplaySymBolBtn = value; } + } + } + + public enum E_FontStyle : byte + { + FS_NONE = 0, + FS_BOLD = 0x01, + FS_UNDERLINE = 0x02, + FS_ITALIC = 0x04, + FS_SUPERSCRIPT = 0x08, + FS_SUBSCRIPT = 0x10 + } } diff --git a/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/ctlXMLEditLib.csproj b/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/ctlXMLEditLib.csproj index 2c914674..da28a7ea 100644 --- a/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/ctlXMLEditLib.csproj +++ b/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/ctlXMLEditLib.csproj @@ -126,6 +126,9 @@ System.XML + + ..\..\..\Volian.Base.Library\bin\Debug\Volian.Base.Library.dll + @@ -137,6 +140,12 @@ Form + + Component + + + roRichTextBox.cs + Form diff --git a/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/roRichTextBox.Designer.cs b/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/roRichTextBox.Designer.cs new file mode 100644 index 00000000..6626c0a2 --- /dev/null +++ b/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/roRichTextBox.Designer.cs @@ -0,0 +1,40 @@ + +namespace ctlXMLEditLib +{ + partial class roRichTextBox + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + System.Windows.Forms.AutoScaleMode AutoScaleMode; + private void InitializeComponent() + { + + components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + } + + #endregion + } +} diff --git a/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/roRichTextBox.cs b/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/roRichTextBox.cs new file mode 100644 index 00000000..cebc89fc --- /dev/null +++ b/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/roRichTextBox.cs @@ -0,0 +1,100 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using Volian.Base.Library; + +namespace ctlXMLEditLib +{ + public partial class roRichTextBox : RichTextBox // C2022-003 Symbols in RO Editor. Customized RichTextBox for RO Editor. + { + public roRichTextBox() + { + InitializeComponent(); + } + private string _RtfPrefix; // contains Font table and styles (bold/underline/italics) for rtb from step style + public string RtfPrefixForSymbols + { + get + { + //B2020-100 RHM Use SelectionFont rather than the font from the format file. + StringBuilder selectedRtfSB = new StringBuilder(); + AddFontTable(selectedRtfSB, FormatFont, true); + _RtfPrefix = selectedRtfSB.ToString(); + return _RtfPrefix + @"\f1\fs" + 10 * 2 + " "; + } + } + public void InsertSymbol( int symbcode) + { + int position = this.SelectionStart; + string sym = symbcode < 256 ? ((char)symbcode).ToString() : string.Format(@"\u{0}", symbcode); + this.SelectedRtf = RtfPrefixForSymbols + sym + @"}"; + Select(position, -1); + Select(position + 1, 0); + } + public void rchtxtBox_KeyDown(object sender,string RO_IDEN) // C2022-003 code used to prevent a symbol from being inserted into RO ID. + { + bool symFlg = false; + + roRichTextBox o = (roRichTextBox)sender; + if (o.Name == RO_IDEN) + { + if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) + { + string clpBrd = Clipboard.GetText(); + if (clpBrd.Any(c => c > 166)) + { + MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'"); + Clipboard.Clear(); + } + } + } + } + private static void AddFontTable(StringBuilder selectedRtfSB, Font myFont, bool isFixed) + { + StringBuilder sbbeg = new StringBuilder(); + StringBuilder sbend = new StringBuilder(); + if (myFont.Bold) + { + sbbeg.Append(@"\b"); + sbend.Append(@"\b0"); + } + if (myFont.Underline) + { + sbbeg.Append(@"\ul"); + sbend.Insert(0, @"\ulnone"); + } + if (myFont.Italic) + { + sbbeg.Append(@"\i"); + sbend.Insert(0, @"\i0"); + } + // RO Editor add symbols C2022-003 + selectedRtfSB.Append(@"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset2 " + myFont.FontFamily.Name + @";}"); + selectedRtfSB.Append(@"{\f1\fnil\fcharset0 FreeMono;}}{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;}"); // FreeMono is now used for symbols display. + selectedRtfSB.Append("\r\n"); + selectedRtfSB.Append(@"\viewkind4\uc1\pard" + sbbeg.ToString() + @"\fs" + Convert.ToInt32(myFont.SizeInPoints * 2).ToString() + @" "); + } + private Font _FormatFont; + public Font FormatFont + { + get + { + if (_FormatFont == null) + { + Font formatFont; + formatFont = Font; + _FormatFont = formatFont; + } + return _FormatFont; + } + set { _FormatFont = value; } + } + } +} + diff --git a/PROMS/VEPROMS User Interface/PROMSFixes.Sql b/PROMS/VEPROMS User Interface/PROMSFixes.Sql index 9f235f99..4d6b672e 100644 --- a/PROMS/VEPROMS User Interface/PROMSFixes.Sql +++ b/PROMS/VEPROMS User Interface/PROMSFixes.Sql @@ -24533,6 +24533,206 @@ GO PRINT 'Added IX_tblROUsagesRODbIDDeleteStatusROID Index. Speeds up RO queries' GO + +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[GetCurrentApprovedRevisions]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1) + DROP PROCEDURE [GetCurrentApprovedRevisions]; + +GO + +/****** Object: StoredProcedure [dbo].[GetCurrentApprovedRevisions] Script Date: 02/05/2026 7:54:42 AM ******/ + +-- ============================================= +-- Author: Matthew Schill +-- Create date: 02/05/2026 +-- Description: Gets all current approved revisions +-- ============================================= +CREATE PROCEDURE [dbo].[GetCurrentApprovedRevisions] +( + @ItemID AS bigint +) +AS +BEGIN + + select max(rr.revisionid) revisionid, UnitId, UnitVal.name UnitName, max(rr.DTS) DTS + from items ii + inner join revisions rr on ii.itemid = rr.itemid + inner join versions vv on rr.revisionid = vv.revisionid + inner join stages ss on vv.stageid = ss.stageid + outer apply + (Select UnitId = r1.value('@Index','int') FROM rr.config.nodes('Config/Applicability') t1(r1)) App + left outer join + (select r1.value('@index','int') indx + ,r1.value('@Name','varchar') name + from (select *,cast(config as xml) xconfig from DocVersions + where ItemID in(select itemID from vefn_AllSiblingItems(@ItemID))) SDV + cross apply + xconfig.nodes('Config/Slaves/Slave') t1(r1)) UnitVal ON UnitVal.indx = UnitId + where ss.isapproved = 1 + and ii.itemid = @ItemID + group by UnitId, UnitVal.name + + RETURN +END + +IF (@@Error = 0) PRINT 'Procedure Creation: [GetCurrentApprovedRevisions] Succeeded' +ELSE PRINT 'Procedure Creation: [GetCurrentApprovedRevisions] Error on Creation' +GO + + +/* +========================================================================================================== +-- Begin: C2026-010 Add Audit Ability for ChangeBars +-- Author: Matthew Schill +-- Create date: 02/17/2026 +========================================================================================================== +*/ + /* + ---------------------------------------------------------------------------------- + Tables: + ---------------------------------------------------------------------------------- + [ChangeBarAudits] + + ---------------------------------------------------------------------------------- + Indexes: + ---------------------------------------------------------------------------------- + [IX_ChangeBarAudits_ItemID] on [dbo].[ChangeBarAudits] + + + + */ + + + IF Not Exists(SELECT * FROM sys.objects Where name = 'ChangeBarAudits' AND type in (N'U')) + Begin + + SET ANSI_NULLS ON + SET QUOTED_IDENTIFIER ON + + /****** Create Table to hold Audit Information ******/ + CREATE TABLE [dbo].[ChangeBarAudits]( + [AuditID] [bigint] IDENTITY(1,1) NOT NULL, + [ItemID] [bigint] NOT NULL, + [Text] [nvarchar](max) NULL, + [DTS] [datetime] NOT NULL, + [UserID] [nvarchar](100) NOT NULL, + [UnitIndex] [int] NULL, + CONSTRAINT [PK_ChangeBarAudits] PRIMARY KEY CLUSTERED + ( + [AuditID] ASC + )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] + ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] + + IF (@@Error = 0) PRINT 'Table Creation: [ChangeBarAudits] Succeeded' + ELSE PRINT 'Table Creation: [ChangeBarAudits] Error on Creation' + + /****** Table was not previously created - so intially populate with info from Approvals ******/ + INSERT into ChangeBarAudits([ItemID],[Text],[DTS],[UserID],[UnitIndex]) + select --rr.RevisionID, + rr.ItemID, + Text = CASE WHEN r1.value('@Index','int') <> 0 AND UnitName IS NOT NULL THEN + '(Unit ' + UnitName + ') ' + ELSE + '' + END + + 'Approved by (' + rr.UserID + ') on (' + + CAST(rr.DTS AS VARCHAR) + ')', + rr.DTS, + rr.UserID, + UnitIndex = r1.value('@Index','int') + -- , UnitName + from revisions rr + inner join versions vv on rr.revisionid = vv.revisionid + inner join stages ss on vv.stageid = ss.stageid + outer apply rr.config.nodes('Config/Applicability') t1(r1) + outer apply + ( Select r2.value('@Name','varchar') UnitName + FROM + (select DocVerSions.ItemID, cast(config as xml) xconfig from DocVersions + inner join + vefn_AllSiblingItems(rr.ItemID) Sib ON DocVerSions.ItemID = Sib.ItemID) SDV + cross apply + xconfig.nodes('Config/Slaves/Slave') t2(r2) + WHERE r2.value('@index','varchar') = r1.value('@Index','int') + ) UN + where ss.isapproved = 1 + order by rr.ItemID, rr.RevisionID desc + + IF (@@Error = 0) PRINT '[ChangeBarAudits] Initial Population Succeeded' + ELSE PRINT '[ChangeBarAudits] Initial Population Error' + + /****** Create Index to get ChangeBar Audit Information for Item (ItemID = ProcedureID) ******/ + CREATE NONCLUSTERED INDEX [IX_ChangeBarAudits_ItemID] ON [dbo].[ChangeBarAudits] + ( + [ItemID] ASC + ) + INCLUDE ([AuditID], [Text], [DTS], [UnitIndex]) + WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] + + IF (@@Error = 0) PRINT 'Index Creation: [IX_ChangeBarAudits_ItemID] Succeeded' + ELSE PRINT 'Index Creation: [IX_ChangeBarAudits_ItemID] Error on Creation' + + End + + -- ============================================= + -- Description: Gets ChangeBar Audit History by item + -- ============================================= + IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[GetChangeBarAuditHistoryByItem]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1) + DROP PROCEDURE [GetChangeBarAuditHistoryByItem]; + + GO + + CREATE PROCEDURE [dbo].[GetChangeBarAuditHistoryByItem] + ( + @ItemID AS bigint + ) + AS + BEGIN + Select * FROM ChangeBarAudits where ItemID = @ItemID + order by DTS desc + + RETURN + END + + IF (@@Error = 0) PRINT 'Procedure Creation: [GetChangeBarAuditHistoryByItem] Succeeded' + ELSE PRINT 'Procedure Creation: [GetChangeBarAuditHistoryByItem] Error on Creation' + GO + + -- ============================================= + -- Description: Adds ChangeBar Audit History + -- ============================================= + IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[AddChangeBarAuditHistory]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1) + DROP PROCEDURE [AddChangeBarAuditHistory]; + + GO + + CREATE PROCEDURE [dbo].[AddChangeBarAuditHistory] + ( + @ItemID AS bigint, + @Description As nvarchar(max), + @DTS AS Datetime, + @UserID As nvarchar(100), + @UnitIndex AS bigint = NULL + ) + AS + BEGIN + + INSERT into ChangeBarAudits([ItemID],[Text],[DTS],[UserID],[UnitIndex]) + VALUES (@ItemID, @Description, @DTS, @UserID, @UnitIndex) + + RETURN + END + + IF (@@Error = 0) PRINT 'Procedure Creation: [AddChangeBarAuditHistory] Succeeded' + ELSE PRINT 'Procedure Creation: [AddChangeBarAuditHistory] Error on Creation' + GO + +/* +========================================================================================================== +-- End: C2026-010 Add Audit Ability for ChangeBars +========================================================================================================== +*/ + + /* --------------------------------------------------------------------------- | ADD New Code Before this Block | @@ -24566,8 +24766,8 @@ BEGIN TRY -- Try Block DECLARE @RevDate varchar(255) DECLARE @RevDescription varchar(255) - set @RevDate = '02/06/2026 1:00 PM' - set @RevDescription = 'Updated Search Tool to better handle Cautions and Notes at the same level' + set @RevDate = '02/18/2026 7:00 AM' + set @RevDescription = 'Added Audit Ability for ChangeBars' Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription diff --git a/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs b/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs index 0dd507e5..cdbfc521 100644 --- a/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs +++ b/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs @@ -1135,6 +1135,7 @@ namespace VEPROMS ViewPDF = ViewPDF && MyProcedures.Count == 1; StringBuilder sb = new StringBuilder(); StageInfo nsi = StageInfo.GetJustStage(RevStage); + DateTime now = DateTime.Now; //using variable so dates are consistent foreach (ApprovalProcedure ap in MyProcedures) //spin thru looking for updating current revision { // ric: current revision info record, not new one being created. @@ -1207,7 +1208,7 @@ namespace VEPROMS cfg.History_StartDate = myDTS; // if there is a slave, date found from above code cfg.Applicability_Index = ap.ProcInfo.MyDocVersion.DocVersionConfig.SelectedSlave; //cfg.Save(); - revision = Revision.MakeRevision(pi.ItemID, RevType, ap.RevNumber, ap.RevDate, RevNote, cfg.ToString(), DateTime.Now, Volian.Base.Library.VlnSettings.UserID); + revision = Revision.MakeRevision(pi.ItemID, RevType, ap.RevNumber, ap.RevDate, RevNote, cfg.ToString(), now, Volian.Base.Library.VlnSettings.UserID); // revision.MyConfig.History_StartDate = pi.DTS; // revision.MyConfig.Save(); // revision = revision.Save(); @@ -1234,7 +1235,7 @@ namespace VEPROMS RevisionConfig cfg = new RevisionConfig(); cfg.History_StartDate = pi.DTS; // todo: this should probably be myDTS, found during fix of B2019-051. //cfg.Save(); - revision = Revision.MakeRevision(pi.ItemID, RevType, ap.RevNumber, ap.RevDate, RevNote, cfg.ToString(), DateTime.Now, Volian.Base.Library.VlnSettings.UserID); + revision = Revision.MakeRevision(pi.ItemID, RevType, ap.RevNumber, ap.RevDate, RevNote, cfg.ToString(), now, Volian.Base.Library.VlnSettings.UserID); // revision.MyConfig.History_StartDate = pi.DTS; // revision.MyConfig.Save(); // revision = revision.Save(); @@ -1253,7 +1254,7 @@ namespace VEPROMS byte[] summaryBuf = null; //B2017-149 Allow the user to choose if they want the Summary of Changes report created during the approval process if (doSumChg) summaryBuf = CreateSummary(ref pi, summaryPDF, myDTS); - DateTime currentDTS = DateTime.Now; + DateTime currentDTS = now; Check check = Check.MakeCheck(revision, Stage.GetJustStage(RevStage), RevisionInfo.BuildRevisionChecks(pi), currentDTS, VlnSettings.UserID); //make pdf with promsprinter and get byte stream // Moved to end so that Item and Content are saved at the same time @@ -1311,7 +1312,15 @@ namespace VEPROMS pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0; if (si.IsApproved == 1) { - dlgExportImport dlg = new dlgExportImport("Export", pi, MyFrmVEPROMS, (selectedSlave)); // "true tell export to convert ROs and Transitions to text + + //B2026-016 - Fix error pulling Reference Object info into Export + if (pi.MyDocVersion.DocVersionAssociationCount == 0) + { + MessageBox.Show("Prior to Approval you must set the Referenced Object Database", "No RO Database set", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + return false; + } + + dlgExportImport dlg = new dlgExportImport("Export", pi, MyFrmVEPROMS, (selectedSlave)); // "true tell export to convert ROs and Transitions to text dlg.DocReplace = frm.DocReplace; // this tells approval to prepare an export file with resolved transitions and ROs, word sections are saved with resolved ROs during approval PDF creation and saved in DocReplace System.Xml.XmlDocument xd = new System.Xml.XmlDocument(); dlg.ExportItem(xd, pi, "procedure"); @@ -1319,30 +1328,46 @@ namespace VEPROMS version.ApprovedXML = xd.OuterXml; version.Save(); dlg.Dispose(); - UpdateProcedureConfig(pi, ap.RevNumber, ap.RevDate, DateTime.Now, selectedSlave); + UpdateProcedureConfig(pi, ap.RevNumber, ap.RevDate, now, selectedSlave); - // Clear the change bar override for this procedure: - pi.ClearChangeBarOverrides(); + //CSM - C2026-010 - Add Audit Record for Change Bar Audit History + ChangeBarAuditHistory.AddAudit(pi.ItemID, $"{(selectedSlave > 0 ? $"(Unit {pi.MyDocVersion.UnitNames[selectedSlave - 1]}) " : "")}Approved by ({VlnSettings.UserID}) on ({now})", now, VlnSettings.UserID, selectedSlave); + + // Clear the change bar override for this procedure: + pi.ClearChangeBarOverrides(); //B2019-140 Change bars do not get refreshed when approval is run. - ProcedureInfo newproc = ItemInfo.ResetProcedure(pi.ItemID); + ProcedureInfo newproc; - //// Refresh the StepPanel for the current Procedure - //// so change bars update - //// on any open StepPanel - DisplayTabItem dti = MyFrmVEPROMS.GetTabContainingProcedure(pi.ItemID); + //// Refresh the StepPanel for the current Procedure + //// so change bars update + //// on any open StepPanel + + //B2026-019 Attempt to prevent an Access Error by utilizing a different Refresh if a Procedure is Open + DisplayTabItem dti = MyFrmVEPROMS.GetTabContainingProcedure(pi.ItemID); if (dti != null) { if (!dti.MyStepTabPanel.MyStepPanel.ContainsFocus) dti.MyStepTabPanel.MyStepPanel.Focus(); foreach (EditItem eitm in dti.MyStepTabPanel.MyStepPanel.Controls.OfType()) - eitm.ChangeBar = eitm.MyItemInfo.HasChangeBar; - } + { + eitm.ChangeBar = eitm.MyItemInfo.HasChangeBar; + } - //since in a separate form, need to update the tree view - //so "Showing Change Bars" Content Menu Item is correct - MyFrmVEPROMS.RefreshProcedureNode(newproc); + dti.MyStepTabPanel.MyStepTabRibbon.RefreshProcedure(); + Application.DoEvents(); + newproc = ProcedureInfo.Get(pi.ItemID); + + } + else + { + newproc = ItemInfo.ResetProcedure(pi.ItemID); + } + + //since in a separate form, need to update the tree view + //so "Showing Change Bars" Content Menu Item is correct + MyFrmVEPROMS.RefreshProcedureNode(newproc); } else UpdateProcedureConfig(pi, ap.RevNumber, ap.RevDate, myDTS, selectedSlave); diff --git a/PROMS/VEPROMS User Interface/dlgExportImport.cs b/PROMS/VEPROMS User Interface/dlgExportImport.cs index 399ea4f6..1606a03a 100644 --- a/PROMS/VEPROMS User Interface/dlgExportImport.cs +++ b/PROMS/VEPROMS User Interface/dlgExportImport.cs @@ -1618,8 +1618,15 @@ namespace VEPROMS public void ExportItem(XmlDocument xd, ItemInfo ii, string nodename) { - XmlElement xe = xd.CreateElement(nodename); - if (ii.IsProcedure) + //B2026-016 - Fix error pulling Reference Object info into Export + if (ii.MyDocVersion.DocVersionAssociationCount == 0) + { + MessageBox.Show("Prior to Exporting Procedures you must set the Referenced Object Database", "No RO Database set", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + return; + } + + XmlElement xe = xd.CreateElement(nodename); + if (ii.IsProcedure) { xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rodbid", ii.MyDocVersion.DocVersionAssociations[0].MyROFst.MyRODb.RODbID.ToString())); xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rofolderpath", ii.MyDocVersion.DocVersionAssociations[0].MyROFst.MyRODb.FolderPath)); diff --git a/PROMS/VEPROMS User Interface/dlgSetChangeBarStartDate.Designer.cs b/PROMS/VEPROMS User Interface/dlgSetChangeBarStartDate.Designer.cs index 9f87e261..a6ff65b0 100644 --- a/PROMS/VEPROMS User Interface/dlgSetChangeBarStartDate.Designer.cs +++ b/PROMS/VEPROMS User Interface/dlgSetChangeBarStartDate.Designer.cs @@ -28,142 +28,158 @@ /// private void InitializeComponent() { - this.btnOK = new DevComponents.DotNetBar.ButtonX(); - this.btnCancel = new DevComponents.DotNetBar.ButtonX(); - this.label1 = new System.Windows.Forms.Label(); - this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip(); - this.dateTimeInput1 = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); - this.btnNow = new DevComponents.DotNetBar.ButtonX(); - ((System.ComponentModel.ISupportInitialize)(this.dateTimeInput1)).BeginInit(); - this.SuspendLayout(); - // - // btnOK - // - this.btnOK.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnOK.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; - this.btnOK.Location = new System.Drawing.Point(18, 111); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(64, 23); - this.btnOK.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.btnOK.TabIndex = 1; - this.btnOK.Text = "OK"; - this.btnOK.Click += new System.EventHandler(this.btnOK_Click); - // - // btnCancel - // - this.btnCancel.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnCancel.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Location = new System.Drawing.Point(179, 111); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(64, 23); - this.btnCancel.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.btnCancel.TabIndex = 2; - this.btnCancel.Text = "Cancel"; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.Location = new System.Drawing.Point(3, 19); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(229, 15); - this.label1.TabIndex = 3; - this.label1.Text = "Show Change Bars on Changes Starting:"; - // - // superTooltip1 - // - this.superTooltip1.DefaultTooltipSettings = new DevComponents.DotNetBar.SuperTooltipInfo("", "", "", null, null, DevComponents.DotNetBar.eTooltipColor.Gray); - this.superTooltip1.LicenseKey = "F962CEC7-CD8F-4911-A9E9-CAB39962FC1F"; - // - // dateTimeInput1 - // - // - // - // - this.dateTimeInput1.BackgroundStyle.Class = "DateTimeInputBackground"; - this.dateTimeInput1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.dateTimeInput1.ButtonDropDown.Shortcut = DevComponents.DotNetBar.eShortcut.AltDown; - this.dateTimeInput1.ButtonDropDown.Visible = true; - this.dateTimeInput1.CustomFormat = "MM/dd/yyyy HH:mm:ss"; - this.dateTimeInput1.DateTimeSelectorVisibility = DevComponents.Editors.DateTimeAdv.eDateTimeSelectorVisibility.DateSelector; - this.dateTimeInput1.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; - this.dateTimeInput1.IsPopupCalendarOpen = false; - this.dateTimeInput1.Location = new System.Drawing.Point(30, 51); - // - // - // - // - // - // - this.dateTimeInput1.MonthCalendar.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.dateTimeInput1.MonthCalendar.CalendarDimensions = new System.Drawing.Size(1, 1); - this.dateTimeInput1.MonthCalendar.ClearButtonVisible = true; - // - // - // - this.dateTimeInput1.MonthCalendar.CommandsBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2; - this.dateTimeInput1.MonthCalendar.CommandsBackgroundStyle.BackColorGradientAngle = 90; - this.dateTimeInput1.MonthCalendar.CommandsBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; - this.dateTimeInput1.MonthCalendar.CommandsBackgroundStyle.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.dateTimeInput1.MonthCalendar.CommandsBackgroundStyle.BorderTopColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder; - this.dateTimeInput1.MonthCalendar.CommandsBackgroundStyle.BorderTopWidth = 1; - this.dateTimeInput1.MonthCalendar.CommandsBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.dateTimeInput1.MonthCalendar.DisplayMonth = new System.DateTime(2016, 2, 1, 0, 0, 0, 0); - // - // - // - this.dateTimeInput1.MonthCalendar.NavigationBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; - this.dateTimeInput1.MonthCalendar.NavigationBackgroundStyle.BackColorGradientAngle = 90; - this.dateTimeInput1.MonthCalendar.NavigationBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.dateTimeInput1.MonthCalendar.NavigationBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.dateTimeInput1.MonthCalendar.TodayButtonVisible = true; - this.dateTimeInput1.Name = "dateTimeInput1"; - this.dateTimeInput1.Size = new System.Drawing.Size(146, 20); - this.dateTimeInput1.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.superTooltip1.SetSuperTooltip(this.dateTimeInput1, new DevComponents.DotNetBar.SuperTooltipInfo("Change Bar Start Date", "", "Only the changes made after this date will have change bars.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(138, 67))); - this.dateTimeInput1.TabIndex = 4; - this.dateTimeInput1.TimeSelectorTimeFormat = DevComponents.Editors.DateTimeAdv.eTimeSelectorFormat.Time24H; - this.dateTimeInput1.TimeSelectorType = DevComponents.Editors.DateTimeAdv.eTimeSelectorType.TouchStyle; - // - // btnNow - // - this.btnNow.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnNow.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnNow.Location = new System.Drawing.Point(182, 51); - this.btnNow.Name = "btnNow"; - this.btnNow.Size = new System.Drawing.Size(49, 23); - this.btnNow.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.superTooltip1.SetSuperTooltip(this.btnNow, new DevComponents.DotNetBar.SuperTooltipInfo("Now", "", "This will set the Change Bar Start date to today.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); - this.btnNow.TabIndex = 5; - this.btnNow.Text = "Today"; - this.btnNow.Click += new System.EventHandler(this.btnNow_Click); - // - // dlgSetChangeBarStartDate - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(268, 144); - this.Controls.Add(this.btnNow); - this.Controls.Add(this.dateTimeInput1); - this.Controls.Add(this.label1); - this.Controls.Add(this.btnCancel); - this.Controls.Add(this.btnOK); - this.DoubleBuffered = true; - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "dlgSetChangeBarStartDate"; - this.ShowIcon = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Change Bar Start Date"; - this.Load += new System.EventHandler(this.dlgSetChangeBarStartDate_Load); - ((System.ComponentModel.ISupportInitialize)(this.dateTimeInput1)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); + this.btnOK = new DevComponents.DotNetBar.ButtonX(); + this.btnCancel = new DevComponents.DotNetBar.ButtonX(); + this.label1 = new System.Windows.Forms.Label(); + this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip(); + this.dateTimeInput1 = new DevComponents.Editors.DateTimeAdv.DateTimeInput(); + this.btnNow = new DevComponents.DotNetBar.ButtonX(); + this.btnResetToApproved = new DevComponents.DotNetBar.ButtonX(); + ((System.ComponentModel.ISupportInitialize)(this.dateTimeInput1)).BeginInit(); + this.SuspendLayout(); + // + // btnOK + // + this.btnOK.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; + this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.btnOK.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; + this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; + this.btnOK.Location = new System.Drawing.Point(18, 111); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size(64, 23); + this.btnOK.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnOK.TabIndex = 1; + this.btnOK.Text = "OK"; + this.btnOK.Click += new System.EventHandler(this.btnOK_Click); + // + // btnCancel + // + this.btnCancel.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; + this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnCancel.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point(179, 111); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(64, 23); + this.btnCancel.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnCancel.TabIndex = 2; + this.btnCancel.Text = "Cancel"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.Location = new System.Drawing.Point(3, 19); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(229, 15); + this.label1.TabIndex = 3; + this.label1.Text = "Show Change Bars on Changes Starting:"; + // + // superTooltip1 + // + this.superTooltip1.DefaultTooltipSettings = new DevComponents.DotNetBar.SuperTooltipInfo("", "", "", null, null, DevComponents.DotNetBar.eTooltipColor.Gray); + this.superTooltip1.LicenseKey = "F962CEC7-CD8F-4911-A9E9-CAB39962FC1F"; + // + // dateTimeInput1 + // + // + // + // + this.dateTimeInput1.BackgroundStyle.Class = "DateTimeInputBackground"; + this.dateTimeInput1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.dateTimeInput1.ButtonDropDown.Shortcut = DevComponents.DotNetBar.eShortcut.AltDown; + this.dateTimeInput1.ButtonDropDown.Visible = true; + this.dateTimeInput1.CustomFormat = "MM/dd/yyyy HH:mm:ss"; + this.dateTimeInput1.DateTimeSelectorVisibility = DevComponents.Editors.DateTimeAdv.eDateTimeSelectorVisibility.DateSelector; + this.dateTimeInput1.Format = DevComponents.Editors.eDateTimePickerFormat.Custom; + this.dateTimeInput1.IsPopupCalendarOpen = false; + this.dateTimeInput1.Location = new System.Drawing.Point(30, 51); + // + // + // + // + // + // + this.dateTimeInput1.MonthCalendar.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.dateTimeInput1.MonthCalendar.CalendarDimensions = new System.Drawing.Size(1, 1); + this.dateTimeInput1.MonthCalendar.ClearButtonVisible = true; + // + // + // + this.dateTimeInput1.MonthCalendar.CommandsBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2; + this.dateTimeInput1.MonthCalendar.CommandsBackgroundStyle.BackColorGradientAngle = 90; + this.dateTimeInput1.MonthCalendar.CommandsBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; + this.dateTimeInput1.MonthCalendar.CommandsBackgroundStyle.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.dateTimeInput1.MonthCalendar.CommandsBackgroundStyle.BorderTopColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder; + this.dateTimeInput1.MonthCalendar.CommandsBackgroundStyle.BorderTopWidth = 1; + this.dateTimeInput1.MonthCalendar.CommandsBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.dateTimeInput1.MonthCalendar.DisplayMonth = new System.DateTime(2016, 2, 1, 0, 0, 0, 0); + // + // + // + this.dateTimeInput1.MonthCalendar.NavigationBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; + this.dateTimeInput1.MonthCalendar.NavigationBackgroundStyle.BackColorGradientAngle = 90; + this.dateTimeInput1.MonthCalendar.NavigationBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; + this.dateTimeInput1.MonthCalendar.NavigationBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.dateTimeInput1.MonthCalendar.TodayButtonVisible = true; + this.dateTimeInput1.Name = "dateTimeInput1"; + this.dateTimeInput1.Size = new System.Drawing.Size(146, 20); + this.dateTimeInput1.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.superTooltip1.SetSuperTooltip(this.dateTimeInput1, new DevComponents.DotNetBar.SuperTooltipInfo("Change Bar Start Date", "", "Only the changes made after this date will have change bars.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(138, 67))); + this.dateTimeInput1.TabIndex = 4; + this.dateTimeInput1.TimeSelectorTimeFormat = DevComponents.Editors.DateTimeAdv.eTimeSelectorFormat.Time24H; + this.dateTimeInput1.TimeSelectorType = DevComponents.Editors.DateTimeAdv.eTimeSelectorType.TouchStyle; + // + // btnNow + // + this.btnNow.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; + this.btnNow.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; + this.btnNow.Location = new System.Drawing.Point(182, 51); + this.btnNow.Name = "btnNow"; + this.btnNow.Size = new System.Drawing.Size(49, 23); + this.btnNow.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.superTooltip1.SetSuperTooltip(this.btnNow, new DevComponents.DotNetBar.SuperTooltipInfo("Now", "", "This will set the Change Bar Start date to today.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); + this.btnNow.TabIndex = 5; + this.btnNow.Text = "Today"; + this.btnNow.Click += new System.EventHandler(this.btnNow_Click); + // + // btnResetToApproved + // + this.btnResetToApproved.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; + this.btnResetToApproved.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; + this.btnResetToApproved.Location = new System.Drawing.Point(30, 77); + this.btnResetToApproved.Name = "btnResetToApproved"; + this.btnResetToApproved.Size = new System.Drawing.Size(201, 23); + this.btnResetToApproved.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnResetToApproved.TabIndex = 6; + this.btnResetToApproved.Text = "Reset Change Bar To Approved Date"; + this.btnResetToApproved.Tooltip = "Reset Change Bar to the last approved date. If no approvals, reset to as if no ch" + + "ange bar date. After selecting this, press OK to save."; + this.btnResetToApproved.Click += new System.EventHandler(this.btnResetToApproved_Click); + // + // dlgSetChangeBarStartDate + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(268, 144); + this.Controls.Add(this.btnResetToApproved); + this.Controls.Add(this.btnNow); + this.Controls.Add(this.dateTimeInput1); + this.Controls.Add(this.label1); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnOK); + this.DoubleBuffered = true; + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "dlgSetChangeBarStartDate"; + this.ShowIcon = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Change Bar Start Date"; + this.Load += new System.EventHandler(this.dlgSetChangeBarStartDate_Load); + ((System.ComponentModel.ISupportInitialize)(this.dateTimeInput1)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); } @@ -175,5 +191,6 @@ private DevComponents.DotNetBar.SuperTooltip superTooltip1; private DevComponents.Editors.DateTimeAdv.DateTimeInput dateTimeInput1; private DevComponents.DotNetBar.ButtonX btnNow; - } + private DevComponents.DotNetBar.ButtonX btnResetToApproved; + } } \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/dlgSetChangeBarStartDate.cs b/PROMS/VEPROMS User Interface/dlgSetChangeBarStartDate.cs index ba10dfbf..a9ba9321 100644 --- a/PROMS/VEPROMS User Interface/dlgSetChangeBarStartDate.cs +++ b/PROMS/VEPROMS User Interface/dlgSetChangeBarStartDate.cs @@ -1,31 +1,25 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using System.Data; -using System.Drawing; using System.Text; using System.Windows.Forms; -using DevComponents.DotNetBar; -using DevComponents.DotNetBar.Controls; using VEPROMS.CSLA.Library; - +using Volian.Base.Library; +using Volian.Controls.Library; namespace VEPROMS { public partial class dlgSetChangeBarStartDate : DevComponents.DotNetBar.Office2007Form { - private ProcedureConfig _MyProcConfig = null; + public ProcedureConfig MyProcConfig { get; set; } = null; - public ProcedureConfig MyProcConfig - { - get { return _MyProcConfig; } - set { _MyProcConfig = value; } - } + public ProcedureInfo MyProcInfo { get; set; } = null; - public dlgSetChangeBarStartDate(ProcedureConfig pc) + public dlgSetChangeBarStartDate(ProcedureConfig pc, ProcedureInfo pi) { InitializeComponent(); - _MyProcConfig = pc; + MyProcConfig = pc; + MyProcInfo = pi; } private void dlgSetChangeBarStartDate_Load(object sender, EventArgs e) @@ -37,7 +31,7 @@ namespace VEPROMS { cbdt = DateTime.Now.ToString("MM/dd/yyyy") + " " + DateTime.Now.ToString("HH:mm:ss"); dateTimeInput1.Value = DateTime.Parse(cbdt); - return; + return; } else { @@ -72,13 +66,92 @@ namespace VEPROMS private void btnOK_Click(object sender, EventArgs e) { MyProcConfig.Print_ChangeBarDate = dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss");// ("MM/dd/yyyy HH:mm:ss"); - } + + //CSM - C2026-010 - Add Audit Record for Change Bar Audit History + ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Set ChangeBars set to ({ dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss")}) by ({ VlnSettings.UserID}) on ({DateTime.Now})", DateTime.Now, VlnSettings.UserID, 0); + + } - private void btnNow_Click(object sender, EventArgs e) + private void btnNow_Click(object sender, EventArgs e) { dateTimeInput1.Value = DateTime.Now; } - } + //C2026-009 Add Option to Reset Change Bar to Last Approved Date/Time + private void btnResetToApproved_Click(object sender, EventArgs e) + { + System.Data.DataTable dt = RevisionData.GetRevisionDataByUnit(MyProcInfo.ItemID); + + if (dt.Rows.Count == 0) + { + //no records, remove + if (MessageBox.Show("There are currently no approvals set. Selecting yes will set ChangeBars to show all changes since the creation of the procedure.\r\nAre you sure you wish to reset ChangeBars?", "Reset ChangeBar Date", MessageBoxButtons.YesNo) == DialogResult.Yes) + { + MyProcConfig.Print_ChangeBarDate = ""; + DialogResult = DialogResult.OK; + + //CSM - C2026-010 - Add Audit Record for Change Bar Audit History + ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Reset ChangeBars performed by ({VlnSettings.UserID}) on ({DateTime.Now}). ChangeBars reset to show all changes.", DateTime.Now, VlnSettings.UserID, 0); + + Close(); + } + } + else if (RevisionData.HasUnits(dt)) + { + + //any with units + string maxDTS = RevisionData.MaxDTS(dt).ToString("MM/dd/yyyy HH:mm:ss"); + + //create wording for ChangeBar changes + StringBuilder sb = new StringBuilder(); + sb.Append($" The Procedure Viewer Change Bar Date will be set to ({maxDTS})."); + foreach (DataRow r in dt.Rows) + { + sb.Append($"\r\n The Change Bar Date for Unit ({r["UnitName"]}) will be set to ({Convert.ToDateTime(r["DTS"]):MM/dd/yyyy HH:mm:ss})."); + } + + sb.Append("\r\n Any Change Bars for Units not listed above will use the Overall/Procedure Viewer Change Bar Date (as these Units have no approvals)."); + + if (CustomMessageBox.Show($"This will reset ChangeBars to show for changes newer than the last approval.\r\nThis includes the following changes:\r\n{sb.ToString()}\r\n\r\nAre you sure you wish to reset ChangeBars?", "Reset ChangeBar Date", "Yes", "No") == DialogResult.Yes) + { + //Change the overall ChangeBarDate + MyProcConfig.Print_ChangeBarDate = maxDTS; + + //Change the ChangeBarDate for each unit + foreach (DataRow r in dt.Rows) + { + MyProcConfig.SelectedSlave = Convert.ToInt32(r["UnitID"]); + MyProcConfig.Print_ChangeBarDate = Convert.ToDateTime(r["DTS"]).ToString("MM / dd / yyyy HH: mm: ss"); + + //CSM - C2026-010 - Add Audit Record for Change Bar Audit History + ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Reset ChangeBars performed by ({VlnSettings.UserID}) on ({DateTime.Now}). ChangeBars reset to show since last approval ({Convert.ToDateTime(r["DTS"]):MM/dd/yyyy HH:mm:ss}) for (Unit {r["UnitName"]})", DateTime.Now, VlnSettings.UserID, MyProcConfig.SelectedSlave); + + } + MyProcConfig.SelectedSlave = 0; + DialogResult = DialogResult.OK; + + //CSM - C2026-010 - Add Audit Record for Change Bar Audit History + ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Reset ChangeBars performed by ({VlnSettings.UserID}) on ({DateTime.Now}). ChangeBars reset to show since last approval ({maxDTS})", DateTime.Now, VlnSettings.UserID, 0); + + Close(); + } + } + else + { + //no units + string maxDTS = RevisionData.MaxDTS(dt).ToString("MM/dd/yyyy HH:mm:ss"); + if (MessageBox.Show($"This will reset ChangeBars to show for changes newer than the last approval ({maxDTS}).\r\nAre you sure you wish to reset ChangeBars?", "Reset ChangeBar Date", MessageBoxButtons.YesNo) == DialogResult.Yes) + { + MyProcConfig.Print_ChangeBarDate = maxDTS; + DialogResult = DialogResult.OK; + + //CSM - C2026-010 - Add Audit Record for Change Bar Audit History + ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Reset ChangeBars performed by ({VlnSettings.UserID}) on ({DateTime.Now}). ChangeBars reset to show since last approval ({maxDTS})", DateTime.Now, VlnSettings.UserID, 0); + Close(); + } + } + + } + } } diff --git a/PROMS/VEPROMS User Interface/frmSectionProperties.cs b/PROMS/VEPROMS User Interface/frmSectionProperties.cs index 9d19bf66..06ee3ce2 100644 --- a/PROMS/VEPROMS User Interface/frmSectionProperties.cs +++ b/PROMS/VEPROMS User Interface/frmSectionProperties.cs @@ -678,7 +678,7 @@ namespace VEPROMS // to check that there are enough docstyles to map the selected type of section. PlantFormat pf = _SectionConfig.MyFormat != null ? _SectionConfig.MyFormat.PlantFormat : _SectionConfig.MyDefaultFormat.PlantFormat; if (!_Initializing && ppCmbxFormat.SelectedIndex >= 0) - pf = FormatInfoList.SortedFormatInfoList[ppCmbxFormat.SelectedIndex].PlantFormat; + pf = ((FormatInfo) ppCmbxFormat.SelectedItem).PlantFormat; else if (!_Initializing) // if the format was changed, it may have been set to default. pf = _SectionConfig.MyDefaultFormat.PlantFormat; _Initializing = true; diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs index e94335f3..d2f33d9d 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs @@ -877,7 +877,7 @@ namespace VEPROMS this.infoPanel.ExpandOnTitleClick = true; this.infoPanel.Location = new System.Drawing.Point(614, 57); this.infoPanel.Name = "infoPanel"; - this.infoPanel.Size = new System.Drawing.Size(230, 490); + this.infoPanel.Size = new System.Drawing.Size(300, 490); this.infoPanel.Style.Alignment = System.Drawing.StringAlignment.Center; this.infoPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; this.infoPanel.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.cs index 0d3e7556..c73eb983 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.cs @@ -617,7 +617,7 @@ namespace VEPROMS ProcedureConfig pc = pi.MyConfig as ProcedureConfig; if (pc == null) return; - dlgSetChangeBarStartDate cbdDlg = new dlgSetChangeBarStartDate(pc); + dlgSetChangeBarStartDate cbdDlg = new dlgSetChangeBarStartDate(pc, pi); if (cbdDlg.ShowDialog() == DialogResult.OK) { using (Item itm = Item.Get(pi.ItemID)) @@ -626,21 +626,26 @@ namespace VEPROMS itm.UserID = Volian.Base.Library.VlnSettings.UserID; itm.Save(); - //B2019-140 Change bars do not get refreshed when approval is run. - // Reset a Procedure and sub items in the cache - ProcedureInfo newproc = ItemInfo.ResetProcedure(pi.ItemID); + //B2019-140 Change bars do not get refreshed when approval is run. + // Reset a Procedure and sub items in the cache + ProcedureInfo newproc = ItemInfo.ResetProcedure(pi.ItemID); + + //// Refresh the StepPanel for the current Procedure + //// so change bars update + //// on any open StepPanel + + //B2026-019 Attempt to prevent an Access Error by utilizing a different Refresh if a Procedure is Open + DisplayTabItem dti = GetTabContainingProcedure(pi.ItemID); + if (dti != null) + { - //// Refresh the StepPanel for the current Procedure - //// so change bars update - //// on any open StepPanel - DisplayTabItem dti = GetTabContainingProcedure(pi.ItemID); - if (dti != null) - { if (!dti.MyStepTabPanel.MyStepPanel.ContainsFocus) - dti.MyStepTabPanel.MyStepPanel.Focus(); + dti.MyStepTabPanel.MyStepPanel.Focus(); foreach (EditItem eitm in dti.MyStepTabPanel.MyStepPanel.Controls.OfType()) + { eitm.ChangeBar = eitm.MyItemInfo.HasChangeBar; + } } } } diff --git a/PROMS/VEPROMS User Interface/frmVersionsProperties.cs b/PROMS/VEPROMS User Interface/frmVersionsProperties.cs index 2a42eccb..ee0efcdd 100644 --- a/PROMS/VEPROMS User Interface/frmVersionsProperties.cs +++ b/PROMS/VEPROMS User Interface/frmVersionsProperties.cs @@ -1113,13 +1113,34 @@ namespace VEPROMS if (_Apples == null) { _Apples = new List(); - } - _Apples.Add(cfg); + } + + //B2026-017 Use Pre-typed in information when adding New Applicability + if (_Apples.Count == 0) + { + cfg.ID = textBox1.Text; + if (!string.IsNullOrEmpty(textBox2.Text)) + { + cfg.Name = textBox2.Text; + } + cfg.Number = textBox3.Text; + cfg.Text = textBox4.Text; + cfg.OtherID = textBox8.Text; + cfg.OtherName = textBox9.Text; + cfg.OtherNumber = textBox10.Text; + cfg.OtherText = textBox11.Text; + cfg.ProcedureNumber = textBox5.Text; + cfg.SetID = textBox6.Text; + cfg.SetName = textBox7.Text; + } + _Apples.Add(cfg); bsApples.DataSource = null; bsApples.DataSource = _Apples; - lbApplicabilities.SelectedItem = cfg; - } + lbApplicabilities.SelectedItem = cfg; + lbApplicabilities_SelectedIndexChanged(sender, e); + + } private bool ApplicIsUsed(MiniConfig cfg) // B2017-230 - don't allow user to remove an applicability that is being used (specified) { diff --git a/PROMS/VEPROMS.CSLA.Library/Config/DocVersionConfig.cs b/PROMS/VEPROMS.CSLA.Library/Config/DocVersionConfig.cs index b2797317..876f711c 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/DocVersionConfig.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/DocVersionConfig.cs @@ -2291,7 +2291,7 @@ OnPropertyChanged("Default_BkColor"); public void RemoveSlave(int index) { XmlNode dd = _Xp.XmlContents.SelectSingleNode("//Slave[@index='" + index.ToString() + "']"); - dd.ParentNode.RemoveChild(dd); + dd?.ParentNode?.RemoveChild(dd); } public int MaxSlaveIndex { diff --git a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs index 6cf15ddd..c9a39132 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs @@ -1,14 +1,14 @@ +using Csla.Data; using System; using System.Collections.Generic; -using System.Text; using System.ComponentModel; -using System.Text.RegularExpressions; using System.Data; using System.Data.SqlClient; using System.Linq; +using System.Text; +using System.Text.RegularExpressions; using System.Threading; - -using Csla.Data; +using static System.Net.Mime.MediaTypeNames; namespace VEPROMS.CSLA.Library @@ -494,6 +494,8 @@ namespace VEPROMS.CSLA.Library { roid = FormatRoidKey(roid, true); + + string retval = GetRoChild(roid).value; if (string.IsNullOrEmpty(retval)) @@ -2162,7 +2164,7 @@ namespace VEPROMS.CSLA.Library return s2; s2 = s2.Replace(@"\u160?", ""); // convert hard spaces bug fix: B2016-206 - s2 = s2.Replace(@"\", @"\u9586?"); // convert backslashes to a backslash symbol + s2 = Regex.Replace(s2, @"\\(?!u)", @"\u9586?"); // convert backslashes to a backslash symbol s2 = s2.Replace("", @"\u160?"); // convert hard spaces bug fix: B2016-206 s2 = s2.Replace("`", @"\'b0"); // convert backquote to degree - left over from DOS days. s2 = s2.Replace("\xf8", @"\'b0"); // convert \xf8 to degree. diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index a7293be4..a2c4960e 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -3839,9 +3839,17 @@ namespace VEPROMS.CSLA.Library _SupInfos = null; } - //B2019-140 Change bars do not get refreshed when approval is run. - // Reset a Procedure and sub items in the cache - public static ProcedureInfo ResetProcedure(int procID) + //B2019-140 Change bars do not get refreshed when approval is run. + // Reset a Procedure and sub items in the cache + // ********************** + // Be carefull calling this when the Procedure is Open + // When the Procedure is Open - use StepTabRibbon.RefreshProcedure(); instead + // When a Procedure is open and you try to refresh it, + // events can fire behind the scenes - causing data to try to be accessed while you are trying to refresh it + // When This occurs, it will cause a + // "ThreadException ... Collection was modified; enumeration operation may not execute.” + // ********************** + public static ProcedureInfo ResetProcedure(int procID) { // The following lines reload the procedure info cache ProcedureInfo newproc = ProcedureInfo.Get(procID, true); @@ -3859,26 +3867,27 @@ namespace VEPROMS.CSLA.Library ItemInfo newprocitem = Get(procID, true); newprocitem.RefreshConfig(); - //Reload all the child/sub items + //Reload all the child/sub items #pragma warning disable S2971 // LINQ expressions should be simplified - need initial ToList to force enumeration - //otherwise will get a "Collection was modified; enumeration operation may not execute" error - List itemIDs = _CacheByPrimaryKey.Values.ToList().SelectMany(y => y).Where(t => t?.ActiveParent != null && (t.ActiveParent is ItemInfo) && t.MyProcedure.ItemID == procID).Select(x => (x.ActiveParent as ItemInfo).ItemID).Distinct().ToList(); + //otherwise will get a "Collection was modified; enumeration operation may not execute" error + List itemIDs = _CacheByPrimaryKey.SelectMany(kvp => kvp.Value).ToList().Where(t => t?.ActiveParent != null && (t.ActiveParent is ItemInfo) && t.MyProcedure.ItemID == procID).Select(x => (x.ActiveParent as ItemInfo).ItemID).Distinct().ToList(); #pragma warning restore S2971 // LINQ expressions should be simplified for (int index = 0; index < itemIDs.Count; index++) - { - ResetParts(itemIDs[index]); - } - - //reset the procedure config for all items attached to current procedure -#pragma warning disable S2971 // LINQ expressions should be simplified - need initial ToList to force enumeration - //otherwise will get a "Collection was modified; enumeration operation may not execute" error - List pconfigrefresh_items = _CacheByPrimaryKey.Values.ToList().SelectMany(y => y).Where(t => t?.MyProcedure?.ItemID == procID).Distinct().ToList(); -#pragma warning restore S2971 // LINQ expressions should be simplified - for (int index = 0; index < pconfigrefresh_items.Count; index++) { - pconfigrefresh_items[index].MyProcedure = newproc; + ResetParts(itemIDs[index]); } + //reset the procedure config for all items attached to current procedure +#pragma warning disable S2971 // LINQ expressions should be simplified - need initial ToList to force enumeration + //otherwise will get a "Collection was modified; enumeration operation may not execute" error + List pconfigrefresh_items = _CacheByPrimaryKey.SelectMany(kvp => kvp.Value).ToList().Where(t => t?.MyProcedure?.ItemID == procID).Distinct().ToList(); +#pragma warning restore S2971 // LINQ expressions should be simplified + for (int index = 0; index < pconfigrefresh_items.Count; index++) + { + pconfigrefresh_items[index].MyProcedure = newproc; + } + + //return the changed procedure info return newproc; } diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/RevisionInfoExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/RevisionInfoExt.cs index e3cc9d67..50b3b2d7 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/RevisionInfoExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/RevisionInfoExt.cs @@ -597,13 +597,6 @@ namespace VEPROMS.CSLA.Library //if (_RevisionInfoList != null) // return _RevisionInfoList; RevisionInfoList tmp = DataPortal.Fetch(new ItemUnitCriteria(itemID, unitID)); - - foreach (var x in tmp) - { - x.LatestVersion.ApprovedXML = x.RevisionID.ToString(); - x.LatestVersion.PDF = Encoding.ASCII.GetBytes(x.RevisionID.ToString()); - x.LatestVersion.SummaryPDF = Encoding.ASCII.GetBytes(x.RevisionID.ToString()); - } RevisionInfo.AddList(tmp); tmp.AddEvents(); //_RevisionInfoList = tmp; diff --git a/PROMS/VEPROMS.CSLA.Library/Minimal/ChangeBarAuditHistory.cs b/PROMS/VEPROMS.CSLA.Library/Minimal/ChangeBarAuditHistory.cs new file mode 100644 index 00000000..cf1be7b0 --- /dev/null +++ b/PROMS/VEPROMS.CSLA.Library/Minimal/ChangeBarAuditHistory.cs @@ -0,0 +1,72 @@ +using System; +using Csla.Data; +using System.Data; +using System.Data.SqlClient; + +//CSM - C2026-010 - Minimal Class for Managing Change Bar Audit History +namespace VEPROMS.CSLA.Library +{ + public static class ChangeBarAuditHistory + { + + #region Add Audit Record for ChangeBar History + public static void AddAudit(int itemID, string description, DateTime dts, string userID, int unitIndex) + { + try + { + using (SqlConnection cn = Database.VEPROMS_SqlConnection) + { + using (SqlCommand cm = cn.CreateCommand()) + { + cm.CommandType = CommandType.StoredProcedure; + cm.CommandText = "AddChangeBarAuditHistory"; + cm.Parameters.AddWithValue("@ItemID", itemID); + cm.Parameters.AddWithValue("@Description", description); + cm.Parameters.AddWithValue("@DTS", dts); + cm.Parameters.AddWithValue("@UserID", userID); + if (unitIndex != 0) cm.Parameters.AddWithValue("@UnitIndex", unitIndex); + + cm.CommandTimeout = 0; + cm.ExecuteNonQuery(); + } + } + } + catch (Exception ex) + { + throw new DbCslaException("Error in ChangeBarAuditHistory.AddAudit: ", ex); + } + } + + #endregion + + #region Get Change Bar Audit History + public static DataTable GetChangeBarAuditHistory(int itemID) + { + try + { + using (SqlConnection cn = Database.VEPROMS_SqlConnection) + { + using (SqlCommand cm = cn.CreateCommand()) + { + cm.CommandType = CommandType.StoredProcedure; + cm.CommandText = "GetChangeBarAuditHistoryByItem"; + cm.Parameters.AddWithValue("@ItemID", itemID); + cm.CommandTimeout = Database.DefaultTimeout; + using (SqlDataAdapter da = new SqlDataAdapter(cm)) + { + DataTable dt = new DataTable(); + da.Fill(dt); + return dt; + } + } + } + } + catch (Exception ex) + { + throw new DbCslaException("Error in ChangeBarAuditHistory.GetChangeBarAuditHistoryByItem: retrieving data failed", ex); + } + } + #endregion + + } +} diff --git a/PROMS/VEPROMS.CSLA.Library/Minimal/RevisionData.cs b/PROMS/VEPROMS.CSLA.Library/Minimal/RevisionData.cs new file mode 100644 index 00000000..df2fb5cc --- /dev/null +++ b/PROMS/VEPROMS.CSLA.Library/Minimal/RevisionData.cs @@ -0,0 +1,53 @@ +using Csla.Data; +using System; +using System.Data; +using System.Data.SqlClient; +using System.Linq; + +//CSM - C2026-009 - Minimal Class for Getting Revision Data +namespace VEPROMS.CSLA.Library +{ + public static class RevisionData + { + #region Check Data + //Check if Data Has Units + public static bool HasUnits(DataTable dt) => dt.AsEnumerable().Any(x => x.Field("UnitID") > 0); + + //Get Maximum Date Time Stamp + public static DateTime MaxDTS(DataTable dt) => dt.AsEnumerable().Max(x => x.Field("DTS")); + + #endregion + + #region Get Revision Data + //CSM - C2026-009 Get Current Revision Data by Unit + public static DataTable GetRevisionDataByUnit(int itemID) + { + try + { + using (SqlConnection cn = Database.VEPROMS_SqlConnection) + { + using (SqlCommand cm = cn.CreateCommand()) + { + cm.CommandType = CommandType.StoredProcedure; + cm.CommandText = "GetCurrentApprovedRevisions"; + cm.CommandTimeout = Database.DefaultTimeout; + cm.Parameters.AddWithValue("@ItemID", itemID); + + using (SqlDataAdapter da = new SqlDataAdapter(cm)) + { + DataTable dt = new DataTable(); + da.Fill(dt); + return dt; + } + } + } + } + catch (Exception ex) + { + throw new DbCslaException("Error in GetRevisionDataByUnit: retrieving data failed", ex); + } + } + #endregion + + } +} diff --git a/PROMS/VEPROMS.CSLA.Library/VEPROMS.CSLA.Library.csproj b/PROMS/VEPROMS.CSLA.Library/VEPROMS.CSLA.Library.csproj index b25089b2..1b9a09b2 100644 --- a/PROMS/VEPROMS.CSLA.Library/VEPROMS.CSLA.Library.csproj +++ b/PROMS/VEPROMS.CSLA.Library/VEPROMS.CSLA.Library.csproj @@ -389,8 +389,10 @@ + + diff --git a/PROMS/Volian.Controls.Library/CustomMessageBox.Designer.cs b/PROMS/Volian.Controls.Library/CustomMessageBox.Designer.cs index c804d557..0deb398b 100644 --- a/PROMS/Volian.Controls.Library/CustomMessageBox.Designer.cs +++ b/PROMS/Volian.Controls.Library/CustomMessageBox.Designer.cs @@ -31,25 +31,32 @@ this.btn1 = new System.Windows.Forms.Button(); this.btn2 = new System.Windows.Forms.Button(); this.lblMessage = new System.Windows.Forms.Label(); + this.tableLP1 = new System.Windows.Forms.TableLayoutPanel(); + this.tableLP1.SuspendLayout(); this.SuspendLayout(); // // btn1 // + this.btn1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btn1.AutoSize = true; - this.btn1.Location = new System.Drawing.Point(12, 99); + this.btn1.Location = new System.Drawing.Point(18, 102); + this.btn1.Margin = new System.Windows.Forms.Padding(10); + this.btn1.MinimumSize = new System.Drawing.Size(60, 20); this.btn1.Name = "btn1"; - this.btn1.Size = new System.Drawing.Size(75, 23); + this.btn1.Size = new System.Drawing.Size(60, 20); this.btn1.TabIndex = 0; this.btn1.UseVisualStyleBackColor = true; this.btn1.Click += new System.EventHandler(this.Btn1_Click); // // btn2 // - this.btn2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btn2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btn2.AutoSize = true; - this.btn2.Location = new System.Drawing.Point(322, 99); + this.btn2.Location = new System.Drawing.Point(335, 102); + this.btn2.Margin = new System.Windows.Forms.Padding(10); + this.btn2.MinimumSize = new System.Drawing.Size(60, 20); this.btn2.Name = "btn2"; - this.btn2.Size = new System.Drawing.Size(75, 23); + this.btn2.Size = new System.Drawing.Size(60, 20); this.btn2.TabIndex = 1; this.btn2.UseVisualStyleBackColor = true; this.btn2.Click += new System.EventHandler(this.Btn2_Click); @@ -57,24 +64,48 @@ // lblMessage // this.lblMessage.AutoSize = true; - this.lblMessage.Location = new System.Drawing.Point(33, 41); + this.tableLP1.SetColumnSpan(this.lblMessage, 2); + this.lblMessage.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblMessage.Location = new System.Drawing.Point(11, 8); + this.lblMessage.MaximumSize = new System.Drawing.Size(413, 0); this.lblMessage.Name = "lblMessage"; - this.lblMessage.Size = new System.Drawing.Size(0, 13); + this.lblMessage.Size = new System.Drawing.Size(391, 84); this.lblMessage.TabIndex = 2; this.lblMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // + // tableLP1 + // + this.tableLP1.AutoSize = true; + this.tableLP1.ColumnCount = 2; + this.tableLP1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLP1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLP1.Controls.Add(this.lblMessage, 0, 0); + this.tableLP1.Controls.Add(this.btn1); + this.tableLP1.Controls.Add(this.btn2); + this.tableLP1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLP1.Location = new System.Drawing.Point(0, 0); + this.tableLP1.MaximumSize = new System.Drawing.Size(413, 0); + this.tableLP1.MinimumSize = new System.Drawing.Size(413, 130); + this.tableLP1.Name = "tableLP1"; + this.tableLP1.Padding = new System.Windows.Forms.Padding(8); + this.tableLP1.RowCount = 2; + this.tableLP1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLP1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); + this.tableLP1.Size = new System.Drawing.Size(413, 130); + this.tableLP1.TabIndex = 0; + // // CustomMessageBox // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoSize = true; this.ClientSize = new System.Drawing.Size(419, 130); - this.Controls.Add(this.lblMessage); - this.Controls.Add(this.btn2); - this.Controls.Add(this.btn1); + this.Controls.Add(this.tableLP1); this.Name = "CustomMessageBox"; this.ShowIcon = false; this.Text = "CustomMessageBox"; + this.tableLP1.ResumeLayout(false); + this.tableLP1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -85,5 +116,6 @@ private System.Windows.Forms.Button btn1; private System.Windows.Forms.Button btn2; private System.Windows.Forms.Label lblMessage; + private System.Windows.Forms.TableLayoutPanel tableLP1; } } \ No newline at end of file diff --git a/PROMS/Volian.Controls.Library/CustomMessageBox.cs b/PROMS/Volian.Controls.Library/CustomMessageBox.cs index 3a42d5e7..a16a59d1 100644 --- a/PROMS/Volian.Controls.Library/CustomMessageBox.cs +++ b/PROMS/Volian.Controls.Library/CustomMessageBox.cs @@ -27,6 +27,10 @@ namespace Volian.Controls.Library { btn2.Text = button2Text; btn2.Visible = true; + + //make buttons uniform + btn1.Height = btn2.Height = btn1.Height > btn2.Height ? btn1.Height : btn2.Height; + btn1.Width = btn2.Width = btn1.Width > btn2.Width ? btn1.Width : btn2.Width; } else { diff --git a/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs b/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs index 9a7f4920..74a354b4 100644 --- a/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs +++ b/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs @@ -1,3 +1,6 @@ +using System.Security.Cryptography; +using VEPROMS.CSLA.Library; + namespace Volian.Controls.Library { partial class DisplayApplicability @@ -20,6 +23,7 @@ namespace Volian.Controls.Library base.Dispose(disposing); } + #region Component Designer generated code /// @@ -30,19 +34,41 @@ namespace Volian.Controls.Library { this.gpMode = new DevComponents.DotNetBar.Controls.GroupPanel(); this.gpItem = new DevComponents.DotNetBar.Controls.GroupPanel(); + this.btnApplicabilitychg2 = new DevComponents.DotNetBar.ButtonItem(); + this.btnApplicabilitychg = new DevComponents.DotNetBar.ButtonX(); + this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip(); + this.gpItem.SuspendLayout(); this.SuspendLayout(); // + // btnApplicabilitychg + // + this.btnApplicabilitychg.Location = new System.Drawing.Point(60, 8); + this.btnApplicabilitychg.Margin = new System.Windows.Forms.Padding(4); + this.btnApplicabilitychg.BackColor = System.Drawing.SystemColors.Control; + this.btnApplicabilitychg.Name = "btnApplicabilitychg"; + this.btnApplicabilitychg.Size = new System.Drawing.Size(80, 22); + this.btnApplicabilitychg.Margin = new System.Windows.Forms.Padding(2); + this.btnApplicabilitychg.RightToLeft = System.Windows.Forms.RightToLeft.No; + this.superTooltip1.SetSuperTooltip(this.btnApplicabilitychg, new DevComponents.DotNetBar.SuperTooltipInfo("Change applicability settings - All At Level", "", "When clicked, all steps at the level of the current step will have their applicability settings changed.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); + this.btnApplicabilitychg.TabIndex = 0; + this.btnApplicabilitychg.Text = "Set All at Level"; + this.btnApplicabilitychg.ColorTable = DevComponents.DotNetBar.eButtonColor.BlueOrb; + this.btnApplicabilitychg.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnApplicabilitychg.Click += new System.EventHandler(this.BtnApplicabilitychg_Click); + // // gpMode // this.gpMode.AutoSize = true; this.gpMode.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.gpMode.CanvasColor = System.Drawing.SystemColors.Control; this.gpMode.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; + this.gpMode.DisabledBackColor = System.Drawing.Color.Empty; this.gpMode.Dock = System.Windows.Forms.DockStyle.Top; this.gpMode.Location = new System.Drawing.Point(0, 0); + this.gpMode.Margin = new System.Windows.Forms.Padding(4); this.gpMode.Name = "gpMode"; - this.gpMode.Padding = new System.Windows.Forms.Padding(10, 10, 10, 30); - this.gpMode.Size = new System.Drawing.Size(324, 40); + this.gpMode.Padding = new System.Windows.Forms.Padding(13, 12, 13, 37); + this.gpMode.Size = new System.Drawing.Size(432, 49); // // // @@ -58,7 +84,6 @@ namespace Volian.Controls.Library this.gpMode.Style.BorderRightWidth = 1; this.gpMode.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; this.gpMode.Style.BorderTopWidth = 1; - this.gpMode.Style.Class = ""; this.gpMode.Style.CornerDiameter = 4; this.gpMode.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; this.gpMode.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; @@ -67,12 +92,10 @@ namespace Volian.Controls.Library // // // - this.gpMode.StyleMouseDown.Class = ""; this.gpMode.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; // // // - this.gpMode.StyleMouseOver.Class = ""; this.gpMode.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.gpMode.TabIndex = 0; this.gpMode.Text = "Viewing Mode"; @@ -83,11 +106,14 @@ namespace Volian.Controls.Library this.gpItem.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.gpItem.CanvasColor = System.Drawing.SystemColors.Control; this.gpItem.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; + //this.gpItem.Controls.Add(this.btnApplicabilitychg); + this.gpItem.DisabledBackColor = System.Drawing.Color.Empty; this.gpItem.Dock = System.Windows.Forms.DockStyle.Top; - this.gpItem.Location = new System.Drawing.Point(0, 40); + this.gpItem.Location = new System.Drawing.Point(0, 49); + this.gpItem.Margin = new System.Windows.Forms.Padding(4); this.gpItem.Name = "gpItem"; - this.gpItem.Padding = new System.Windows.Forms.Padding(10, 10, 10, 30); - this.gpItem.Size = new System.Drawing.Size(324, 40); + this.gpItem.Padding = new System.Windows.Forms.Padding(13, 12, 13, 37); + this.gpItem.Size = new System.Drawing.Size(432, 85); // // // @@ -103,7 +129,6 @@ namespace Volian.Controls.Library this.gpItem.Style.BorderRightWidth = 1; this.gpItem.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; this.gpItem.Style.BorderTopWidth = 1; - this.gpItem.Style.Class = ""; this.gpItem.Style.CornerDiameter = 4; this.gpItem.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; this.gpItem.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; @@ -112,26 +137,31 @@ namespace Volian.Controls.Library // // // - this.gpItem.StyleMouseDown.Class = ""; this.gpItem.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; // // // - this.gpItem.StyleMouseOver.Class = ""; this.gpItem.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.gpItem.TabIndex = 1; this.gpItem.Text = "Item Mode"; // // DisplayApplicability // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.gpItem); this.Controls.Add(this.gpMode); + this.Margin = new System.Windows.Forms.Padding(4); this.Name = "DisplayApplicability"; - this.Size = new System.Drawing.Size(324, 656); + this.Size = new System.Drawing.Size(432, 807); + this.gpItem.ResumeLayout(false); this.ResumeLayout(false); - this.PerformLayout(); + this.PerformLayout(); + // + // superTooltip1 + // + this.superTooltip1.DefaultTooltipSettings = new DevComponents.DotNetBar.SuperTooltipInfo("", "", "", null, null, DevComponents.DotNetBar.eTooltipColor.Gray); + this.superTooltip1.LicenseKey = "F962CEC7-CD8F-4911-A9E9-CAB39962FC1F"; } @@ -139,6 +169,9 @@ namespace Volian.Controls.Library private DevComponents.DotNetBar.Controls.GroupPanel gpMode; private DevComponents.DotNetBar.Controls.GroupPanel gpItem; + private DevComponents.DotNetBar.ButtonItem btnApplicabilitychg2; + private DevComponents.DotNetBar.ButtonX btnApplicabilitychg; + private DevComponents.DotNetBar.SuperTooltip superTooltip1; } } diff --git a/PROMS/Volian.Controls.Library/DisplayApplicability.cs b/PROMS/Volian.Controls.Library/DisplayApplicability.cs index a5869b64..48b7003e 100644 --- a/PROMS/Volian.Controls.Library/DisplayApplicability.cs +++ b/PROMS/Volian.Controls.Library/DisplayApplicability.cs @@ -1,12 +1,14 @@ +using JR.Utils.GUI.Forms; +using log4net.Util; using System; using System.Collections.Generic; using System.ComponentModel; -using System.Drawing; using System.Data; +using System.Drawing; +using System.Linq; using System.Text; using System.Windows.Forms; using VEPROMS.CSLA.Library; -using JR.Utils.GUI.Forms; namespace Volian.Controls.Library { @@ -51,15 +53,22 @@ namespace Volian.Controls.Library i++; AddViewMode(name.Trim(), i.ToString(), apple == i); } + AddItemMode("All", "-1"); i = 0; foreach (string name in names) AddItemMode(name.Trim(), (++i).ToString()); AddItemMode("None", "0"); + gpItem.Controls.Add(btnApplicabilitychg); + btnApplicabilitychg.BringToFront(); if (_MyDisplayTabItem.MyStepTabPanel != null) + { MyItemInfo = _MyDisplayTabItem.MyStepTabPanel.MyStepPanel.SelectedItemInfo; + } else + { MyItemInfo = _MyDisplayTabItem.MyItemInfo; + } } } } @@ -175,7 +184,8 @@ namespace Volian.Controls.Library } break; } - WireCheckboxes(); + + WireCheckboxes(); MyApplicability = string.Empty; string sep = string.Empty; foreach (int i in MyCheckBoxes.Keys) @@ -216,8 +226,8 @@ namespace Volian.Controls.Library // return internal and external for the procedure level) if ((!MyItemInfo.IsProcedure && invalidTrans.Count == 0) || IsProcWithNoExternalTrans(MyItemInfo, invalidTrans)) { - // C2021 - 027: Procedure level PC/PC - if (MyItemInfo.IsProcedure && MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ProcAppl) + // C2021 - 027: Procedure level PC/PC + if (MyItemInfo.IsProcedure && MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ProcAppl) { ProcedureConfig sc = MyItemInfo.MyConfig as ProcedureConfig; sc.MasterSlave_Applicability = Volian.Base.Library.BigNum.MakeBigNum(MyApplicability); @@ -270,8 +280,61 @@ namespace Volian.Controls.Library // s.Save(); //} } - // B2021-149: for procedure, only consider external transitions as invalid - private bool IsProcWithNoExternalTrans(ItemInfo ii, List invalidTrans) + private void BtnApplicabilitychg_Click(object sender, System.EventArgs e) + { + Volian.Base.Library.BigNum MasterSlave_ApplicabilityTmp; + StepConfig sc = MyItemInfo.MyConfig as StepConfig; + MasterSlave_ApplicabilityTmp = sc.MasterSlave_Applicability; + StringBuilder sb = new StringBuilder(); + + + ItemInfo startitm = MyItemInfo.FirstSibling; + while (startitm != null) + { + + // C2026-023: Check for Transitions when setting Applicability to all for a level + List invalidTrans = WillTransitionsBeValidCommand.Execute(startitm.ItemID, MasterSlave_ApplicabilityTmp.ToString()); + if (IsProcWithNoExternalTrans(startitm, invalidTrans)) + { + StepConfig sc2 = startitm.MyConfig as StepConfig; + using (Content cnt = Content.Get(startitm.MyContent.ContentID)) + { + sc2.MasterSlave_Applicability = (MasterSlave_ApplicabilityTmp); + cnt.Config = sc2.ToString(); + cnt.Save(); + } + } + else + { + if (sb.Length == 0) + { + sb.AppendLine("The applicability for some Step(s) cannot be changed due to transition links."); + sb.AppendLine("Applicability settings for these steps will return to original settings when OK is selected."); + sb.AppendLine("Changing the applicability for would invalidate a transition in the following steps:"); + sb.AppendLine(); + } + + foreach (InvalidTransition inv in invalidTrans.Where(x => !x.TgtStep.StartsWith(x.SrcStep))) + { + sb.AppendLine(string.Format("{0} : From {1} to {2}.", startitm.MyTab.CleanTextNoSymbols.Trim(), inv.TgtStep, inv.SrcStep)); + } + + invalidTrans.Clear(); + } + + startitm = startitm.GetNext(); + } + + _MyDisplayTabItem.MyStepTabPanel.MyStepTabRibbon.RefreshProcedure(); + + if (sb.Length > 0) + FlexibleMessageBox.Show(sb.ToString(), "Transitions Affected By Applicability Change"); + + + } + + // B2021-149: for procedure, only consider external transitions as invalid + private bool IsProcWithNoExternalTrans(ItemInfo ii, List invalidTrans) { if (invalidTrans.Count == 0) return true; foreach (InvalidTransition iT in invalidTrans) diff --git a/PROMS/Volian.Controls.Library/DisplayHistory.cs b/PROMS/Volian.Controls.Library/DisplayHistory.cs index a190e4f7..e00facf0 100644 --- a/PROMS/Volian.Controls.Library/DisplayHistory.cs +++ b/PROMS/Volian.Controls.Library/DisplayHistory.cs @@ -56,7 +56,20 @@ namespace Volian.Controls.Library set { if (DesignMode) return; // B2019-043 need to check if we are just saving changes to the user interface - if (value is ProcedureInfo && _MyProcedureInfo is ProcedureInfo && value.ItemID == _MyProcedureInfo.ItemID) + + //CSM - C2026-010 - Set/Show Change Bar Audit History + if (value != null) + { + lbChangeBarHistory.DataSource = ChangeBarAuditHistory.GetChangeBarAuditHistory(value.ItemID); + lbChangeBarHistory.ValueMember = "AuditID"; + lbChangeBarHistory.DisplayMember = "Text"; + } + else + { + lbChangeBarHistory.DataSource = null; + } + + if (value is ProcedureInfo && _MyProcedureInfo is ProcedureInfo && value.ItemID == _MyProcedureInfo.ItemID) return; _MyProcedureInfo = value; if (value == null) return; @@ -184,6 +197,15 @@ namespace Volian.Controls.Library InitializeComponent(); myRTB.FormatFont = null; RefreshRequired = true; + + if (MyProcedureInfo != null) + { + lbChangeBarHistory.DataSource = ChangeBarAuditHistory.GetChangeBarAuditHistory(MyProcedureInfo.ItemID); + } + else + { + lbChangeBarHistory.DataSource = null; + } } private void lbChanges_VisibleChanged(object sender, System.EventArgs e) @@ -1075,7 +1097,25 @@ namespace Volian.Controls.Library { tvAudits.Height = ((tcpDetail.Height - btnRestore.Height) / 4) * 3; } - public void RefreshChangeList() + + //CSM - C2026-010 - Set/Show Change Bar Audit History + //Display a Tooltip for what was in the list + private void LbChangeBarHistory_MouseMove(object sender, MouseEventArgs e) + { + // Just use the item's value for the tooltip. + int index = lbChangeBarHistory.IndexFromPoint(e.Location); + + if (index != ListBox.NoMatches) + { + DataRow rw = (lbChangeBarHistory.Items[index] as DataRowView)?.Row; + + // Display the item's value as a tooltip. + if (tipCBHistory.GetToolTip(lbChangeBarHistory) != rw["Text"].ToString()) + tipCBHistory.SetToolTip(lbChangeBarHistory, rw["Text"].ToString()); + } + } + + public void RefreshChangeList() { myTimer.Enabled = false; myTimer.Enabled = true; diff --git a/PROMS/Volian.Controls.Library/DisplayHistory.designer.cs b/PROMS/Volian.Controls.Library/DisplayHistory.designer.cs index a7c9d046..5740460f 100644 Binary files a/PROMS/Volian.Controls.Library/DisplayHistory.designer.cs and b/PROMS/Volian.Controls.Library/DisplayHistory.designer.cs differ diff --git a/PROMS/Volian.Controls.Library/DisplayHistory.resx b/PROMS/Volian.Controls.Library/DisplayHistory.resx index 28034095..f248cb6d 100644 --- a/PROMS/Volian.Controls.Library/DisplayHistory.resx +++ b/PROMS/Volian.Controls.Library/DisplayHistory.resx @@ -188,4 +188,7 @@ 17, 17 + + 119, 17 + \ No newline at end of file diff --git a/PROMS/Volian.Controls.Library/DisplayRO.Designer.cs b/PROMS/Volian.Controls.Library/DisplayRO.Designer.cs index 2e0f231d..77f45d7f 100644 --- a/PROMS/Volian.Controls.Library/DisplayRO.Designer.cs +++ b/PROMS/Volian.Controls.Library/DisplayRO.Designer.cs @@ -81,7 +81,7 @@ namespace Volian.Controls.Library this.lbROId.Dock = System.Windows.Forms.DockStyle.Left; this.lbROId.ForeColor = System.Drawing.SystemColors.Highlight; this.lbROId.Location = new System.Drawing.Point(48, 24); - this.lbROId.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.lbROId.Margin = new System.Windows.Forms.Padding(2); this.lbROId.Name = "lbROId"; this.lbROId.Size = new System.Drawing.Size(183, 33); this.superTooltip1.SetSuperTooltip(this.lbROId, new DevComponents.DotNetBar.SuperTooltipInfo("RO ID", "", "The RO ID for the selected RO Value will be displayed here. Double-Click to open" + @@ -97,7 +97,7 @@ namespace Volian.Controls.Library this.lblROID.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.lblROID.Dock = System.Windows.Forms.DockStyle.Left; this.lblROID.Location = new System.Drawing.Point(0, 24); - this.lblROID.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.lblROID.Margin = new System.Windows.Forms.Padding(2); this.lblROID.Name = "lblROID"; this.lblROID.Size = new System.Drawing.Size(48, 33); this.superTooltip1.SetSuperTooltip(this.lblROID, new DevComponents.DotNetBar.SuperTooltipInfo("RO ID", "", "The RO ID for the selected RO Value will be displayed here.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(150, 80))); @@ -139,7 +139,7 @@ namespace Volian.Controls.Library this.btnGoToRO.Dock = System.Windows.Forms.DockStyle.Top; this.btnGoToRO.Enabled = false; this.btnGoToRO.Location = new System.Drawing.Point(0, 55); - this.btnGoToRO.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.btnGoToRO.Margin = new System.Windows.Forms.Padding(2); this.btnGoToRO.Name = "btnGoToRO"; this.btnGoToRO.Size = new System.Drawing.Size(233, 18); this.btnGoToRO.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -155,7 +155,7 @@ namespace Volian.Controls.Library this.btnPreviewRO.Dock = System.Windows.Forms.DockStyle.Top; this.btnPreviewRO.Enabled = false; this.btnPreviewRO.Location = new System.Drawing.Point(0, 37); - this.btnPreviewRO.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.btnPreviewRO.Margin = new System.Windows.Forms.Padding(2); this.btnPreviewRO.Name = "btnPreviewRO"; this.btnPreviewRO.Size = new System.Drawing.Size(233, 18); this.superTooltip1.SetSuperTooltip(this.btnPreviewRO, new DevComponents.DotNetBar.SuperTooltipInfo("Preview", "", "This will Preview the selected RO Table, X/Y Plot, or Image.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(150, 80))); @@ -263,6 +263,7 @@ namespace Volian.Controls.Library this.Controls.Add(this.tvROFST); this.Controls.Add(this.lbFound); this.Controls.Add(this.panelValue); + this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "DisplayRO"; this.Size = new System.Drawing.Size(233, 507); this.panelValue.ResumeLayout(false); diff --git a/PROMS/Volian.Controls.Library/DisplayRO.cs b/PROMS/Volian.Controls.Library/DisplayRO.cs index 038a258e..c1f7725e 100644 --- a/PROMS/Volian.Controls.Library/DisplayRO.cs +++ b/PROMS/Volian.Controls.Library/DisplayRO.cs @@ -1,18 +1,18 @@ +using DevComponents.DotNetBar; +using JR.Utils.GUI.Forms; using System; using System.Collections.Generic; using System.ComponentModel; -using System.Drawing; using System.Data; -using System.Text; +using System.Drawing; using System.IO; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; using System.Windows.Forms; using VEPROMS.CSLA.Library; -using XYPlots; -using DevComponents.DotNetBar; -using System.Text.RegularExpressions; using Volian.Base.Library; -using JR.Utils.GUI.Forms; -using System.Linq; +using XYPlots; namespace Volian.Controls.Library { @@ -379,6 +379,7 @@ namespace Volian.Controls.Library if (chld.value != null) { + chld.value = Regex.Replace(chld.value, @"\\u([0-9]{1,4})\?", m => int.TryParse(m?.Groups[1]?.Value, out int result) ? Convert.ToChar(result).ToString() : ""); RoUsageInfo SavROLink = null; if (_savCurROLink != null) SavROLink = _savCurROLink; @@ -770,9 +771,15 @@ namespace Volian.Controls.Library } else { + tmp = new TreeNode(roc.title); tmp.Tag = roc; + if (tmp.Text.IndexOf("\\u") > -1) // RO Editor add symbols C2022 - 003 + { + tmp.Text = Regex.Replace(tmp.Text, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString()); + } + if (roc.roid.Length == 16) { tn.Nodes.Add(tmp); @@ -921,11 +928,12 @@ namespace Volian.Controls.Library // Pad to 16 to store in the RoUsage table. string padroid = ROFSTLookup.FormatRoidKey(roc.roid, true); string linktxt = string.Format(@"#Link:ReferencedObject: {0} {1}", padroid, MyROFST.RODbID); - - // Resolve symbols and scientific notation in the RO return value - string valtxt = MyROFSTLookup.GetTranslatedRoValue(padroid, MyRTB.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta, MyRTB.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseTildaPoundCharsForSuperSubScriptInROValues, false, MyRTB.MyItemInfo); - MyRTB.OnRoInsert(this, new StepRTBRoEventArgs(valtxt, selectedChld.value, linktxt, padroid, MyROFST.RODbID)); + // Resolve symbols and scientific notation in the RO return value + string valtxt = MyROFSTLookup.GetTranslatedRoValue(padroid, MyRTB.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta, MyRTB.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseTildaPoundCharsForSuperSubScriptInROValues, false, MyRTB.MyItemInfo); + + MyRTB.OnRoInsert(this, new StepRTBRoEventArgs(valtxt, selectedChld.value, linktxt, padroid, MyROFST.RODbID)); + } } @@ -1166,3 +1174,4 @@ namespace Volian.Controls.Library #endregion } } + diff --git a/PROMS/Volian.Controls.Library/DisplayRO.resx b/PROMS/Volian.Controls.Library/DisplayRO.resx index f24ecbca..c838cbe9 100644 --- a/PROMS/Volian.Controls.Library/DisplayRO.resx +++ b/PROMS/Volian.Controls.Library/DisplayRO.resx @@ -112,20 +112,12 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + 17, 17 - - For Step Editor sections: -- This will place the selected RO at the cursor position. -- This will replace an RO with the selected RO. - -For Word sections -- This will place the needed RO ID on the clipboard. - \ No newline at end of file diff --git a/PROMS/Volian.Controls.Library/EditItem.cs b/PROMS/Volian.Controls.Library/EditItem.cs index c0fec876..a8c0c8ba 100644 --- a/PROMS/Volian.Controls.Library/EditItem.cs +++ b/PROMS/Volian.Controls.Library/EditItem.cs @@ -4162,8 +4162,11 @@ namespace Volian.Controls.Library } void MyConfig_PropertyChanged(object sender, PropertyChangedEventArgs e) { - SaveConfig(); - } + //B2026-024 Change bars should not show when updating Applicability. + if (e.PropertyName == "MasterSlave_Applicability") ChangeBarForConfigItemChange = false; + SaveConfig(); + if (e.PropertyName == "MasterSlave_Applicability") ChangeBarForConfigItemChange = true; + } public void SaveConfig() { if (!MyItemInfo.MyConfig.IsDirty) return; diff --git a/PROMS/Volian.Controls.Library/StepRTB.cs b/PROMS/Volian.Controls.Library/StepRTB.cs index cc20f092..c0661359 100644 --- a/PROMS/Volian.Controls.Library/StepRTB.cs +++ b/PROMS/Volian.Controls.Library/StepRTB.cs @@ -1400,9 +1400,13 @@ namespace Volian.Controls.Library if (SelectionLength > 0)HandleDeleteKeyWithSelectedText(new KeyEventArgs(Keys.None), null); int position = SelectionStart; SelectionLength = 0; - linkValue = linkValue.Replace("\\u8209?", "\\f1\\u8209?\\f0 "); - linkValue = linkValue.Replace("\\u9586?", "\\f1\\u9586?\\f0 "); // backslash symbol - linkValue = linkValue.Replace("\\u916?", "\\f1\\u916?\\f0 "); + + var pattern = @"\\u([0-9]{1,4})\?"; // RO Editor add symbols C2022 - 003 + foreach (Match match in Regex.Matches(linkValue, pattern, RegexOptions.IgnoreCase)) + { + linkValue = linkValue.Replace(match.Value, "\\f1 " + match.Value + "\\f0"); + } + linkValue = linkValue.Replace(@"{", @"\{"); linkValue = linkValue.Replace(@"}", @"\}"); SelectedRtf = @"{\rtf1\ansi" + FontTable + @"{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;}\v" + FontSize + @" \v0 }"; diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index 7c5583b4..06f8474e 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -1668,7 +1668,19 @@ namespace Volian.Controls.Library } Clipboard.Clear(); - Clipboard.SetDataObject(myDO); // this saves the cleaned up information to the Windows clipboard + //Try to update the data object to persist beyond PROMS life + //if can't, log it and use old method of scoping clipboard to PROMS life + try + { + // noticed that sometimes the clipboard will get stuck - so set it to retry twice + // and if it fails, scope the clipboard to within PROMS + Clipboard.SetDataObject(myDO, true, 2, 100); // this saves the cleaned up information to the Windows clipboard + } + catch (System.Runtime.InteropServices.ExternalException ex) + { + _MyLog.Warn($"Error Setting Clipboard Object to Persist beyond PROMS. Clipboard will be scoped to PROMS. Error:{ex.Message}"); + Clipboard.SetDataObject(myDO); // this saves the cleaned up information to the Windows clipboard + } } iData = Clipboard.GetDataObject(); bool noEquationData = true; diff --git a/PROMS/Volian.Controls.Library/Volian.Controls.Library.csproj b/PROMS/Volian.Controls.Library/Volian.Controls.Library.csproj index bb704d34..c840ed21 100644 --- a/PROMS/Volian.Controls.Library/Volian.Controls.Library.csproj +++ b/PROMS/Volian.Controls.Library/Volian.Controls.Library.csproj @@ -462,6 +462,7 @@ CustomMessageBox.cs + Designer DisplayBookMarks.cs diff --git a/PROMS/Volian.Controls.Library/vlnTreeView.cs b/PROMS/Volian.Controls.Library/vlnTreeView.cs index 73889378..12fabd03 100644 --- a/PROMS/Volian.Controls.Library/vlnTreeView.cs +++ b/PROMS/Volian.Controls.Library/vlnTreeView.cs @@ -1601,12 +1601,11 @@ namespace Volian.Controls.Library //B2024-024 create import file for parent/child procedure set void MultiUnitImportProcedure_Click(object sender, EventArgs e) { - //RevisionInfo ri = (sender as MenuItem).Tag as RevisionInfo; RevisionInfo ri = RevisionInfo.Get(int.Parse((sender as MenuItem).Tag.ToString())); RevisionConfig rc = ri.MyConfig as RevisionConfig; // bug fix: B2016-183 - add the child's name (ex Unit 1) to the export file name for Parent/Child procedures. int applIdx = rc.Applicability_Index; - string str = (applIdx > 0) ? _currentPri.MyDocVersion.UnitNames[applIdx - 1] + "_" : ""; // if parent/child get the defined child name to inlcude the export filename + string str = (applIdx > 0) ? _currentPri.MyDocVersion.UnitNames[applIdx - 1] + "_" : ""; // if parent/child get the defined child name to include the export filename System.Xml.XmlDocument xd = new System.Xml.XmlDocument(); xd.LoadXml(ri.LatestVersion.ApprovedXML); string PEIPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\PEI_" + Database.VEPROMS_SqlConnection.Database; @@ -1615,8 +1614,13 @@ namespace Volian.Controls.Library // B2022-048: Crash when creating Procedure to Import from versions. Couldn't handle '/' in proc number. string fNametmp = xd.SelectSingleNode("procedure/content/@number").InnerText.Replace(" ", "_").Replace(@"\u8209?", "-").Replace(@"\u9586?", "_").Replace("/", "-") + ".pxml"; // B2022-112: If applicability, need to resolve the '<' and '>' characters. Just use the UnitNames, i.e. str, from above. - if (applIdx > 0) fNametmp = Regex.Replace(fNametmp, @"\", str, RegexOptions.IgnoreCase); - string fileName = PEIPath + "\\" + str + "Approved_Rev_" + ri.RevisionNumber.Replace(" ", "_").Replace("\\", "-").Replace("/", "-") + "_" + fNametmp; + if (applIdx > 0) + { + fNametmp = Regex.Replace(fNametmp, @"\", str, RegexOptions.IgnoreCase); + fNametmp = Regex.Replace(fNametmp, @"\", str, RegexOptions.IgnoreCase); + } + + string fileName = PEIPath + "\\" + str + "Approved_Rev_" + ri.RevisionNumber.Replace(" ", "_").Replace("\\", "-").Replace("/", "-") + "_" + fNametmp; xd.Save(fileName); FlexibleMessageBox.Show("Approved procedure saved to import file " + fileName, "Creating Export of Approved Procedure", MessageBoxButtons.OK, MessageBoxIcon.Information); }