public void ReleaseChild(EquationBase child) { if (childEquations.Contains(child)) { childEquations.Remove(child); } }
public static EquationBase CreateEquation(EquationContainer equationParent, Position position, SignCompositeSymbol symbol, bool useUpright) { EquationBase equation = null; switch (position) { case Position.None: equation = new SignSimple(equationParent, symbol, useUpright); break; case Position.Bottom: equation = new SignBottom(equationParent, symbol, useUpright); break; case Position.BottomAndTop: equation = new SignBottomTop(equationParent, symbol, useUpright); break; case Position.Sub: equation = new SignSub(equationParent, symbol, useUpright); break; case Position.SubAndSuper: equation = new SignSubSuper(equationParent, symbol, useUpright); break; } return(equation); }
public override EquationBase Split(EquationContainer newParent) { EquationBase result = ActiveChild.Split(this); CalculateSize(); return(result); }
public override void SetCursorOnKeyUpDown(Key key, Point point) { if (key == Key.Up) { for (int i = childEquations.Count - 1; i >= 0; i--) { Type type = childEquations[i].GetType(); if (type == typeof(RowContainer) || type == typeof(EquationRow)) { childEquations[i].SetCursorOnKeyUpDown(key, point); ActiveChild = childEquations[i]; break; } } } else { for (int i = 0; i < childEquations.Count; i++) { Type type = childEquations[i].GetType(); if (type == typeof(RowContainer) || type == typeof(EquationRow)) { childEquations[i].SetCursorOnKeyUpDown(key, point); ActiveChild = childEquations[i]; break; } } } }
public RowAction(ISupportsUndo executor, EquationBase equation, TextEquation equationAfter, int index, int caretIndex) : base(executor) { Index = index; Equation = equation; CaretIndex = caretIndex; EquationAfter = equationAfter; }
public virtual void ChildCompletedUndo(EquationBase child) { ActiveChild = child; CalculateSize(); if (ParentEquation != null) { ParentEquation.ChildCompletedUndo(this); } }
public override bool ConsumeMouseClick(Point mousePoint) { foreach (EquationBase eb in childEquations) { if (!eb.IsStatic && eb.Bounds.Contains(mousePoint)) { ActiveChild = eb; return(ActiveChild.ConsumeMouseClick(mousePoint)); } } return(false); }
public static EquationBase CreateEquation(EquationContainer equationParent, Position position) { EquationBase equation = null; switch (position) { case Position.Bottom: equation = new CompositeBottom(equationParent); break; case Position.Top: equation = new CompositeTop(equationParent); break; case Position.BottomAndTop: equation = new CompositeBottomTop(equationParent); break; } return(equation); }
public static EquationBase CreateEquation(EquationContainer equationParent, DivisionType divType) { EquationBase equation = null; switch (divType) { case DivisionType.DivRegular: equation = new DivRegular(equationParent); break; case DivisionType.DivRegularSmall: equation = new DivRegularSmall(equationParent); break; case DivisionType.DivDoubleBar: equation = new DivDoubleBar(equationParent); break; case DivisionType.DivTripleBar: equation = new DivTripleBar(equationParent); break; case DivisionType.DivHoriz: equation = new DivHorizontal(equationParent); break; case DivisionType.DivHorizSmall: equation = new DivHorizSmall(equationParent); break; case DivisionType.DivMath: equation = new DivMath(equationParent); break; case DivisionType.DivMathWithTop: equation = new DivMathWithTop(equationParent); break; case DivisionType.DivSlanted: equation = new DivSlanted(equationParent); break; case DivisionType.DivSlantedSmall: equation = new DivSlantedSmall(equationParent); break; case DivisionType.DivMathInverted: equation = new DivMathInverted(equationParent); break; case DivisionType.DivInvertedWithBottom: equation = new DivMathWithBottom(equationParent); break; case DivisionType.DivTriangleFixed: equation = new DivTriangle(equationParent, true); break; case DivisionType.DivTriangleExpanding: equation = new DivTriangle(equationParent, false); break; } return(equation); }
void RemoveChild(EquationBase child) { childEquations.Remove(child); CalculateSize(); }
public override void ChildCompletedUndo(EquationBase child) { CalculateSize(); AdjustCarets(); }
void AddChild(EquationBase newChild) { int index = 0; if (childEquations.Count > 0) { index = childEquations.IndexOf(ActiveChild) + 1; } childEquations.Insert(index, newChild); newChild.ParentEquation = this; ActiveChild = newChild; }
public int GetIndex(EquationBase child) { return(childEquations.IndexOf(child)); }
public void ResetRowEquation(EquationBase activeChild, int selectionStartIndex, int selectedItems) { this.SelectionStartIndex = selectionStartIndex; this.SelectedItems = selectedItems; this.ActiveChild = activeChild; }
public void SetBuddy(EquationBase buddy) { this.Buddy = buddy; CalculateHeight(); }
public int GetIndex(EquationBase child) { return childEquations.IndexOf(child); }