B2018-071 PROMs was crashing during automated testing or print all procedures. Error Handling was added to keep the code from crashing.
B2018-070 The MS Word Panel was getting focus when the step editor was active if the PROMS window was resized or if a step with an annotation received focus. PROMS code was changed so that Word recieves focus when the Word Panel is active.
This commit is contained in:
parent
b5df7ffc1c
commit
71367cf81f
@ -1442,7 +1442,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
void CloseWordApp_Tick(object sender, EventArgs e)
|
void CloseWordApp_Tick(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Enabled = false;
|
Enabled = false;
|
||||||
|
try // B2018-071 Keep code from crashing on close of MS Word
|
||||||
|
{
|
||||||
MyApp.Quit(false);
|
MyApp.Quit(false);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_MyLog.WarnFormat("MyApp Quit {0} {1}", ex.GetType().FullName, ex.Message);
|
||||||
|
}
|
||||||
Dispose();
|
Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -119,6 +119,8 @@ namespace Volian.Controls.Library
|
|||||||
_RefreshTimer.Interval = 500;// B2017-133 Edraw
|
_RefreshTimer.Interval = 500;// B2017-133 Edraw
|
||||||
ClientSizeChanged += new EventHandler(DSOTabPanel_ClientSizeChanged);
|
ClientSizeChanged += new EventHandler(DSOTabPanel_ClientSizeChanged);
|
||||||
_RefreshTimer.Tick += new EventHandler(_RefreshTimer_Tick);
|
_RefreshTimer.Tick += new EventHandler(_RefreshTimer_Tick);
|
||||||
|
// B2018-070 Activate MS Word Panel
|
||||||
|
_RefreshTimer.Enabled = true;
|
||||||
_MyEdWord.BeforeDocumentSaved += _MyEdWord_BeforeDocumentSaved;// B2017-133 Edraw
|
_MyEdWord.BeforeDocumentSaved += _MyEdWord_BeforeDocumentSaved;// B2017-133 Edraw
|
||||||
}
|
}
|
||||||
void _MyEdWord_BeforeDocumentSaved(object sender, EventArgs e)// B2017-133 Edraw
|
void _MyEdWord_BeforeDocumentSaved(object sender, EventArgs e)// B2017-133 Edraw
|
||||||
@ -145,21 +147,24 @@ namespace Volian.Controls.Library
|
|||||||
_RefreshTimer.Enabled = false;
|
_RefreshTimer.Enabled = false;
|
||||||
if (_MyEdWord != null)// B2017-133 Edraw
|
if (_MyEdWord != null)// B2017-133 Edraw
|
||||||
{
|
{
|
||||||
_MyEdWord.Focus();
|
// B2018-070 Activate MS Word Panel
|
||||||
_MyEdWord.GotoItem(EDWordLib.WdGoToItem.wdGoToStart, EDWordLib.WdGoToDirection.wdGoToFirst);
|
_MyEdWord.GotoItem(EDWordLib.WdGoToItem.wdGoToObject, EDWordLib.WdGoToDirection.wdGoToNext, 0, null);
|
||||||
//_MyEdWord.BringToFront();
|
|
||||||
//_MyEdWord.EndInit();
|
|
||||||
}
|
}
|
||||||
//else
|
//else
|
||||||
//{
|
//{
|
||||||
// _MyDisplayTabControl.CloseTabItem(_MyDisplayTabItem);
|
// _MyDisplayTabControl.CloseTabItem(_MyDisplayTabItem);
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DSOTabPanel_ClientSizeChanged(object sender, EventArgs e)
|
void DSOTabPanel_ClientSizeChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// B2018-070 Use InDSOTabPanel to determine if the word panel should be activated - Activate MS Word Panel
|
||||||
|
if (_InDSOTabPanel)
|
||||||
{
|
{
|
||||||
_RefreshTimer.Enabled = false; // This assures that interval is used from last event.
|
_RefreshTimer.Enabled = false; // This assures that interval is used from last event.
|
||||||
_RefreshTimer.Enabled = true;
|
_RefreshTimer.Enabled = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
private void SetupDSOTabPanel()
|
private void SetupDSOTabPanel()
|
||||||
@ -259,6 +264,8 @@ namespace Volian.Controls.Library
|
|||||||
if (!float.TryParse(doc.Application.Version, out ver))
|
if (!float.TryParse(doc.Application.Version, out ver))
|
||||||
ver = 12.0F;
|
ver = 12.0F;
|
||||||
this.Enter += new EventHandler(DSOTabPanel_Enter);
|
this.Enter += new EventHandler(DSOTabPanel_Enter);
|
||||||
|
// B2018-070 Use InDSOTabPanel to determine if the word panel should be activated - Activate MS Word Panel
|
||||||
|
this.Leave += DSOTabPanel_Leave;
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
// The following line corrects Symbol characters in MSWord Sections
|
// The following line corrects Symbol characters in MSWord Sections
|
||||||
// CheckForSymbolCharacters(doc);
|
// CheckForSymbolCharacters(doc);
|
||||||
@ -273,6 +280,12 @@ namespace Volian.Controls.Library
|
|||||||
// TODO: Should try to do a direct open using Word.
|
// TODO: Should try to do a direct open using Word.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DSOTabPanel_Leave(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// B2018-070 Use InDSOTabPanel to determine if the word panel should be activated - Activate MS Word Panel
|
||||||
|
_InDSOTabPanel = false;
|
||||||
|
}
|
||||||
public void FixSymbolCharacters()
|
public void FixSymbolCharacters()
|
||||||
{
|
{
|
||||||
CheckForSymbolCharacters(new LBDocumentClass(_MyEdWord.ActiveDocument()));// B2017-133 Edraw
|
CheckForSymbolCharacters(new LBDocumentClass(_MyEdWord.ActiveDocument()));// B2017-133 Edraw
|
||||||
@ -502,7 +515,8 @@ namespace Volian.Controls.Library
|
|||||||
if (!IsBeingDeleted)
|
if (!IsBeingDeleted)
|
||||||
SaveDirty();
|
SaveDirty();
|
||||||
this.Enter -= new EventHandler(DSOTabPanel_Enter);
|
this.Enter -= new EventHandler(DSOTabPanel_Enter);
|
||||||
// this.Leave -= new EventHandler(DSOTabPanel_Leave);
|
// B2018-070 Use InDSOTabPanel to determine if the word panel should be activated - Activate MS Word Panel
|
||||||
|
this.Leave -= DSOTabPanel_Leave;
|
||||||
// SaveDirty(); // SaveDirty happens in CloseDSO(bool)
|
// SaveDirty(); // SaveDirty happens in CloseDSO(bool)
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -576,6 +590,8 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
public static bool IgnoreEnter = false;
|
public static bool IgnoreEnter = false;
|
||||||
private bool _In_DSOTabPanel_Enter=false;
|
private bool _In_DSOTabPanel_Enter=false;
|
||||||
|
// B2018-070 Use InDSOTabPanel to determine if the word panel should be activated - Activate MS Word Panel
|
||||||
|
private bool _InDSOTabPanel = false;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// When a Word document is selected make sure it's tab is activated and
|
/// When a Word document is selected make sure it's tab is activated and
|
||||||
/// the SelectedItem for the DisplayTabControl is updated.
|
/// the SelectedItem for the DisplayTabControl is updated.
|
||||||
@ -584,6 +600,8 @@ namespace Volian.Controls.Library
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void DSOTabPanel_Enter(object sender, EventArgs e)
|
private void DSOTabPanel_Enter(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
// B2018-070 Use InDSOTabPanel to determine if the word panel should be activated - Activate MS Word Panel
|
||||||
|
_InDSOTabPanel = true;
|
||||||
if (IgnoreEnter) return;
|
if (IgnoreEnter) return;
|
||||||
_MyTransparentPanel.SendToBack();
|
_MyTransparentPanel.SendToBack();
|
||||||
|
|
||||||
@ -616,6 +634,8 @@ namespace Volian.Controls.Library
|
|||||||
_MyEdWord.Focus();
|
_MyEdWord.Focus();
|
||||||
_In_DSOTabPanel_Enter = false;
|
_In_DSOTabPanel_Enter = false;
|
||||||
_MyDisplayTabControl.SelectedDisplayTabItem = MyDisplayTabItem;
|
_MyDisplayTabControl.SelectedDisplayTabItem = MyDisplayTabItem;
|
||||||
|
// B2018-070 Position the text cursor - Activate MS Word Panel
|
||||||
|
_MyEdWord.GotoItem(EDWordLib.WdGoToItem.wdGoToObject, EDWordLib.WdGoToDirection.wdGoToNext, 0, null);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
Loading…
x
Reference in New Issue
Block a user