getLines ();
textMeasureIsUpToDate = false;
}
+ constraintsLocations();
NotifyValueChanged ("Text", Text);
OnTextChanged (this, new TextChangeEventArgs (new TextChange (0, oldTextLength, _text)));
RegisterForGraphicUpdate ();
}
}
+ void constraintsLocations () {
+ if (selectionStart.HasValue) {
+ CharLocation loc = CurrentLoc.Value;
+ int l = Math.Min (loc.Line, lines.Count - 1);
+ selectionStart = new CharLocation (l, Math.Min (loc.Column, lines[l].Length - 1));
+ }
+ if (CurrentLoc.HasValue) {
+ CharLocation loc = CurrentLoc.Value;
+ int l = Math.Min (loc.Line, lines.Count - 1);
+ CurrentLoc = new CharLocation (l, Math.Min (loc.Column, lines[l].Length - 1));
+ }
+ }
+
/// <summary>
/// If 'true', linebreaks will be interpreted. If 'false', linebreaks are threated as unprintable
/// unicode characters. Default value is 'False'.
return;
_multiline = value;
getLines ();
+ constraintsLocations();
NotifyValueChangedAuto (_multiline);
RegisterForGraphicUpdate();
}
selRect.Width = selEnd.VisualCharXPosition - selStart.VisualCharXPosition;
}
+
gr.SetSource (selBackground);
gr.Rectangle (selRect);
if (encodedBytes < 0)
return true;
}
- void updateLocation (Context gr, int clientWidth, ref CharLocation? location) {
+ protected void updateLocation (Context gr, int clientWidth, ref CharLocation? location) {
if (location == null)
return;
CharLocation loc = location.Value;
}
/// <summary> Process scrolling vertically, or if shift is down, vertically </summary>
- public override void onMouseWheel (object sender, MouseWheelEventArgs e) {
- base.onMouseWheel (sender, e);
+ public override void onMouseWheel (object sender, MouseWheelEventArgs e) {
if (IFace.Shift)
ScrollX += e.Delta * MouseWheelSpeed;
else
ScrollY -= e.Delta * MouseWheelSpeed;
+
+ e.Handled = true;
+ base.onMouseWheel (sender, e);
}
- public override void onMouseMove (object sender, MouseMoveEventArgs e) {
- base.onMouseMove (sender, e);
- if (!HasFocus || !IFace.IsDown (MouseButton.Left))
- return;
+ public override void onMouseMove (object sender, MouseMoveEventArgs e) {
+ if (!HasFocus || !IFace.IsDown (MouseButton.Left)) {
+ base.onMouseMove (sender, e);
+ return;
+ }
Rectangle cb = ClientRectangle;
if (CurrentLoc.Value.VisualCharXPosition < scrollX)
else if (CurrentLoc.Value.Line > lastLine)
ScrollY = (int)(lineHeight * (CurrentLoc.Value.Line + 1)) - cb.Height;
+ e.Handled = true;
+ base.onMouseMove (sender, e);
}
#endregion
public override void OnLayoutChanges (LayoutingType layoutType) {