diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/app/dialogs/tools/dialogalongline.cpp
index 3ccc55d5a..0f5ca7f0e 100644
--- a/src/app/dialogs/tools/dialogalongline.cpp
+++ b/src/app/dialogs/tools/dialogalongline.cpp
@@ -218,6 +218,7 @@ void DialogAlongLine::setFormula(const QString &value)
}
ui->plainTextEditFormula->setPlainText(formula);
line->setLength(formula);
+ MoveCursorToEnd(ui->plainTextEditFormula);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/dialogs/tools/dialogarc.cpp b/src/app/dialogs/tools/dialogarc.cpp
index fded0782b..941863a18 100644
--- a/src/app/dialogs/tools/dialogarc.cpp
+++ b/src/app/dialogs/tools/dialogarc.cpp
@@ -143,6 +143,7 @@ void DialogArc::SetF2(const QString &value)
}
ui->plainTextEditF2->setPlainText(f2);
path->setF2(f2);
+ MoveCursorToEnd(ui->plainTextEditF2);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -160,6 +161,7 @@ void DialogArc::SetF1(const QString &value)
}
ui->plainTextEditF1->setPlainText(f1);
path->setF1(f1);
+ MoveCursorToEnd(ui->plainTextEditF1);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -177,6 +179,7 @@ void DialogArc::SetRadius(const QString &value)
}
ui->plainTextEditFormula->setPlainText(radius);
path->setRadius(radius);
+ MoveCursorToEnd(ui->plainTextEditFormula);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp
index 7b7ed07ad..0dc5a080c 100644
--- a/src/app/dialogs/tools/dialogbisector.cpp
+++ b/src/app/dialogs/tools/dialogbisector.cpp
@@ -219,6 +219,7 @@ void DialogBisector::setFormula(const QString &value)
}
ui->plainTextEditFormula->setPlainText(formula);
line->setLength(formula);
+ MoveCursorToEnd(ui->plainTextEditFormula);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp
index f51e476ec..00e1ef42b 100644
--- a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp
+++ b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp
@@ -120,6 +120,7 @@ void DialogCurveIntersectAxis::setAngle(const QString &value)
}
ui->plainTextEditFormula->setPlainText(formulaAngle);
line->setAngle(formulaAngle);
+ MoveCursorToEnd(ui->plainTextEditFormula);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/dialogs/tools/dialogcutarc.cpp b/src/app/dialogs/tools/dialogcutarc.cpp
index 312354b2c..759b1ce7f 100644
--- a/src/app/dialogs/tools/dialogcutarc.cpp
+++ b/src/app/dialogs/tools/dialogcutarc.cpp
@@ -162,6 +162,7 @@ void DialogCutArc::setFormula(const QString &value)
}
ui->plainTextEditFormula->setPlainText(formula);
path->setLength(formula);
+ MoveCursorToEnd(ui->plainTextEditFormula);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/dialogs/tools/dialogcutspline.cpp b/src/app/dialogs/tools/dialogcutspline.cpp
index c99c3338c..becf3a736 100644
--- a/src/app/dialogs/tools/dialogcutspline.cpp
+++ b/src/app/dialogs/tools/dialogcutspline.cpp
@@ -101,6 +101,7 @@ void DialogCutSpline::setFormula(const QString &value)
}
ui->plainTextEditFormula->setPlainText(formula);
path->setLength(formula);
+ MoveCursorToEnd(ui->plainTextEditFormula);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/dialogs/tools/dialogcutsplinepath.cpp b/src/app/dialogs/tools/dialogcutsplinepath.cpp
index 6c01dd21d..b0bb4d79d 100644
--- a/src/app/dialogs/tools/dialogcutsplinepath.cpp
+++ b/src/app/dialogs/tools/dialogcutsplinepath.cpp
@@ -101,6 +101,7 @@ void DialogCutSplinePath::setFormula(const QString &value)
}
ui->plainTextEditFormula->setPlainText(formula);
path->setLength(formula);
+ MoveCursorToEnd(ui->plainTextEditFormula);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/dialogs/tools/dialogeditwrongformula.cpp b/src/app/dialogs/tools/dialogeditwrongformula.cpp
index 85ec8beee..b66251c32 100644
--- a/src/app/dialogs/tools/dialogeditwrongformula.cpp
+++ b/src/app/dialogs/tools/dialogeditwrongformula.cpp
@@ -123,6 +123,7 @@ void DialogEditWrongFormula::setFormula(const QString &value)
this->DeployFormulaTextEdit();
}
ui->plainTextEditFormula->setPlainText(formula);
+ MoveCursorToEnd(ui->plainTextEditFormula);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp
index 5e901182e..73485c697 100644
--- a/src/app/dialogs/tools/dialogendline.cpp
+++ b/src/app/dialogs/tools/dialogendline.cpp
@@ -189,6 +189,7 @@ void DialogEndLine::setFormula(const QString &value)
}
ui->plainTextEditFormula->setPlainText(formulaLength);
line->setLength(formulaLength);
+ MoveCursorToEnd(ui->plainTextEditFormula);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -207,6 +208,7 @@ void DialogEndLine::setAngle(const QString &value)
}
ui->plainTextEditAngle->setPlainText(formulaAngle);
line->setAngle(formulaAngle);
+ MoveCursorToEnd(ui->plainTextEditAngle);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/dialogs/tools/dialogendline.ui b/src/app/dialogs/tools/dialogendline.ui
index c05c5d77a..8ae186d0a 100644
--- a/src/app/dialogs/tools/dialogendline.ui
+++ b/src/app/dialogs/tools/dialogendline.ui
@@ -632,14 +632,26 @@
+ plainTextEditFormula
+ toolButtonPutHereLength
+ toolButtonEqualLength
+ pushButtonGrowLength
+ plainTextEditAngle
+ toolButtonPutHereAngle
+ toolButtonEqualAngle
+ pushButtonGrowLengthAngle
+ comboBoxBasePoint
+ lineEditNamePoint
+ comboBoxLineType
radioButtonSizeGrowth
radioButtonStandardTable
radioButtonIncrements
radioButtonLengthLine
radioButtonLengthArc
radioButtonLengthSpline
+ radioButtonAngleLine
+ checkBoxHideEmpty
listWidget
- toolButtonEqualLength
buttonBox
diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.cpp b/src/app/dialogs/tools/dialoglineintersectaxis.cpp
index 3936e7228..54ff4b1eb 100644
--- a/src/app/dialogs/tools/dialoglineintersectaxis.cpp
+++ b/src/app/dialogs/tools/dialoglineintersectaxis.cpp
@@ -121,6 +121,7 @@ void DialogLineIntersectAxis::setAngle(const QString &value)
}
ui->plainTextEditFormula->setPlainText(formulaAngle);
line->setAngle(formulaAngle);
+ MoveCursorToEnd(ui->plainTextEditFormula);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp
index 01dd8bdde..e950b364f 100644
--- a/src/app/dialogs/tools/dialognormal.cpp
+++ b/src/app/dialogs/tools/dialognormal.cpp
@@ -229,6 +229,7 @@ void DialogNormal::setFormula(const QString &value)
}
ui->plainTextEditFormula->setPlainText(formula);
line->setLength(formula);
+ MoveCursorToEnd(ui->plainTextEditFormula);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/dialogs/tools/dialogpointofcontact.cpp b/src/app/dialogs/tools/dialogpointofcontact.cpp
index a4f6331c8..06c0d0c01 100644
--- a/src/app/dialogs/tools/dialogpointofcontact.cpp
+++ b/src/app/dialogs/tools/dialogpointofcontact.cpp
@@ -259,6 +259,7 @@ void DialogPointOfContact::setRadius(const QString &value)
}
ui->plainTextEditFormula->setPlainText(radius);
line->setRadius(radius);
+ MoveCursorToEnd(ui->plainTextEditFormula);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp
index 731d05a03..a55968ad2 100644
--- a/src/app/dialogs/tools/dialogshoulderpoint.cpp
+++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp
@@ -247,6 +247,7 @@ void DialogShoulderPoint::setFormula(const QString &value)
}
ui->plainTextEditFormula->setPlainText(formula);
line->setLength(formula);
+ MoveCursorToEnd(ui->plainTextEditFormula);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp
index 585bee365..718a9e346 100644
--- a/src/app/dialogs/tools/dialogtool.cpp
+++ b/src/app/dialogs/tools/dialogtool.cpp
@@ -392,6 +392,15 @@ void DialogTool::PutValHere(QPlainTextEdit *plainTextEdit, QListWidget *listWidg
}
}
+//---------------------------------------------------------------------------------------------------------------------
+void DialogTool::MoveCursorToEnd(QPlainTextEdit *plainTextEdit)
+{
+ SCASSERT(plainTextEdit != nullptr);
+ QTextCursor cursor = plainTextEdit->textCursor();
+ cursor.movePosition(QTextCursor::End, QTextCursor::MoveAnchor);
+ plainTextEdit->setTextCursor(cursor);
+}
+
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ValFormulaChanged handle change formula
diff --git a/src/app/dialogs/tools/dialogtool.h b/src/app/dialogs/tools/dialogtool.h
index c5a93281a..d50a404af 100644
--- a/src/app/dialogs/tools/dialogtool.h
+++ b/src/app/dialogs/tools/dialogtool.h
@@ -333,6 +333,7 @@ protected:
* @brief SaveData Put dialog data in local variables
*/
virtual void SaveData(){}
+ void MoveCursorToEnd(QPlainTextEdit *plainTextEdit);
private:
void FillList(QComboBox *box, const QMap &list)const;
};