Document _Document;
Popup popup;
- const int Interval = 17;
+ const int Interval = 96;
const int IntervalWhenLostFocuse = 160;
static FooTextBox()
{
this.verticalScrollBar.SmallChange = 1;
this.verticalScrollBar.LargeChange = 10;
- this.verticalScrollBar.Maximum = this.View.LayoutLines.Count;
+ this.verticalScrollBar.Maximum = this.Document.LayoutLines.Count - 1;
this.verticalScrollBar.Scroll += new ScrollEventHandler(verticalScrollBar_Scroll);
}
}
/// </summary>
public void Refresh()
{
- this.Document.RequestRedraw();
+ this.Refresh(this.View.PageBound);
}
/// <summary>
TextStoreHelper.NotifyTextChanged(this.textStore, 0, 0, this.Document.Length);
if (this.verticalScrollBar != null)
this.verticalScrollBar.Maximum = this.View.LayoutLines.Count;
+ this.View.CalculateWhloeViewPort();
this.View.CalculateLineCountOnScreen();
this.IsEnabled = true;
this.Refresh(this.View.PageBound);
TextPointSearchRange searchRange;
if (this.View.HitTextArea(p.X, p.Y))
+ {
searchRange = TextPointSearchRange.TextAreaOnly;
+ }
else if (leftPressed)
+ {
searchRange = TextPointSearchRange.Full;
+ }
else
- searchRange = TextPointSearchRange.TextAreaOnly;
+ {
+ this.Cursor = Cursors.Arrow;
+ base.OnMouseMove(e);
+ return;
+ }
TextPoint tp = this.View.GetTextPointFromPostion(p, searchRange);
if (tp == TextPoint.Null)
{
+ this.Cursor = Cursors.Arrow;
base.OnMouseMove(e);
return;
}
{
this.Cursor = Cursors.Arrow;
}
-
if (leftPressed)
{
bool controlPressed = (Keyboard.GetKeyStates(Key.LeftCtrl) & KeyStates.Down) == KeyStates.Down;
toX = this.horizontalScrollBar.Value;
else
toX = -this.horizontalScrollBar.Value;
- this._Controller.Scroll(toX, this.View.Src.Row, false, false);
+ this.Controller.ScrollByPixel(ScrollDirection.Left, (int)toX, false, false);
this.Refresh();
}
{
if (this.verticalScrollBar == null)
return;
- int newRow = (int)this.verticalScrollBar.Value;
- if (newRow >= this.View.LayoutLines.Count)
- return;
- this._Controller.Scroll(this.View.Src.X,newRow, false, false);
+ this.Controller.Scroll(this.Document.Src.X, (int)this.verticalScrollBar.Value, false, false);
this.Refresh();
}
if (this.horizontalScrollBar == null || this.verticalScrollBar == null)
return;
EditView view = this.View;
- if (view.Src.Row > this.verticalScrollBar.Maximum)
- this.verticalScrollBar.Maximum = view.Src.Row + view.LineCountOnScreen + 1;
+ if (view.Src.Row > this.Document.LayoutLines.Count)
+ this.verticalScrollBar.Maximum = this.Document.LayoutLines.Count - 1;
double absoulteX = Math.Abs(view.Src.X);
if(absoulteX > this.horizontalScrollBar.Maximum)
this.horizontalScrollBar.Maximum = absoulteX + view.PageBound.Width + 1;
this._Document.AutoComplete.GetPostion = (tp, edoc) =>
{
var p = this.View.GetPostionFromTextPoint(tp);
- int height = (int)doc.LayoutLines.GetLayout(edoc.CaretPostion.row).Height;
+ int height = (int)this.Render.emSize.Height;
p.Y += height;
return PointToScreen(this.TranslatePoint(p.Scale(Util.GetScale()), this));
};