diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp index 428aba82a..6e14f08d8 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp @@ -34,6 +34,7 @@ #include "../../visualization/vistoolshoulderpoint.h" #include "../../widgets/vmaingraphicsscene.h" #include "../../tools/vabstracttool.h" +#include "dialogeditwrongformula.h" //--------------------------------------------------------------------------------------------------------------------- /** @@ -46,7 +47,6 @@ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, const quint32 & formulaBaseHeight(0), line (nullptr) { ui->setupUi(this); - InitVariables(ui); InitFormulaUI(ui); ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel)); labelEditNamePoint = ui->labelEditNamePoint; @@ -63,8 +63,7 @@ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, const quint32 & FillComboBoxPoints(ui->comboBoxP3); FillComboBoxLineColors(ui->comboBoxLineColor); - connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogShoulderPoint::PutHere); - connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogShoulderPoint::PutVal); + connect(ui->toolButtonExprLength, &QPushButton::clicked, this, &DialogShoulderPoint::FXLength); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogShoulderPoint::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogShoulderPoint::FormulaTextChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogShoulderPoint::DeployFormulaTextEdit); @@ -109,6 +108,19 @@ void DialogShoulderPoint::PointNameChanged() CheckState(); } +//--------------------------------------------------------------------------------------------------------------------- +void DialogShoulderPoint::FXLength() +{ + DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data, toolId, this); + dialog->setWindowTitle(tr("Edit length")); + dialog->SetFormula(GetFormula()); + if (dialog->exec() == QDialog::Accepted) + { + SetFormula(dialog->GetFormula()); + } + delete dialog; +} + //--------------------------------------------------------------------------------------------------------------------- void DialogShoulderPoint::ShowVisualization() { diff --git a/src/app/dialogs/tools/dialogshoulderpoint.h b/src/app/dialogs/tools/dialogshoulderpoint.h index c2b2de437..6360d75cf 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.h +++ b/src/app/dialogs/tools/dialogshoulderpoint.h @@ -78,6 +78,7 @@ public slots: */ void FormulaTextChanged(); virtual void PointNameChanged(); + void FXLength(); protected: virtual void ShowVisualization(); /** diff --git a/src/app/dialogs/tools/dialogshoulderpoint.ui b/src/app/dialogs/tools/dialogshoulderpoint.ui index 0bc344bb6..4c730548c 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.ui +++ b/src/app/dialogs/tools/dialogshoulderpoint.ui @@ -7,7 +7,7 @@ 0 0 488 - 565 + 317 @@ -87,16 +87,13 @@ - - - Insert variable into formula - + ... - :/icon/24x24/putHere.png:/icon/24x24/putHere.png + :/icon/24x24/fx.png:/icon/24x24/fx.png @@ -200,322 +197,166 @@ - - - - - - - - - - - - 0 - 0 - - - - Point label - - - - - - - - - - - 0 - 0 - - - - First point - - - - - - - - 0 - 0 - - - - - 145 - 0 - - - - - - - - - 0 - 0 - - - - Second point - - - - - - - - 0 - 0 - - - - - 143 - 0 - - - - - - - - - 0 - 0 - - - - Third point - - - - - - - - 0 - 0 - - - - - 145 - 0 - - - - - - - - - 0 - 0 - - - - Type of line - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - - 110 - 16777215 - - - - Show line from first point to our point - - - - 80 - 14 - - - - - - - - Line color - - - - - - - - - - - - Input data - - - - - - - - 0 - 0 - - - - Size and height - - - true - - - - - - - - 0 - 0 - - - - Measurements - - - - - - - - 0 - 0 - - - - Increments - - - - - - - true - - - - 0 - 0 - - - - Length of lines - - - - - - - true - - - - 0 - 0 - - - - Length of arcs - - - - - - - true - - - - 0 - 0 - - - - Length of curves - - - - - - - true - - - - 0 - 0 - - - - Angle of lines - - - - - - + + + + + + 0 + 0 + + + + Point label + + - - - - - - Hide empty measurements - - - true - - - - - - - Variables - Click twice to insert into formula - - - - + + + + + + + + 0 + 0 + + + + First point + + + + + + + + 0 + 0 + + + + + 145 + 0 + + + + + + + + + 0 + 0 + + + + Second point + + + + + + + + 0 + 0 + + + + + 143 + 0 + + + + + + + + + 0 + 0 + + + + Third point + + + + + + + + 0 + 0 + + + + + 145 + 0 + + + + + + + + + 0 + 0 + + + + Type of line + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + + 110 + 16777215 + + + + Show line from first point to our point + + + + 80 + 14 + + + + + + + + Line color + + + + + - - - - - - - true - - - @@ -530,22 +371,12 @@ plainTextEditFormula - toolButtonPutHere pushButtonGrowLength lineEditNamePoint comboBoxP1Line comboBoxP2Line comboBoxP3 comboBoxLineType - radioButtonSizeGrowth - radioButtonStandardTable - radioButtonIncrements - radioButtonLengthLine - radioButtonLengthArc - radioButtonLengthSpline - radioButtonAngleLine - checkBoxHideEmpty - listWidget buttonBox