B2016-262 & B2016-263: for search results & report, print ‘Equation’ for Document text rather than rtf

Additional functionality for Equation Editor, bring up equation editor tool (from registry setting) on Equation button click
B2016-265, print proper size of change bar
B2016-261: don’t print extra blank lines for a table/equation/figure after caution/note off many lined step in single column mode
This commit is contained in:
2016-11-22 14:16:04 +00:00
parent 99aa1ac9c5
commit 1ff60597c3
4 changed files with 64 additions and 11 deletions

View File

@@ -11,6 +11,8 @@ using VEPROMS.CSLA.Library;
using Accentra.Controls;
using Volian.Base.Library;
using DevComponents.DotNetBar;
using Microsoft.Win32;
using System.Diagnostics;
namespace Volian.Controls.Library
{
@@ -1020,12 +1022,44 @@ namespace Volian.Controls.Library
if (_MyEditItem.MyItemInfo.IsFigure && tabOrFigType.Contains("RO"))
btnInsRO_Click(sender, e);
}
else
else if (InsertingEquation(contenttype))
{
// launch equation editor
string EqnEdt = GetEqnEdt();
if (EqnEdt == null)
MessageBox.Show("Equation Editor is not correctly configured in the registry.", "Warning", MessageBoxButtons.OK);
else
Process.Start(EqnEdt);
_MyEditItem.AddChild((E_FromType)fromtype, contenttype);
}
else
{
_MyEditItem.AddChild((E_FromType)fromtype, contenttype);
}
}
// the following launches the equation editor based on registry setting:
private string GetEqnEdt()
{
string retval = null;
try
{
RegistryKey key = Registry.ClassesRoot;
string rootName = key.Name;
string curVer = GetDefaultKeyValue(key.Name + "\\Equation\\CurVer");
string clsid = GetDefaultKeyValue(key.Name + "\\" + curVer + "\\CLSID");
retval = GetDefaultKeyValue(key.Name + "\\CLSID\\" + clsid + "\\LocalServer32");
}
catch (Exception ex)
{
return null;
}
return retval;
}
public String GetDefaultKeyValue(String key)
{
object xxx = null;
return Registry.GetValue(key, "", xxx).ToString();
}
private EditItem FindStepAfter(string types, int contenttype)
{
string[] order = types.Split(",".ToCharArray()); //"29,7,6,22"
@@ -1116,6 +1150,21 @@ namespace Volian.Controls.Library
}
return rtnval;
}
// Equation
private bool InsertingEquation(int contenttype)
{
bool rtnval = false;
switch (contenttype)
{
case 21000:
case 21001:
case 21002:
case 21003:
rtnval = true;
break;
}
return rtnval;
}
private void btnInsBefore_Click(object sender, EventArgs e)
{
_MyEditItem.AddSiblingBefore();
@@ -1187,7 +1236,7 @@ namespace Volian.Controls.Library
public void SetButtonAndMenuEnabling(bool docontextmenus)
{
if (_MyStepRTB == null) return;
if (_MyStepRTB.FieldToEdit != E_FieldToEdit.StepText && !MyItemInfo.IsFigure & !MyItemInfo.IsRtfRaw) // want menu enabling for figures & equations
if (_MyStepRTB.FieldToEdit != E_FieldToEdit.StepText && !MyItemInfo.IsFigure & !MyItemInfo.IsRtfRaw) // want menu enabling for figures & aations
return; // No need to change menu that does not get used
DocVersionInfo dvi = MyEditItem.MyItemInfo.MyProcedure.ActiveParent as DocVersionInfo;
if (dvi == null) return;