Equation Editor interface support

This commit is contained in:
2016-11-17 15:05:15 +00:00
parent 3e212834ea
commit 0b7371367c
26 changed files with 2129 additions and 855 deletions

View File

@@ -1792,6 +1792,13 @@ namespace VEPROMS.CSLA.Library
return parent.IsInRNO;
}
}
public bool IsRtfRaw
{
get
{
return (MyContent.Type > 20999);
}
}
public bool IsInCalvertConditionResponse
{
get
@@ -2224,6 +2231,7 @@ namespace VEPROMS.CSLA.Library
if (MyContent.ContentRoUsages == null || MyContent.ContentRoUsages.Count == 0)
return "Embedded Image";
}
if (IsRtfRaw) return "Equation";
if (cont.Type >= 20000) number = MyTab == null ? "" : MyTab.CleanText;
return string.Format("{0} {1}", number, DisplayText).Trim(); // Need TrimEnd(); for IP3
//return string.Format("{0} {1}", number, cont.Text).Trim();
@@ -2300,7 +2308,13 @@ namespace VEPROMS.CSLA.Library
}
public string ShortSearchPath
{
get { return ConvertToDisplayText(Regex.Replace(_SearchPath ?? "", "\x11.*?\x07", "\x07")); }
get
{
string dtext = ConvertToDisplayText(Regex.Replace(_SearchPath ?? "", "\x11.*?\x07", "\x07"));
if (IsFigure && dtext.EndsWith("Table.")) dtext = dtext.Substring(0, dtext.Length - "Table.".Length) + "Figure.";
else if (IsRtfRaw && dtext.EndsWith("Table.") && FormatStepData.Type.Contains("Equation")) dtext = dtext.Substring(0, dtext.Length - "Table.".Length) + "Equation.";
return dtext;
}
}
internal int _SearchAnnotationID;
public int SearchAnnotationID

View File

@@ -96,7 +96,12 @@ namespace VEPROMS.CSLA.Library
case E_FromType.Step:
break;
case E_FromType.Table:
partText = ".Table";
if (MyItem.IsRtfRaw)
partText = ".Equation";
else if (MyItem.IsFigure)
partText = ".Figure";
else
partText = ".Table";
break;
default:
break;
@@ -151,6 +156,7 @@ namespace VEPROMS.CSLA.Library
{
if (MyItems != null && MyItems[0].IsTable) return ("Table");
if (MyItems != null && MyItems[0].IsFigure) return ("Figure");
if (MyItems != null && MyItems[0].IsRtfRaw) return ("Equation");
}
return string.Format("{0}", PartTypes);
}

View File

@@ -492,7 +492,7 @@ namespace VEPROMS.CSLA.Library
{
if (!topType.Inactive)
{
if ((_CurItemInfo.IsInRNO||_CurItemInfo.IsCaution||_CurItemInfo.IsNote) && topType.StepEditData.TypeMenu.RnoMenuItem != null && topType.StepEditData.TypeMenu.RnoMenuItem != "")
if ((_CurItemInfo.IsInRNO || _CurItemInfo.IsCaution || _CurItemInfo.IsNote) && topType.StepEditData.TypeMenu.RnoMenuItem != null && topType.StepEditData.TypeMenu.RnoMenuItem != "")
sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.RnoMenuItem, Convert.ToInt32(topType.Index)));
else
sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.MenuItem, Convert.ToInt32(topType.Index)));
@@ -525,13 +525,18 @@ namespace VEPROMS.CSLA.Library
{
if (!topType.Inactive)
{
if ((_CurItemInfo.IsInRNO||_CurItemInfo.IsCaution||_CurItemInfo.IsNote) && topType.StepEditData.TypeMenu.RnoMenuItem != null && topType.StepEditData.TypeMenu.RnoMenuItem != "")
// if equation type && in single column mode, put out the rnomenu list, and skip the AER items
bool singleColEq = (topType.Type.ToUpper().Contains("EQUATION") && _CurItemInfo.ColumnMode == 0);
if ((singleColEq ||_CurItemInfo.IsInRNO || _CurItemInfo.IsCaution || _CurItemInfo.IsNote) && topType.StepEditData.TypeMenu.RnoMenuItem != null && topType.StepEditData.TypeMenu.RnoMenuItem != "")
sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.RnoMenuItem, Convert.ToInt32(topType.Index)));
else
else if (!singleColEq)
sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.MenuItem, Convert.ToInt32(topType.Index)));
if (topType.Type == curType) retval = cntitm;
cntitm++;
if (!singleColEq || (singleColEq && topType.StepEditData.TypeMenu.RnoMenuItem != null && topType.StepEditData.TypeMenu.RnoMenuItem != ""))
{
if (topType.Type == curType) retval = cntitm;
cntitm++;
}
}
foreach (StepData sd in StepDataList)
{
@@ -4827,6 +4832,8 @@ namespace VEPROMS.CSLA.Library
{
foreach (StepData stepData in this)
if (stepData.Type == type) return stepData;
//foreach (StepData stepData1 in InheritedList)
// if (stepData1.Type == type) return stepData1;
return null;
}
}
@@ -4836,6 +4843,8 @@ namespace VEPROMS.CSLA.Library
{
foreach (StepData stepData in this)
if (stepData.Index == index) return stepData;
//foreach (StepData stepData1 in InheritedList)
// if (stepData1.Index == index) return stepData1;
return null;
}
}
@@ -4959,6 +4968,57 @@ namespace VEPROMS.CSLA.Library
return null;
}
}
// EmbeddedObject has been commented out, 'Equations' are separate top level items.
// This code was left here in case Equations , and other OLE objects, end up
// under the EmbeddedObject:
// EmbeddedObject has inheritted types that represent OLE objects.
// The first of these is 'Equation'. Another that may be implemented later is Image.
// This is a special case, since only 'Equation' exists on initial development of
// embedded objects, 'skip' the embedded object layer when creating the list and
// go right to the equations.
//private StepData _EmbeddedObject;
//public StepData EmbeddedObject
//{
// get
// {
// if (_EmbeddedObject != null) return _EmbeddedObject;
// foreach (StepData sd in this)
// {
// if (sd.Type == "EmbeddedObject")
// {
// _Equation = sd;
// return sd;
// }
// }
// return null;
// }
//}
private StepData _Equation;
public StepData Equation // equation has a parent of embedded object.
{
get
{
if (_Equation != null) return _Equation;
foreach (StepData sd in this)
{
if (sd.Type == "Equation")
{
_Equation = sd;
return sd;
}
}
//foreach (StepData sdi in InheritedList)
//{
// if (sdi.Type == "Equation")
// {
// _Equation = sdi;
// return sdi;
// }
//}
return null;
}
}
}
#endregion
#region StepLayoutData