From 85403594442116f15b41988dc92b5507a8a3f0b7 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 29 Apr 2015 21:15:26 +0300 Subject: [PATCH] F(x) button for tool Point intersect line and axis. --HG-- branch : feature --- .../dialogs/tools/dialoglineintersectaxis.cpp | 25 +- .../dialogs/tools/dialoglineintersectaxis.h | 2 +- .../dialogs/tools/dialoglineintersectaxis.ui | 426 ++++++------------ 3 files changed, 144 insertions(+), 309 deletions(-) diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.cpp b/src/app/dialogs/tools/dialoglineintersectaxis.cpp index 60f5d5f4e..ed6ef5a94 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.cpp +++ b/src/app/dialogs/tools/dialoglineintersectaxis.cpp @@ -34,6 +34,8 @@ #include "../../visualization/vistoollineintersectaxis.h" #include "../../widgets/vmaingraphicsscene.h" #include "../../tools/vabstracttool.h" +#include "dialogeditwrongformula.h" + #include //--------------------------------------------------------------------------------------------------------------------- @@ -42,7 +44,6 @@ DialogLineIntersectAxis::DialogLineIntersectAxis(const VContainer *data, const q formulaBaseHeightAngle(0), line(nullptr) { ui->setupUi(this); - InitVariables(ui); InitFormulaUI(ui); ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel)); labelEditNamePoint = ui->labelEditNamePoint; @@ -59,8 +60,7 @@ DialogLineIntersectAxis::DialogLineIntersectAxis(const VContainer *data, const q FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); FillComboBoxLineColors(ui->comboBoxLineColor); - connect(ui->toolButtonPutHereAngle, &QPushButton::clicked, this, &DialogLineIntersectAxis::PutAngle); - connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogLineIntersectAxis::PutVal); + connect(ui->toolButtonExprAngle, &QPushButton::clicked, this, &DialogLineIntersectAxis::FXAngle); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogLineIntersectAxis::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogLineIntersectAxis::AngleTextChanged); connect(ui->pushButtonGrowLengthAngle, &QPushButton::clicked, this, &DialogLineIntersectAxis::DeployAngleTextEdit); @@ -260,12 +260,6 @@ void DialogLineIntersectAxis::ChosenObject(quint32 id, const SceneObject &type) } } -//--------------------------------------------------------------------------------------------------------------------- -void DialogLineIntersectAxis::PutAngle() -{ - PutValHere(ui->plainTextEditFormula, ui->listWidget); -} - //--------------------------------------------------------------------------------------------------------------------- void DialogLineIntersectAxis::EvalAngle() { @@ -309,6 +303,19 @@ void DialogLineIntersectAxis::PointNameChanged() CheckState(); } +//--------------------------------------------------------------------------------------------------------------------- +void DialogLineIntersectAxis::FXAngle() +{ + DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data, toolId, this); + dialog->setWindowTitle(tr("Edit angle")); + dialog->SetFormula(GetAngle()); + if (dialog->exec() == QDialog::Accepted) + { + SetAngle(dialog->GetFormula()); + } + delete dialog; +} + //--------------------------------------------------------------------------------------------------------------------- void DialogLineIntersectAxis::ShowVisualization() { diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.h b/src/app/dialogs/tools/dialoglineintersectaxis.h index 978e8a7e6..f9aaa4dfb 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.h +++ b/src/app/dialogs/tools/dialoglineintersectaxis.h @@ -69,11 +69,11 @@ public: virtual void ShowDialog(bool click); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); - void PutAngle(); void EvalAngle(); void AngleTextChanged(); void DeployAngleTextEdit(); virtual void PointNameChanged(); + void FXAngle(); protected: virtual void ShowVisualization(); /** diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.ui b/src/app/dialogs/tools/dialoglineintersectaxis.ui index 731310611..3186a2aef 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.ui +++ b/src/app/dialogs/tools/dialoglineintersectaxis.ui @@ -7,7 +7,7 @@ 0 0 457 - 565 + 317 @@ -84,13 +84,13 @@ - + ... - :/icon/24x24/putHere.png:/icon/24x24/putHere.png + :/icon/24x24/fx.png:/icon/24x24/fx.png @@ -197,296 +197,134 @@ - - - - - - - - - - - - 0 - 0 - - - - Axis point - - - - - - - Axis Point - - - - - - - - 0 - 0 - - - - First line point - - - - - - - First point of line - - - - - - - - 0 - 0 - - - - Second line point - - - - - - - Second point of line - - - - - - - - 0 - 0 - - - - Point label - - - - - - - - 0 - 0 - - - - - - - - Type of line - - - - - - - - 80 - 0 - - - - - 110 - 16777215 - - - - Show line from first point to this 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 + + + + Axis point + + - - - - - - Hide empty measurements - - - true - - - - - - - Variables - - - - + + + + Axis Point + + + + + + + + 0 + 0 + + + + First line point + + + + + + + First point of line + + + + + + + + 0 + 0 + + + + Second line point + + + + + + + Second point of line + + + + + + + + 0 + 0 + + + + Point label + + + + + + + + 0 + 0 + + + + + + + + Type of line + + + + + + + + 80 + 0 + + + + + 110 + 16777215 + + + + Show line from first point to this point + + + + 80 + 14 + + + + + + + + Line color + + + + + - - - - - 0 - 0 - - - - Qt::PlainText - - - true - - - @@ -501,22 +339,12 @@ plainTextEditFormula - toolButtonPutHereAngle pushButtonGrowLengthAngle comboBoxAxisPoint comboBoxFirstLinePoint comboBoxSecondLinePoint lineEditNamePoint comboBoxLineType - radioButtonSizeGrowth - radioButtonStandardTable - radioButtonIncrements - radioButtonLengthLine - radioButtonLengthArc - radioButtonLengthSpline - radioButtonAngleLine - checkBoxHideEmpty - listWidget buttonBox