Compare commits

..

2 Commits

Author SHA1 Message Date
b7aa85f4fc C2019-025_Ability-to-Toggle-Replace-Words-3 2025-01-30 09:22:51 -05:00
90e25f3fcf C2019-025_Ability-to-Toggle-Replace-Words-3 2025-01-30 09:09:39 -05:00
2 changed files with 16 additions and 50 deletions

View File

@@ -12,6 +12,12 @@ using JR.Utils.GUI.Forms;
namespace VEPROMS.CSLA.Library namespace VEPROMS.CSLA.Library
{ {
public enum E_FieldToEdit { StepText, Text, Number, PSI }; public enum E_FieldToEdit { StepText, Text, Number, PSI };
public enum ReplaceWords
{
Inherit = 0,
Show = 1,
DoNotShow = 2
}
public class DisplayText public class DisplayText
{ {
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
@@ -55,21 +61,20 @@ namespace VEPROMS.CSLA.Library
if (sc == null) return "N"; if (sc == null) return "N";
return sc.Section_ShwRplWords; return sc.Section_ShwRplWords;
} }
// C2019-025 c2025-010 Ability-to-Toggle-Replace-Words
// C2029-025 Show or hide replace words. Can highlight replace words in editor.
private bool ShwRplWdsIndex(ItemInfo _MyItemInfo) private bool ShwRplWdsIndex(ItemInfo _MyItemInfo)
{ {
StepConfig sc = _MyItemInfo.MyConfig as StepConfig; StepConfig sc = _MyItemInfo.MyConfig as StepConfig;
int setting = sc.Step_ShwRplWdsIndex; int setting = sc.Step_ShwRplWdsIndex;
switch (setting) switch (setting)
{ {
case 2: case (int)ReplaceWords.DoNotShow:
return false; return false;
break; break;
case 1: case (int)ReplaceWords.Show:
return true; return true;
break; break;
case 0: case (int)ReplaceWords.Inherit:
//SectionConfig sc2 = _MyItemInfo.ActiveParent.MyConfig as SectionConfig; //SectionConfig sc2 = _MyItemInfo.ActiveParent.MyConfig as SectionConfig;
SectionConfig sc2 = _MyItemInfo.ActiveSection.MyConfig as SectionConfig; SectionConfig sc2 = _MyItemInfo.ActiveSection.MyConfig as SectionConfig;
if (sc2 == null || sc2.Section_ShwRplWords == "Y") if (sc2 == null || sc2.Section_ShwRplWords == "Y")
@@ -86,6 +91,7 @@ namespace VEPROMS.CSLA.Library
break; break;
} }
} }
private Item _MyItem; private Item _MyItem;
private string EditText private string EditText
{ {

View File

@@ -2362,17 +2362,6 @@ namespace Volian.Controls.Library
if (n.Nodes != null && n.Nodes.Count > 0 && n.Nodes[0].Text != DummyNodeText) CheckTreeNodeChildren(n.Nodes); if (n.Nodes != null && n.Nodes.Count > 0 && n.Nodes[0].Text != DummyNodeText) CheckTreeNodeChildren(n.Nodes);
checkingChildren = false; checkingChildren = false;
} }
else
{
//C2025-005 Find Step Elements
//uncheck the parents if there are any
DevComponents.AdvTree.Node tmp_n = n;
while (tmp_n.Parent != null)
{
tmp_n = tmp_n.Parent;
tmp_n.Checked = false;
}
}
// if the selected folder has a docversion, handle it: // if the selected folder has a docversion, handle it:
if (n.Tag != SelectAllProcedureSetsText) if (n.Tag != SelectAllProcedureSetsText)
@@ -2390,26 +2379,6 @@ namespace Volian.Controls.Library
SetupContextMenu(); SetupContextMenu();
buildSetToSearchPanelTitle(); buildSetToSearchPanelTitle();
//C2025-005 Find Step Elements
//Need to refresh the Doc List and Available Step Types
//if All Procedure Sets was selected
if (n.Tag == SelectAllProcedureSetsText)
{
if (n.Checked)
{
checkingChildren = true;
foreach (Node node in advTreeProcSets.Nodes[0].Nodes)
{
node.Checked = true;
CheckTreeNodeChildren(node.Nodes);
}
checkingChildren = false;
}
RefreshLstCheckedDocVersions();
RefreshStepTypes();
}
} }
// check all folder nodes below this // check all folder nodes below this
@@ -2483,19 +2452,14 @@ namespace Volian.Controls.Library
ResetStepTypes("....select a procedure set for types to appear..."); ResetStepTypes("....select a procedure set for types to appear...");
} }
//C2025-005 Find Step Elements private void ResetStepTypes(string str)
//improve messaging when multiple formats
private void ResetStepTypes(params string[] strs)
{ {
advTreeStepTypes.Nodes.Clear(); advTreeStepTypes.Nodes.Clear();
lstCheckedStepTypes.Clear(); lstCheckedStepTypes.Clear();
lstCheckedStepTypesStr.Clear(); lstCheckedStepTypesStr.Clear();
foreach (string str in strs) Node newnode = new DevComponents.AdvTree.Node();
{ newnode.Text = str;
Node newnode = new DevComponents.AdvTree.Node(); advTreeStepTypes.Nodes.Add(newnode);
newnode.Text = str;
advTreeStepTypes.Nodes.Add(newnode);
}
buildStepTypePannelTitle(); buildStepTypePannelTitle();
} }
@@ -2522,11 +2486,7 @@ namespace Volian.Controls.Library
{ {
if (formatName != dvi.ActiveFormat.Name) if (formatName != dvi.ActiveFormat.Name)
{ {
//C2025-005 Find Step Elements ResetStepTypes("...folders selected include multiple formats");
//improve messaging when multiple formats
string frmt1 = $" Format is {formatName} before {dvi.MyFolder.Name}";
string frmt2 = $" which begins format: {dvi.ActiveFormat.Name}";
ResetStepTypes("...folders selected include multiple formats.", frmt1, frmt2);
return; return;
} }
} }