diff --git a/src/app/dialogs/tools/dialogpointofcontact.cpp b/src/app/dialogs/tools/dialogpointofcontact.cpp index 8476ea8ec..16ea78527 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.cpp +++ b/src/app/dialogs/tools/dialogpointofcontact.cpp @@ -33,6 +33,7 @@ #include "../../visualization/vistoolpointofcontact.h" #include "../../widgets/vmaingraphicsscene.h" #include "../../xml/vpattern.h" +#include "dialogeditwrongformula.h" //--------------------------------------------------------------------------------------------------------------------- /** @@ -45,7 +46,6 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, const quint32 radius(QString()), formulaBaseHeight(0), line(nullptr) { ui->setupUi(this); - InitVariables(ui); InitFormulaUI(ui); ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel)); labelEditNamePoint = ui->labelEditNamePoint; @@ -60,24 +60,7 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, const quint32 FillComboBoxPoints(ui->comboBoxSecondPoint); FillComboBoxPoints(ui->comboBoxCenter); - connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogPointOfContact::PutHere); - connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogPointOfContact::PutVal); - - if (qApp->patternType() == MeasurementsType::Standard) - { - SizeHeight(); - connect(ui->radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogTool::SizeHeight); - } - else - { - radioButtonSizeGrowth->setVisible(false); - Measurements(); - } - connect(ui->radioButtonStandardTable, &QRadioButton::clicked, this, &DialogPointOfContact::Measurements); - connect(ui->radioButtonIncrements, &QRadioButton::clicked, this, &DialogPointOfContact::Increments); - connect(ui->radioButtonLengthLine, &QRadioButton::clicked, this, &DialogPointOfContact::LengthLines); - connect(ui->radioButtonLengthArc, &QRadioButton::clicked, this, &DialogPointOfContact::LengthArcs); - connect(ui->radioButtonLengthSpline, &QRadioButton::clicked, this, &DialogPointOfContact::LengthCurves); + connect(ui->toolButtonExprRadius, &QPushButton::clicked, this, &DialogPointOfContact::FXRadius); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogPointOfContact::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogPointOfContact::FormulaTextChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogPointOfContact::DeployFormulaTextEdit); @@ -132,6 +115,19 @@ void DialogPointOfContact::PointNameChanged() CheckState(); } +//--------------------------------------------------------------------------------------------------------------------- +void DialogPointOfContact::FXRadius() +{ + DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data, toolId, this); + dialog->setWindowTitle(tr("Edit radius")); + dialog->SetFormula(getRadius()); + if (dialog->exec() == QDialog::Accepted) + { + setRadius(dialog->GetFormula()); + } + delete dialog; +} + //--------------------------------------------------------------------------------------------------------------------- void DialogPointOfContact::ShowVisualization() { diff --git a/src/app/dialogs/tools/dialogpointofcontact.h b/src/app/dialogs/tools/dialogpointofcontact.h index 54ec9fdcf..d3d59f51b 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.h +++ b/src/app/dialogs/tools/dialogpointofcontact.h @@ -73,6 +73,7 @@ public slots: */ void FormulaTextChanged(); virtual void PointNameChanged(); + void FXRadius(); protected: virtual void ShowVisualization(); /** diff --git a/src/app/dialogs/tools/dialogpointofcontact.ui b/src/app/dialogs/tools/dialogpointofcontact.ui index 8dee56fac..5f3aa5cad 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.ui +++ b/src/app/dialogs/tools/dialogpointofcontact.ui @@ -7,7 +7,7 @@ 0 0 498 - 499 + 251 @@ -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,283 +197,127 @@ - - - - - - - - - - - - 0 - 0 - - - - Point label - - - - - - - - - - - 0 - 0 - - - - Center of arc - - - - - - - - 0 - 0 - - - - - 145 - 0 - - - - Select point of center of arc - - - - - - - - 0 - 0 - - - - Top of the line - - - - - - - - 0 - 0 - - - - - 143 - 0 - - - - - - - - - 0 - 0 - - - - End of the line - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - - 110 - 16777215 - - - - - 80 - 14 - - - - - - - - - - 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 + + + + Center of arc + + + + + + + + 0 + 0 + + + + + 145 + 0 + + + + Select point of center of arc + + + + + + + + 0 + 0 + + + + Top of the line + + + + + + + + 0 + 0 + + + + + 143 + 0 + + + + + + + + + 0 + 0 + + + + End of the line + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + + 110 + 16777215 + + + + + 80 + 14 + + + - - - - - - - true - - - @@ -491,21 +332,11 @@ plainTextEditFormula - toolButtonPutHere pushButtonGrowLength lineEditNamePoint comboBoxCenter comboBoxFirstPoint comboBoxSecondPoint - radioButtonSizeGrowth - radioButtonStandardTable - radioButtonIncrements - radioButtonLengthLine - radioButtonLengthArc - radioButtonLengthSpline - radioButtonAngleLine - checkBoxHideEmpty - listWidget buttonBox