Changeset 2673
- Timestamp:
- 01/22/10 14:38:15 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.CodeEditor/3.2/CodeEditor.cs
r2667 r2673 169 169 return; 170 170 171 textEditor.ActiveTextAreaControl.TextArea.Key Down += new System.Windows.Forms.KeyEventHandler(TextArea_KeyDown);171 textEditor.ActiveTextAreaControl.TextArea.KeyEventHandler += new ICSharpCode.TextEditor.KeyEventHandler(TextArea_KeyEventHandler); 172 172 textEditor.ActiveTextAreaControl.TextArea.DoProcessDialogKey += new DialogKeyProcessor(TextArea_DoProcessDialogKey); 173 173 … … 191 191 } 192 192 193 void TextArea_KeyDown(object sender, KeyEventArgs e) { 194 int caretOffset = textEditor.ActiveTextAreaControl.Caret.Offset; 195 if (caretOffset == 0 || caretOffset == Doc.TextLength) 196 e.Handled = true; 193 #region keyboard handlers: filter input in read-only areas 194 195 bool TextArea_KeyEventHandler(char ch) { 196 int caret = textEditor.ActiveTextAreaControl.Caret.Offset; 197 return caret < prefix.Length || caret > Doc.TextLength - suffix.Length; 197 198 } 198 199 … … 207 208 return false; 208 209 } 210 211 #endregion 209 212 210 213 public void ScrollAfterPrefix() {
Note: See TracChangeset
for help on using the changeset viewer.