Added Try/Catch as part of B2017-143 fix to prevent PROMS from crashing
B2017-143 Print was disposing fonts that are save in a static dictionary, causing editor display problems after printing a procedure.
This commit is contained in:
@@ -3715,7 +3715,16 @@ namespace Volian.Controls.Library
|
||||
//g.DrawLine(Pens.DarkGreen, MyStepRTB.Location.X - 7, 0, MyStepRTB.Location.X - 7, this.Height);
|
||||
//g.DrawString(TabText, MyItemInfo.MyTab.MyFont.WindowsFont, Brushes.Black, new RectangleF(new PointF(Convert.ToSingle(TabLocation.X), Convert.ToSingle(TabLocation.Y)), MyStepPanel.MyStepPanelSettings.NumberSize), StringFormat.GenericDefault);
|
||||
Font myWFont = (MyItemInfo.MyTab != null) ? MyItemInfo.MyTab.MyFont.WindowsFont : MyItemInfo.FormatStepData.Font.WindowsFont;
|
||||
g.DrawString(TabText, myWFont, Brushes.Black, new RectangleF(new PointF(Convert.ToSingle(TabLocation.X), Convert.ToSingle(TabLocation.Y)), this.Size), StringFormat.GenericDefault);
|
||||
|
||||
// added Try/Catch when working on B2017-143, kept in to prevent PROMS from crashing after printing a procedure that has a seq tab with a different font style
|
||||
try
|
||||
{
|
||||
g.DrawString(TabText, myWFont, Brushes.Black, new RectangleF(new PointF(Convert.ToSingle(TabLocation.X), Convert.ToSingle(TabLocation.Y)), this.Size), StringFormat.GenericDefault);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_MyLog.Warn("EditItem DrawString", ex);
|
||||
}
|
||||
|
||||
//g.DrawLine(Pens.DarkGreen, lblTab.Location.X, 0, lblTab.Location.X, this.Height);
|
||||
//g.DrawLine(Pens.DarkGreen, MyStepRTB.Location.X, 0, MyStepRTB.Location.X, this.Height);
|
||||
|
Reference in New Issue
Block a user