aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/TextBox.cs
diff options
context:
space:
mode:
authorjp <jp_bruyere@hotmail.com>2016-03-18 12:39:38 +0100
committerjp <jp_bruyere@hotmail.com>2016-03-18 12:39:38 +0100
commit22644afe6f0722dcfb5fd27ba353f12274f55eb6 (patch)
tree7472299f2c96d9a071b6101bd97542b8e8fce306 /src/GraphicObjects/TextBox.cs
parente5069093ba483ef8644c5cac685d76f2600606f0 (diff)
parent356bfaaed4f46a727ae033f37f362b062c8c32d9 (diff)
Merge branch 'master' of https://github.com/jpbruyere/Crow
Diffstat (limited to 'src/GraphicObjects/TextBox.cs')
-rw-r--r--src/GraphicObjects/TextBox.cs71
1 files changed, 18 insertions, 53 deletions
diff --git a/src/GraphicObjects/TextBox.cs b/src/GraphicObjects/TextBox.cs
index 14cc1830..08ec1f69 100644
--- a/src/GraphicObjects/TextBox.cs
+++ b/src/GraphicObjects/TextBox.cs
@@ -80,9 +80,9 @@ namespace Crow
case Key.Back:
if (!selectionIsEmpty)
{
-// Text = Text.Remove(selectionStart, selectionEnd - selectionStart);
-// selReleasePos = -1;
-// currentCol = selBeginPos;
+ // Text = Text.Remove(selectionStart, selectionEnd - selectionStart);
+ // selReleasePos = -1;
+ // currentCol = selBeginPos;
}
else
this.DeleteChar();
@@ -142,61 +142,26 @@ namespace Crow
case Key.RWin:
break;
case Key.Tab:
- this.Insert("\t");
- break;
- case Key.KeypadDecimal:
- this.Insert (".");
- break;
- case Key.Space:
- this.Insert(" ");
- break;
- case Key.KeypadDivide:
- case Key.Slash:
- this.Insert("/");
- break;
- case Key.KeypadMultiply:
- this.Insert("*");
- break;
- case Key.KeypadMinus:
- case Key.Minus:
- this.Insert("-");
- break;
- case Key.KeypadPlus:
- case Key.Plus:
- this.Insert("+");
- break;
- case Key.ShiftLeft:
- case Key.ShiftRight:
- case Key.AltLeft:
- case Key.AltRight:
- break;
- case Key.Semicolon:
- this.Insert(";");
+ this.Insert ("\t");
break;
default:
- if (!selectionIsEmpty)
- {
-// Text = Text.Remove(selectionStart, selectionEnd - selectionStart);
-// currentCol = selBeginPos;
- }
-
- string k = "?";
- if ((char)key >= 67 && (char)key <= 76)
- k = ((int)key - 67).ToString();
- else if ((char)key >= 109 && (char)key <= 118)
- k = ((int)key - 109).ToString();
- else if (e.Shift)
- k = key.ToString();
- else
- k = key.ToString().ToLower();
+ break;
+ }
+ if (Width < 0)
+ RegisterForLayouting (LayoutingType.Width);
+ if (Height < 0)
+ RegisterForLayouting (LayoutingType.Height);
+ RegisterForGraphicUpdate();
+ }
+ public override void onKeyPress (object sender, KeyPressEventArgs e)
+ {
+ base.onKeyPress (sender, e);
- this.Insert (k);
+ this.Insert (e.KeyChar.ToString());
- SelRelease = -1;
- SelBegin = new Point(CurrentColumn, SelBegin.Y);
+ SelRelease = -1;
+ SelBegin = new Point(CurrentColumn, SelBegin.Y);
- break;
- }
if (Width < 0)
RegisterForLayouting (LayoutingType.Width);
if (Height < 0)