예제 #1
0
 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);
        }
예제 #3
0
        public override EquationBase Split(EquationContainer newParent)
        {
            EquationBase result = ActiveChild.Split(this);

            CalculateSize();
            return(result);
        }
예제 #4
0
 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;
             }
         }
     }
 }
예제 #5
0
 public RowAction(ISupportsUndo executor, EquationBase equation, TextEquation equationAfter, int index, int caretIndex)
     : base(executor)
 {
     Index = index;
     Equation = equation;
     CaretIndex = caretIndex;
     EquationAfter = equationAfter;
 }
예제 #6
0
 public RowAction(ISupportsUndo executor, EquationBase equation, TextEquation equationAfter, int index, int caretIndex)
     : base(executor)
 {
     Index         = index;
     Equation      = equation;
     CaretIndex    = caretIndex;
     EquationAfter = equationAfter;
 }
예제 #7
0
 public virtual void ChildCompletedUndo(EquationBase child)
 {
     ActiveChild = child;
     CalculateSize();
     if (ParentEquation != null)
     {
         ParentEquation.ChildCompletedUndo(this);
     }
 }
예제 #8
0
 public virtual void ChildCompletedUndo(EquationBase child)
 {
     ActiveChild = child;
     CalculateSize();
     if (ParentEquation != null)
     {
         ParentEquation.ChildCompletedUndo(this);
     }
 }
예제 #9
0
 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);
 }
예제 #10
0
        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);
        }
예제 #11
0
        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);
        }
예제 #12
0
 void RemoveChild(EquationBase child)
 {
     childEquations.Remove(child);
     CalculateSize();
 }
예제 #13
0
 public override void ChildCompletedUndo(EquationBase child)
 {
     CalculateSize();
     AdjustCarets();
 }
예제 #14
0
 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;
 }
예제 #15
0
 public int GetIndex(EquationBase child)
 {
     return(childEquations.IndexOf(child));
 }
예제 #16
0
 public override void ChildCompletedUndo(EquationBase child)
 {
     CalculateSize();
     AdjustCarets();
 }
예제 #17
0
 public void ReleaseChild(EquationBase child)
 {
     if (childEquations.Contains(child))
     {
         childEquations.Remove(child);
     }
 }
예제 #18
0
 public void ResetRowEquation(EquationBase activeChild, int selectionStartIndex, int selectedItems)
 {
     this.SelectionStartIndex = selectionStartIndex;
     this.SelectedItems = selectedItems;
     this.ActiveChild = activeChild;
 }
예제 #19
0
 public void SetBuddy(EquationBase buddy)
 {
     this.Buddy = buddy;
     CalculateHeight();
 }
예제 #20
0
 public void SetBuddy(EquationBase buddy)
 {
     this.Buddy = buddy;
     CalculateHeight();
 }
예제 #21
0
 public int GetIndex(EquationBase child)
 {
     return childEquations.IndexOf(child);
 }