public override bool ConsumeKey(Key key) { if (ActiveChild.ConsumeKey(key)) { CalculateSize(); return(true); } if (key == Key.Down) { if (ActiveChild == mainRowContainer) { Point point = ActiveChild.GetVerticalCaretLocation(); ActiveChild = bottomRowContainer; point.Y = ActiveChild.Top + 1; ActiveChild.SetCursorOnKeyUpDown(key, point); return(true); } } else if (key == Key.Up) { if (ActiveChild == bottomRowContainer) { Point point = ActiveChild.GetVerticalCaretLocation(); ActiveChild = mainRowContainer; point.Y = ActiveChild.Bottom - 1; ActiveChild.SetCursorOnKeyUpDown(key, point); return(true); } } return(false); }
public void AdjustCarets() { vCaret.Location = ActiveChild.GetVerticalCaretLocation(); vCaret.CaretLength = ActiveChild.GetVerticalCaretLength(); EquationContainer innerMost = ((RowContainer)ActiveChild).GetInnerMostEquationContainer(); hCaret.Location = innerMost.GetHorizontalCaretLocation(); hCaret.CaretLength = innerMost.GetHorizontalCaretLength(); }
public override bool ConsumeKey(Key key) { if (ActiveChild.ConsumeKey(key)) { CalculateSize(); return(true); } int currentIndex = childEquations.IndexOf(ActiveChild); if (key == Key.Right) { if (currentIndex % columns < columns - 1)//not last column? { ActiveChild = childEquations[currentIndex + 1]; return(true); } } else if (key == Key.Left) { if (currentIndex % columns > 0)//not last column? { ActiveChild = childEquations[currentIndex - 1]; return(true); } } else if (key == Key.Up) { if (currentIndex / columns > 0)//not in first row? { Point point = ActiveChild.GetVerticalCaretLocation(); ActiveChild = childEquations[currentIndex - columns];; point.Y = ActiveChild.Top + 1; ActiveChild.SetCursorOnKeyUpDown(key, point); return(true); } } else if (key == Key.Down) { if (currentIndex / columns < rows - 1)//not in last row? { Point point = ActiveChild.GetVerticalCaretLocation(); ActiveChild = childEquations[currentIndex + columns];; point.Y = ActiveChild.Top + 1; ActiveChild.SetCursorOnKeyUpDown(key, point); return(true); } } return(false); }