/**
 * @brief setFormula set string of formula
 * @param value formula
 */
void DialogCutSplinePath::setFormula(const QString &value)
{
    formula = qApp->FormulaToUser(value);
    // increase height if needed. TODO : see if I can get the max number of caracters in one line
    // of this PlainTextEdit to change 80 to this value
    if (formula.length() > 80)
    {
        this->DeployFormulaTextEdit();
    }
    ui->plainTextEditFormula->setPlainText(formula);
    path->setLength(formula);
    MoveCursorToEnd(ui->plainTextEditFormula);
}
static void ExecuteCommand(bufferADT buffer, string line)
{
    int i;

    switch (toupper(line[0])) {
      case 'I': for (i = 1; line[i] != '\0'; i++) {
                    InsertCharacter(buffer, line[i]);
                }
                break;
      case 'D': DeleteCharacter(buffer); break;
      case 'F': MoveCursorForward(buffer); break;
      case 'B': MoveCursorBackward(buffer); break;
      case 'J': MoveCursorToStart(buffer); break;
      case 'E': MoveCursorToEnd(buffer); break;
      case 'H': HelpCommand(); break;
      case 'Q': exit(0);
      default:  printf("Illegal command\n"); break;
    }
}
Exemple #3
0
void CUILines::SetText(const char* text) {

    if (!m_pFont)
        m_pFont = UI()->Font()->pFontLetterica16Russian;

    if (text && text[0] != 0)
    {
        if(m_text==text)
            return;

        m_text		= text;

        uFlags.set(flNeedReparse, TRUE);
    }
    else
    {
        m_text = "";
        Reset();
    }
    MoveCursorToEnd();
}