Browse Source

Merge pull request #13 from SuperJMN/fixed_letterA

Letter A bug and SelectAll method
pull/16/head
Steven Kirk 12 years ago
parent
commit
bff68dfd95
  1. 15
      Perspex.Controls/Presenters/TextPresenter.cs

15
Perspex.Controls/Presenters/TextPresenter.cs

@ -196,8 +196,13 @@ namespace Perspex.Controls
case Key.A:
if (modifiers == ModifierKeys.Control)
{
this.SelectionStart = 0;
this.SelectionEnd = this.Text.Length;
SelectAll();
}
else
{
textEntered = true;
goto default;
}
break;
@ -290,6 +295,12 @@ namespace Perspex.Controls
e.Handled = true;
}
private void SelectAll()
{
this.SelectionStart = 0;
this.SelectionEnd = this.Text.Length;
}
protected override void OnPointerPressed(PointerPressEventArgs e)
{
var point = e.GetPosition(this);

Loading…
Cancel
Save