This commit is contained in:
Kathy Ruffing 2009-08-18 14:49:56 +00:00
parent 9a7a9c3f72
commit 5241e3a28a

View File

@ -105,6 +105,16 @@ namespace Volian.Controls.Library
get { return _MyStepItem; } get { return _MyStepItem; }
set { _MyStepItem = value; } set { _MyStepItem = value; }
} }
// August 5, 2009 - KBR & RHM:
// Insert/Overwrite will be developed later if needed. various issues
// were found during initial development that made its scope larger than
// expected. Problems were related to having overstrike on in the following
// cases:
// 1) left arrow when on link - positions after link
// 2) left arrow and after link - does not move
// 3) shift left arrow does not move past links correctly and also, first
// shift left arrow looks more like insert mode.
// private bool _OverWrite;
// _IsDirty compares the original rtf to the current rtf from the // _IsDirty compares the original rtf to the current rtf from the
// richtextbox to see if a change was made. // richtextbox to see if a change was made.
private bool _IsDirty private bool _IsDirty
@ -840,6 +850,7 @@ namespace Volian.Controls.Library
private bool _ProcessingDelete; private bool _ProcessingDelete;
private void HandleSelectionChange() private void HandleSelectionChange()
{ {
//HandleOverWrite();
//vlnStackTrace.ShowStackLocal("HandleSelectionChangeStack", 1, 10); //vlnStackTrace.ShowStackLocal("HandleSelectionChangeStack", 1, 10);
bool startingValue = _AdjustingSelection; bool startingValue = _AdjustingSelection;
if (_IdentifyingLinks || _ProcessingDelete) return; if (_IdentifyingLinks || _ProcessingDelete) return;
@ -914,6 +925,15 @@ namespace Volian.Controls.Library
MyLinkText = null; MyLinkText = null;
OnRTBSelectionChanged(this, new EventArgs()); OnRTBSelectionChanged(this, new EventArgs());
} }
//private void HandleOverWrite()
//{
// if (!_OverWrite) return;
// if (SelectionLength > 0) return;
// if (SelectionStart == TextLength) return;
// Console.WriteLine("Handle Overwrite, SelectionStart = {0}, SelectionLength = {1}", SelectionStart, SelectionLength);
// SelectionLength = 1;
//}
private bool _CheckSelection = false; private bool _CheckSelection = false;
#endregion #endregion
#region Delete Handlers #region Delete Handlers
@ -1167,7 +1187,7 @@ namespace Volian.Controls.Library
{ {
int newstart = FindStart(); // find start of link ending on. int newstart = FindStart(); // find start of link ending on.
// if not link, don't do special processing // if not link, don't do special processing
if (newstart == SelectionStart - 1) return; if (newstart == SelectionStart - 1) return;
int len = SelectionLength + SelectionStart - newstart; int len = SelectionLength + SelectionStart - newstart;
SetSelection(newstart, len); SetSelection(newstart, len);
e.Handled = true; e.Handled = true;
@ -1304,6 +1324,21 @@ namespace Volian.Controls.Library
} }
if (SelectionLength > 0) HandleDeleteKeyWithSelectedText(e, null); if (SelectionLength > 0) HandleDeleteKeyWithSelectedText(e, null);
break; break;
case Keys.Insert:
//_OverWrite = !_OverWrite;
//if (_OverWrite)
//{
// HandleSelectionChange();
//}
//else
//{
// SelectionLength = 0;
// HandleSelectionChange();
//}
// For now, don't allow for toggling between insert/overwrite mode - see
// comment on _OverWrite
e.Handled = true;
break;
} }
} }
private void StepRTB_HomeEndPressed(KeyEventArgs keyargs) private void StepRTB_HomeEndPressed(KeyEventArgs keyargs)