this.View.PerformLayouted += View_LineBreakChanged;\r
this.View.PageBoundChanged += View_PageBoundChanged;\r
this.Document.Clear();\r
- this.CaretMoved += new EventHandler((s, e) => { });\r
+ this.SelectionChanged += new EventHandler((s, e) => { });\r
}\r
\r
/// <summary>\r
- /// キャレット移動時に通知される\r
+ /// 選択領域変更時に通知される\r
/// </summary>\r
- public event EventHandler CaretMoved;\r
-\r
+ public event EventHandler SelectionChanged;\r
\r
/// <summary>\r
/// 矩形選択モードなら真を返し、そうでない場合は偽を返す\r
else\r
this.View.InsertPoint = null;\r
}\r
- else\r
+ else if(length != 0)\r
{\r
this.View.Selections.Add(Selection.Create(start, length));\r
this.View.InsertPoint = null;\r
}\r
+ this.SelectionChanged(this, null);\r
}\r
\r
public void Select(TextPoint tp, int width, int height)\r
this.View.InsertPoint = new SelectCollection(this.View.Selections);\r
else\r
this.View.InsertPoint = null;\r
+\r
+ this.SelectionChanged(this, null);\r
}\r
\r
private void SelectByRectangle(TextRectangle rect)\r
this.View.AdjustCaretAndSrc();\r
\r
this.SelectWithMoveCaret(false);\r
-\r
- this.CaretMoved(this, null);\r
}\r
\r
/// <summary>\r
this.View.JumpCaret(0, 0);\r
this.View.AdjustCaretAndSrc();\r
this.SelectWithMoveCaret(isSelected);\r
- this.CaretMoved(this, null);\r
}\r
\r
/// <summary>\r
this.View.JumpCaret(this.View.LayoutLines.Count - 1, 0);\r
this.View.AdjustCaretAndSrc();\r
this.SelectWithMoveCaret(isSelected);\r
- this.CaretMoved(this, null);\r
}\r
\r
/// <summary>\r
this.View.JumpCaret(toRow, 0);\r
this.View.AdjustCaretAndSrc();\r
this.SelectWithMoveCaret(isSelected);\r
- this.CaretMoved(this, null);\r
}\r
else\r
{\r
}\r
this.View.AdjustCaretAndSrc(AdjustFlow.Col);\r
this.SelectWithMoveCaret(isSelected);\r
- this.CaretMoved(this, null);\r
}\r
\r
void AlignNearestWord(bool MoveFlow)\r
this.MoveCaretVertical(deltarow > 0);\r
this.View.AdjustCaretAndSrc(AdjustFlow.Both);\r
this.SelectWithMoveCaret(isSelected);\r
- this.CaretMoved(this, null);\r
}\r
\r
/// <summary>\r
\r
SelectCollection Selections = this.View.Selections;\r
if (isSelected)\r
- this.Select(this.AnchorIndex, CaretPostion - this.AnchorIndex);\r
- else\r
{\r
- this.View.Selections.Clear();\r
+ this.Select(this.AnchorIndex, CaretPostion - this.AnchorIndex);\r
+ }else{\r
+ this.Select(CaretPostion, 0);\r
this.AnchorIndex = CaretPostion;\r
this.View.InsertPoint = null;\r
}\r