This commit is contained in:
John Jenko 2010-11-10 16:08:59 +00:00
parent 3b3a7141f4
commit 7df8f47ea7

View File

@ -565,7 +565,10 @@ namespace Volian.Controls.Library
}
}
string ostring = SelectedText;
if ((char.IsUpper(ostring, 0) && char.IsUpper(ostring, 1)) ||
if (ostring.Length == 0) return; // nothing selected
if (ostring.Length == 1)
type = char.IsUpper(ostring, 0) ? 'l' : 'U';
else if ((char.IsUpper(ostring, 0) && char.IsUpper(ostring, 1)) ||
(char.IsLower(ostring, 0) && char.IsUpper(ostring, 1))) type = 'l'; // lower case
else if ((char.IsUpper(ostring, 0) && char.IsLower(ostring, 1))) type = 'U'; // upper case
else type = 'T'; // Title case
@ -1056,7 +1059,7 @@ namespace Volian.Controls.Library
private bool _HandlingCtrlA = false;
private void HandleLocalSelectionChange()
{
if (MyStepItem.MyStepPanel.SelectedStepRTB != this)
if (MyStepItem != null && MyStepItem.MyStepPanel.SelectedStepRTB != this)
return;
HandleSelectionChange();
@ -1694,6 +1697,13 @@ namespace Volian.Controls.Library
case Keys.Tab:
e.SuppressKeyPress = true;
e.Handled = true;
if (MyStepItem == null)
{
Form frm = ParentForm(this);
if (frm != null)
frm.SelectNextControl(this, true, true, true, true);
}
break;
case Keys.Enter:
if (!e.Control && !e.Shift && !e.Alt)
@ -1707,6 +1717,12 @@ namespace Volian.Controls.Library
break;
}
}
private static Form ParentForm(Control ctrl)
{
while (!(ctrl.Parent is Form)) ctrl = ctrl.Parent;
return ctrl.Parent as Form;
}
private void StepRTB_HomeEndPressed(KeyEventArgs keyargs)
{
if (MyItemInfo.IsProcedure || MyItemInfo.IsSection) return;