void IScroller.ScrollerInfo(ScrollerPanel.ScrolleeEventArgs sea) { bool always = Sizes_Line == null; if (sea.Orientation == Orientation.Vertical) { double originalCursorLine = (always || Sizes_Line == null) ? -1 : Sizes_Line.CursorValue; double originalStartLine = (always || Sizes_Line == null) ? -1 : Sizes_Line.StartValue; Sizes_Line = sea.Clone(); JustifyStartLineAroundCursor(); AdjustOtherPanelsIfAnyChanges_Line(always, originalCursorLine, originalStartLine); if (GetParentScroller() != null) { GetParentScroller().ScrollerInfo(Sizes_Line); } } else { double originalCursorX = (always || Sizes_X == null) ? -1 : Sizes_X.CursorValue; double originalStartX = (always || Sizes_X == null) ? -1 : Sizes_X.StartValue; Sizes_X = sea.Clone(); JustifyStartXAroundCursor(); AdjustOtherPanelsIfAnyChanges_X(always, originalCursorX, originalStartX); if (GetParentScroller() != null) { GetParentScroller().ScrollerInfo(Sizes_X); } } }
protected override void SetScrolleeInfo(Orientation orientation, ScrollerPanel.ScrolleeEventArgs sea) { int verticalSpan = Lines.Count; int horizontalSpan = MaxCharsWide; sea.Orientation = orientation; sea.SmallChange = 1; if (orientation == Orientation.Vertical) { sea.LargeChange = verticalSpan; sea.StartValue = StartLine; sea.CursorValue = CursorLine; sea.Minimum = 0; sea.Maximum = (verticalSpan > 0) ? verticalSpan - 1 : verticalSpan; sea.ViewportSize = verticalSpan; sea.ViewableSpan = ActualHeight / LineHeight - 1; } else { sea.LargeChange = horizontalSpan; sea.StartValue = StartX; sea.CursorValue = CursorX; sea.Minimum = 0; sea.Maximum = (horizontalSpan > 0) ? horizontalSpan - 1 : horizontalSpan; sea.ViewportSize = horizontalSpan; sea.ViewableSpan = ActualWidth / SpaceWidth - 1; } }
public void SendScrolleeInfo() { if (Parent is IScroller) { ScrollerPanel.ScrolleeEventArgs sea = new ScrollerPanel.ScrolleeEventArgs(); SetScrolleeInfo(Orientation.Vertical, sea); (Parent as IScroller).ScrollerInfo(sea); SetScrolleeInfo(Orientation.Horizontal, sea); (Parent as IScroller).ScrollerInfo(sea); } }
public CursorPanel() : base() { SizeChanged += CursorPanel_SizeChanged; PreviewKeyDown += CursorPanel_PreviewKeyDown; PreviewTextInput += CursorPanel_PreviewTextInput; Sizes_Line = new ScrollerPanel.ScrolleeEventArgs(); Sizes_X = new ScrollerPanel.ScrolleeEventArgs(); Focusable = true; //Focus(); // Uncomment this and the program will goto into an infinite loop under the appropriate cirsumstances. //IsHitTestVisible = true; }
private void AdjustOtherPanelsIfAnyChanges_X(bool always, double originalCursor, double originalStart) { if (always || originalCursor != Sizes_X.CursorValue || originalStart != Sizes_X.StartValue) { if (GetParentScroller() != null) { ScrollerPanel.ScrolleeEventArgs sea = new ScrollerPanel.ScrolleeEventArgs(); sea.Copy(Sizes_X); GetParentScroller().ScrollerInfo(sea); } if (Content is IScrollee) { (Content as IScrollee).ScrolleeStart(Sizes_X.Orientation, Sizes_X.StartValue); (Content as IScrollee).ScrolleeCursor(Sizes_X.Orientation, Sizes_X.CursorValue); } } }
protected override void SetScrolleeInfo(Orientation orientation, ScrollerPanel.ScrolleeEventArgs sea) { if (orientation == Orientation.Horizontal) { return; } int verticalSpan = LineStarts.Length; sea.Orientation = Orientation.Vertical; sea.SmallChange = 1; sea.LargeChange = verticalSpan; sea.StartValue = StartLine; sea.CursorValue = CursorLine; sea.Minimum = 0; sea.Maximum = (verticalSpan > 0) ? verticalSpan - 1 : verticalSpan; sea.ViewportSize = verticalSpan; sea.ViewableSpan = ActualHeight / LineHeight - 1; }
void IScroller.ScrollerInfo(ScrollerPanel.ScrolleeEventArgs sea) { CreateScrollBar(sea.Orientation); SetScrollBarValues(sea); }
protected abstract void SetScrolleeInfo(Orientation orientation, ScrollerPanel.ScrolleeEventArgs sea);