public void MoveDown() { InterlinLineChoices choices = new InterlinLineChoices(m_lp, kwsVernInPara, kwsAnalysis); // To make it less confusing, here we add them in an order that does not produce // reordering. MakeStandardState(choices); // lit trans can move up Assert.IsTrue(choices.OkToMoveDown(0)); // most moves are OK in non-edit mode Assert.IsTrue(choices.OkToMoveDown(1)); Assert.IsTrue(choices.OkToMoveDown(2)); Assert.IsTrue(choices.OkToMoveDown(3)); Assert.IsTrue(choices.OkToMoveDown(4)); // whole morph bundle will move down Assert.IsTrue(choices.OkToMoveDown(5)); Assert.IsFalse(choices.OkToMoveDown(6)); // Would put FF out of order Assert.IsTrue(choices.OkToMoveDown(7)); Assert.IsFalse(choices.OkToMoveDown(8)); choices.MoveDown(0); // morphemes is now top Assert.AreEqual(InterlinLineChoices.kflidMorphemes, choices[0].Flid); // Word moved down to position 4 Assert.AreEqual(InterlinLineChoices.kflidWord, choices[4].Flid); // Lex Gloss (to pick just one) also moved up Assert.AreEqual(InterlinLineChoices.kflidLexGloss, choices[2].Flid); choices = new InterlinLineChoices(m_lp, kwsVernInPara, kwsAnalysis); MakeStandardState(choices); choices.MoveDown(1); // nothing complicated, two items changed place. Assert.AreEqual(InterlinLineChoices.kflidLexEntries, choices[1].Flid); Assert.AreEqual(InterlinLineChoices.kflidMorphemes, choices[2].Flid); choices = new InterlinLineChoices(m_lp, kwsVernInPara, kwsAnalysis); MakeStandardState(choices); choices.MoveDown(4); // Moves past whole morpheme bundle Assert.AreEqual(InterlinLineChoices.kflidWordGloss, choices[1].Flid); Assert.AreEqual(InterlinLineChoices.kflidMorphemes, choices[2].Flid); Assert.AreEqual(InterlinLineChoices.kflidLexEntries, choices[3].Flid); choices = new InterlinLineChoices(m_lp, kwsVernInPara, kwsAnalysis); MakeStandardState(choices); choices.MoveDown(5); // nothing complicated, two items changed place. Assert.AreEqual(InterlinLineChoices.kflidWordPos, choices[5].Flid); Assert.AreEqual(InterlinLineChoices.kflidWordGloss, choices[6].Flid); choices = new InterlinLineChoices(m_lp, kwsVernInPara, kwsAnalysis); MakeStandardState(choices); choices.MoveDown(7); // nothing complicated, two items changed place. Assert.AreEqual(InterlinLineChoices.kflidLitTrans, choices[7].Flid); Assert.AreEqual(InterlinLineChoices.kflidFreeTrans, choices[8].Flid); }
private void moveDownButton_Click(object sender, System.EventArgs e) { if (CurrentListIndex < 0 || !m_choices.OkToMoveDown(CurrentListIndex)) { return; } InterlinLineSpec spec = m_choices[CurrentListIndex]; m_choices.MoveDown(CurrentListIndex); InitCurrentList(spec); }
public void MoveDown() { InterlinLineChoices choices = new InterlinLineChoices(0, kwsAnalysis); // To make it less confusing, here we add them in an order that does not produce // reordering. MakeStandardState(choices); // lit trans can move up Assert.IsTrue(choices.OkToMoveDown(0)); // most moves are OK in non-edit mode Assert.IsTrue(choices.OkToMoveDown(1)); Assert.IsTrue(choices.OkToMoveDown(2)); Assert.IsTrue(choices.OkToMoveDown(3)); Assert.IsTrue(choices.OkToMoveDown(4)); // whole morph bundle will move down Assert.IsTrue(choices.OkToMoveDown(5)); Assert.IsFalse(choices.OkToMoveDown(6)); // Would put FF out of order Assert.IsTrue(choices.OkToMoveDown(7)); Assert.IsFalse(choices.OkToMoveDown(8)); choices.MoveDown(0); // morphemes is now top Assert.AreEqual(InterlinLineChoices.kflidMorphemes, choices[0].Flid); // Word moved down to position 4 Assert.AreEqual(InterlinLineChoices.kflidWord, choices[4].Flid); // Lex Gloss (to pick just one) also moved up Assert.AreEqual(InterlinLineChoices.kflidLexGloss, choices[2].Flid); choices = new InterlinLineChoices(0, kwsAnalysis); MakeStandardState(choices); choices.MoveDown(1); // nothing complicated, two items changed place. Assert.AreEqual(InterlinLineChoices.kflidLexEntries, choices[1].Flid); Assert.AreEqual(InterlinLineChoices.kflidMorphemes, choices[2].Flid); choices = new InterlinLineChoices(0, kwsAnalysis); MakeStandardState(choices); choices.MoveDown(4); // Moves past whole morpheme bundle Assert.AreEqual(InterlinLineChoices.kflidWordGloss, choices[1].Flid); Assert.AreEqual(InterlinLineChoices.kflidMorphemes, choices[2].Flid); Assert.AreEqual(InterlinLineChoices.kflidLexEntries, choices[3].Flid); choices = new InterlinLineChoices(0, kwsAnalysis); MakeStandardState(choices); choices.MoveDown(5); // nothing complicated, two items changed place. Assert.AreEqual(InterlinLineChoices.kflidWordPos, choices[5].Flid); Assert.AreEqual(InterlinLineChoices.kflidWordGloss, choices[6].Flid); choices = new InterlinLineChoices(0, kwsAnalysis); MakeStandardState(choices); choices.MoveDown(7); // nothing complicated, two items changed place. Assert.AreEqual(InterlinLineChoices.kflidLitTrans, choices[7].Flid); Assert.AreEqual(InterlinLineChoices.kflidFreeTrans, choices[8].Flid); }