From 6c56658451354069aa977499d4ec6da0dabb5df0 Mon Sep 17 00:00:00 2001 From: Rich Date: Wed, 31 Jul 2013 14:51:07 +0000 Subject: [PATCH] If the RO Image file has an extension of "PCX" use an extension of "TIF" instead. PCX is no longer supported and the 32-Bit RO Conversion code converts PCX files to TIF. If a Text entry is placed above the grid, ignore it for the Grid lines and adjust the Top margin to allow the Plot title to print properly. --- PROMS/VEPROMS.CSLA.Library/Extension/ROImageExt.cs | 1 + PROMS/XYPlots/XYPlots.cs | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ROImageExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ROImageExt.cs index 8e4980e1..0f0455c0 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ROImageExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ROImageExt.cs @@ -73,6 +73,7 @@ namespace VEPROMS.CSLA.Library // throw new System.Security.SecurityException("User not authorized to view a ROImage"); try { + if (fileName.EndsWith("PCX")) fileName = fileName.Replace(".PCX", ".TIF"); ROImageInfo tmp = DataPortal.Fetch(new ROFstID_FileNameCriteria(rOFstID, fileName)); if (tmp.ErrorMessage == "No Record Found") { diff --git a/PROMS/XYPlots/XYPlots.cs b/PROMS/XYPlots/XYPlots.cs index 423c34f1..01b4fa91 100644 --- a/PROMS/XYPlots/XYPlots.cs +++ b/PROMS/XYPlots/XYPlots.cs @@ -75,7 +75,7 @@ namespace XYPlots public void SetMargins(float leftMargin, float topMargin, float rightMargin, float bottomMargin) { _LeftMargin = leftMargin * 1440; - _TopMargin = topMargin * 1440; + _TopMargin = yTopMarginAdjust + topMargin * 1440; _RightMargin = rightMargin * 1440; _BottomMargin = bottomMargin * 1440; } @@ -597,6 +597,7 @@ namespace XYPlots newval.xyValue[Y] = boxptr.BoxMinimum.xyValue[Y] - (nl * CHIGHDOTS) - (int)(19 * ConvertToTwips); return newval; } + private float yTopMarginAdjust = 0; private void GetBoxParameters() { XyBox NewBox = new XyBox(); @@ -617,6 +618,9 @@ namespace XYPlots maxPoint.xyValue[X] = NewBox.BoxMaximum.xyValue[X]; maxPoint.xyValue[Y] = Origin.xyValue[Y]; NewBox.BoxMinimum = minPoint; + if (minPoint.xyValue[Y] < 0) // If the box is above the range of the Plot then the top margin must be adjusted + // so that the text is visible + yTopMarginAdjust = -(minPoint.xyValue[Y]+720); // TopMargin defaults to .5 Inches (720 Twips) NewBox.BoxMaximum = maxPoint; AllBoxes.Add(NewBox); } @@ -1608,7 +1612,8 @@ namespace XYPlots cptr = AllBoxes[BoxesIdx]; if (cptr.BoxMinimum.xyValue[flag] <= ptval && cptr.BoxMaximum.xyValue[flag] >= ptval) - AddBoxToActiveList(cptr); + if(cptr.BoxMinimum.xyValue[1-flag] > 0)// Don't include box if it is outside of the range of the grid. + AddBoxToActiveList(cptr); BoxesIdx++; } }