this._Document.StatusUpdate -= Document_StatusChanged;
this._Document.SelectionChanged -= Document_SelectionChanged;
this._Document.PerformLayouted -= View_LineBreakChanged;
+ this._Document.CaretChanged -= _Document_CaretChanged;
}
this._Document = value;
this._Document.StatusUpdate += Document_StatusChanged;
this._Document.SelectionChanged += Document_SelectionChanged;
this._Document.PerformLayouted += View_LineBreakChanged;
+ this._Document.CaretChanged += _Document_CaretChanged;
}
}
+ private void _Document_CaretChanged(object sender, EventArgs e)
+ {
+ TextPoint pos = this.Document.CaretPostion;
+ this.JumpCaret(pos.row, pos.col);
+ }
+
private void Document_SelectionChanged(object sender, EventArgs e)
{
if (this.IsReverseSelect())
this.HideLineMarker = true;
this.SelectGrippers = new GripperRectangle(new Gripper(), new Gripper());
this.SelectionChanged += new EventHandler((s, e) => { });
+ this.CaretChanged += (s, e) => { };
}
void WacthDogPattern_Updated(object sender, EventArgs e)
}
}
+ TextPoint _CaretPostion;
/// <summary>
/// レイアウト行のどこにキャレットがあるかを表す
/// </summary>
- /// <remarks>この値を変更しても反映されないので、EditView側でAdjustCaret()メソッドを呼び出す必要があります</remarks>
public TextPoint CaretPostion
{
- get;
- set;
+ get
+ {
+ return this._CaretPostion;
+ }
+ set
+ {
+ if(this._CaretPostion != value)
+ {
+ this._CaretPostion = value;
+ this.CaretChanged(this, null);
+ }
+ }
}
/// <summary>
public event EventHandler SelectionChanged;
/// <summary>
+ /// キャレット移動時に通知される
+ /// </summary>
+ public event EventHandler CaretChanged;
+
+ /// <summary>
/// 指定された範囲を選択する
/// </summary>
/// <param name="start"></param>