B2017-059 only turn on the spellchecking if the RTB is visible

This commit is contained in:
2017-04-17 15:42:31 +00:00
parent f5c4d24cf7
commit 9a52e89fd5
3 changed files with 50 additions and 5 deletions

View File

@@ -805,11 +805,30 @@ namespace Volian.Controls.Library
Console.WriteLine("StepRTB_ContextMenuStripChanged {0} - {1} [{2}]", ex.GetType().Name, ex.Message, sublocation);
}
}
// Bug fix B2017-059, toggle the spellchecking status on only when being used - to control how many window handles are created by the spellchecker
// This fixed the issue of the spell checker closing PROMS - Callaway SAMG Background TSG-1, also reproduced on long procedure in calvert EOPs
private bool _SpellCheckStatus = false;
public bool SpellCheckStatus
{
get { return _SpellCheckStatus; }
set
{
if (_SpellCheckStatus != value)
{
_SpellCheckStatus = value;
if (DoSpellCheck)
C1SpellChecker2.SetActiveSpellChecking(this, value);
}
}
}
private void SetUpStepRTB()
{
DetectUrls = false;
if (DoSpellCheck)
C1SpellChecker2.SetActiveSpellChecking(this, true);
SpellCheckStatus = false;
this.Height = 10; // initialize the height to 10, the default height was too big for the cells in grid tables
BorderStyle = System.Windows.Forms.BorderStyle.None;
this.ScrollBars = RichTextBoxScrollBars.None;
@@ -3494,8 +3513,8 @@ namespace Volian.Controls.Library
public bool SpellCheckNext()
{
int nBad = C1SpellChecker2.CheckControl(this, false, MySpellCheckDlg);
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.EditData.EditoralSpellCheck)
DidEditorialSpellCheck = MySpellCheckDlg.DidCorrectSpelling; // B2015-024 spell checker in editoral mode
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.EditData.EditoralSpellCheck)
DidEditorialSpellCheck = MySpellCheckDlg.DidCorrectSpelling; // B2015-024 spell checker in editoral mode
return (nBad >= 0); // nBad = -1 means user pressed Cancel button
}