diff --git a/PROMS/Volian.Controls.Library/StepRTB.cs b/PROMS/Volian.Controls.Library/StepRTB.cs index 80acc806..0f79a469 100644 --- a/PROMS/Volian.Controls.Library/StepRTB.cs +++ b/PROMS/Volian.Controls.Library/StepRTB.cs @@ -170,6 +170,7 @@ namespace Volian.Controls.Library } public void SetBackColor() { + if (MyStepItem == null || MyStepItem.MyStepPanel == null) return; BackColor = _MyItemInfo.ItemAnnotationCount == 0 ? MyStepItem.MyStepPanel.InactiveColor : Color.FromArgb(255, 255, 128); } private string _origRTF; @@ -982,9 +983,19 @@ namespace Volian.Controls.Library #endregion #region Selection Handlers bool _AdjustingSelection = false; - private bool _ProcessingDelete; + private bool _ProcessingDelete; + private bool _HandlingCtrlA = false; private void HandleSelectionChange() { + if (_HandlingCtrlA) return; + Console.WriteLine("Before: SelectionStart={0}, SelectionLength={1}, TextLength={2}, SelectedText='{3}', SelectedRtf='{4}'", this.SelectionStart, this.SelectionLength, this.TextLength, this.SelectedText, this.SelectedRtf.Substring(SelectedRtf.Length - 10)); + if (!_HandlingCtrlA && this.TextLength == this.SelectionLength && this.SelectedRtf.EndsWith("\\par\r\n}\r\n")) + { + _HandlingCtrlA = true; + SelectAll(); + Console.WriteLine("After: SelectionStart={0}, SelectionLength={1}, TextLength={2}, SelectedText='{3}', SelectedRtf='{4}'", this.SelectionStart, this.SelectionLength, this.TextLength, this.SelectedText, this.SelectedRtf.Substring(SelectedRtf.Length - 10)); + _HandlingCtrlA = false; + } //HandleOverWrite(); //vlnStackTrace.ShowStackLocal("HandleSelectionChangeStack", 1, 10); bool startingValue = _AdjustingSelection; diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs index f75c9990..adac57ad 100644 Binary files a/PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs and b/PROMS/Volian.Controls.Library/StepTabRibbon.designer.cs differ diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.resx b/PROMS/Volian.Controls.Library/StepTabRibbon.resx index 51d55bc6..3c7ae060 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.resx +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.resx @@ -117,9 +117,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 17, 17 - @@ -133,6 +130,9 @@ 2CVVWYKhQwAAAABJRU5ErkJggg== + + 17, 17 + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 @@ -142,6 +142,9 @@ hNwGBmaHAP5n4G8q6gFdoZLjBpE7j5KJdaRlAAAAAElFTkSuQmCC + + 17, 17 + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8