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:
Kathy Ruffing 2016-11-22 14:16:04 +00:00
parent 99aa1ac9c5
commit 1ff60597c3
4 changed files with 64 additions and 11 deletions

View File

@ -2444,6 +2444,7 @@ namespace VEPROMS.CSLA.Library
{
get
{
if (IsRtfRaw) return ("Equation");
string str = MyContent.Text;
if (MyDocVersion != null)
{

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;

View File

@ -105,14 +105,15 @@ namespace Volian.Print.Library
_MsgAtTop = msgAtTop;
Messages = new SortedDictionary<float, vlnChangeBarMessage>();
// if there is an RNO separator, add the separator's height in too.
Height = parent.Height * MyPageHelper.YMultiplier + (parent.MyItemInfo.IsFigure?SixLinesPerInch:0);
float scale = parent.MyItemInfo.IsRtfRaw ? 0.6f : 1; // use scale for equations (B2016-265)
Height = (scale * parent.Height) * MyPageHelper.YMultiplier + (parent.MyItemInfo.IsFigure?SixLinesPerInch:0);
foreach (vlnPrintObject vpo in parent.PartsBelow)
{
if (vpo is vlnRNOSeparator)
{
// see if any of children don't have changebar
if ((vpo as vlnRNOSeparator).ExtendChangeBar)
_YExtendLine = (vpo.Height + vpo.YOffset - (parent.Height + parent.YOffset)) * MyPageHelper.YMultiplier;
_YExtendLine = (vpo.Height + vpo.YOffset - ((scale * parent.Height) + parent.YOffset)) * MyPageHelper.YMultiplier;
}
}
foreach (vlnPrintObject vph in parent.PartsAbove)

View File

@ -3723,14 +3723,16 @@ namespace Volian.Print.Library
}
if (yOffRight < yoffRightParent) yOffRight = yoffRightParent;
// find the very bottom Yoffset
// find the very bottom Yoffset (don't do this is in single column mode for cautions/notes: B2016-261)
vlnParagraph parentPar = parent;
while (parentPar != null && parentPar.MyItemInfo.IsStep)
if (!((MyItemInfo.IsCaution || MyItemInfo.IsNote) && itemInfo.RNOLevel == 0))
{
float vb = parentPar.YVeryBottom;
if (yOffRight < vb)
yOffRight = vb;
parentPar = parentPar.MyParent;
while (parentPar != null && parentPar.MyItemInfo.IsStep)
{
float vb = parentPar.YVeryBottom;
if (yOffRight < vb) yOffRight = vb;
parentPar = parentPar.MyParent;
}
}
bool rightLonger = yOffRight > yoff;
if (!aerTableOrFigure && itemInfo.RNOLevel == 0) // Centered Table