diff --git a/PROMS/Volian.Controls.Library/DisplayRO.cs b/PROMS/Volian.Controls.Library/DisplayRO.cs index b20041f9..c8373f37 100644 --- a/PROMS/Volian.Controls.Library/DisplayRO.cs +++ b/PROMS/Volian.Controls.Library/DisplayRO.cs @@ -246,6 +246,19 @@ namespace Volian.Controls.Library { LoadChildren(e.Node); } + private E_ROValueType _ROTypeFilter = E_ROValueType.All; + + public E_ROValueType ROTypeFilter + { + get { return _ROTypeFilter; } + set + { + _ROTypeFilter = value; + LoadTree(); + } + } + private E_ROValueType _CurrentROTypeFilter = E_ROValueType.All; + private void LoadChildren(TreeNode tn) { object tag = tn.Tag; @@ -282,6 +295,8 @@ namespace Volian.Controls.Library // TODO: KBR how to handle this? //Console.WriteLine("ro junk"); continue; + else if (ROTypeFilter != E_ROValueType.All && (chld[i].type & (uint)ROTypeFilter) == 0) + continue; // ignore if does not match filter else if (/*chld[i].type == 1 && */ chld[i].value == null) { tmp = new TreeNode(chld[i].title); @@ -357,9 +372,10 @@ namespace Volian.Controls.Library private void LoadTree() { if (_MyROFST == null) return; - if (_MyROFST == _CurROFST) return; + if (_MyROFST == _CurROFST && ROTypeFilter == _CurrentROTypeFilter) return; tvROFST.Nodes.Clear(); _CurROFST = _MyROFST; + _CurrentROTypeFilter = ROTypeFilter; for (int i = 0; i < _MyROFST.ROFSTLookup.myHdr.myDbs.Length; i++) { TreeNode tn = new TreeNode(_MyROFST.ROFSTLookup.myHdr.myDbs[i].dbiTitle); @@ -494,50 +510,22 @@ namespace Volian.Controls.Library } else if (MyRTB != null) // a Procedure Steps section tab is active { - MyRTB.inRoAdd = true; if (CheckROSelection(roch)) // check for RO type is valid for this type of step/substep { - //int ss = MyRTB.SelectionStart; // the roid may be 12 or 16 chars long, with the last 4 set if there is unit specific // menuing. Pad to 12 to store in the rousage table. string padroid = (roch.roid.Length <= 12) ? roch.roid + "0000" : roch.roid; string linktxt = string.Format(@"#Link:ReferencedObject: {0} {1}", padroid, _MyROFST.MyRODb.RODbID); // Resolve symbols and scientific notation in the RO return value string valtxt = ConvertSymbolsAndStuff(selectedChld.value); - int ss = MyRTB.SelectionStart; // Remember where the link is being added - int sl = MyRTB.SelectionLength; - MyRTB.OnReturnToEditor(this, new EventArgs()); - MyRTB.Select(ss, sl); - MyRTB.InsertRO(valtxt, linktxt); // Insert the LINK - MyRTB.OnDoSaveContents(this, new EventArgs()); // .SaveText(); // Save the text with the LINK - This also moves the cursor to the end of the text - // By selecting a starting position within a link, StepRTB (HandleSelectionChange) will select the link - MyRTB.Select(ss + 7 + valtxt.Length , 0);// Select the link, Try 7 for "", accPrefix, roch.appid); - // //TODO: CAN WE AUTOMATICALLY PLACE RO ONTO WORD ATTACHEMNT? - // //if (MessageBox.Show(AccPageID,"Place on Windows Clipboard?",MessageBoxButtons.YesNo) == DialogResult.Yes) - // // Clipboard.SetText(AccPageID); - // if (dti.MyDSOTabPanel != null) - // dti.MyDSOTabPanel.InsertText(AccPageID); - //} } } - private bool CheckROSelection(ROFSTLookup.rochild selectedRO) { bool goodToGo = true; diff --git a/PROMS/Volian.Controls.Library/DisplayTabControl.cs b/PROMS/Volian.Controls.Library/DisplayTabControl.cs index 8e85eb09..135987a7 100644 --- a/PROMS/Volian.Controls.Library/DisplayTabControl.cs +++ b/PROMS/Volian.Controls.Library/DisplayTabControl.cs @@ -398,7 +398,7 @@ namespace Volian.Controls.Library edtitm.AddSiblingAfter(text,updateSelection); break; case E_InsertType.Child: - edtitm.AddChild(text, fromType, type); + edtitm.AddChild(text, fromType, type, null); break; default: return false; ;