From 09fd789659d9c7203a28bd85815388c36712ead3 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 29 Apr 2015 21:19:57 +0300 Subject: [PATCH] F(x) button for tool Point along perpendicular. --HG-- branch : feature --- src/app/dialogs/tools/dialognormal.cpp | 18 +- src/app/dialogs/tools/dialognormal.h | 1 + src/app/dialogs/tools/dialognormal.ui | 761 ++++++++++--------------- 3 files changed, 310 insertions(+), 470 deletions(-) diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp index f56b1e8c7..960bac439 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/app/dialogs/tools/dialognormal.cpp @@ -31,6 +31,7 @@ #include "../visualization/vistoolnormal.h" #include "../widgets/vmaingraphicsscene.h" #include "../../tools/vabstracttool.h" +#include "dialogeditwrongformula.h" //--------------------------------------------------------------------------------------------------------------------- /** @@ -43,7 +44,6 @@ DialogNormal::DialogNormal(const VContainer *data, const quint32 &toolId, QWidge line(nullptr) { ui->setupUi(this); - InitVariables(ui); InitFormulaUI(ui); ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel)); labelEditNamePoint = ui->labelEditNamePoint; @@ -61,8 +61,7 @@ DialogNormal::DialogNormal(const VContainer *data, const quint32 &toolId, QWidge InitArrow(ui); - connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogNormal::PutHere); - connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogNormal::PutVal); + connect(ui->toolButtonExprLength, &QPushButton::clicked, this, &DialogNormal::FXLength); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogNormal::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogNormal::FormulaTextChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogNormal::DeployFormulaTextEdit); @@ -99,6 +98,19 @@ void DialogNormal::PointNameChanged() CheckState(); } +//--------------------------------------------------------------------------------------------------------------------- +void DialogNormal::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 DialogNormal::ShowVisualization() { diff --git a/src/app/dialogs/tools/dialognormal.h b/src/app/dialogs/tools/dialognormal.h index 4cf31b9df..39c1fbb55 100644 --- a/src/app/dialogs/tools/dialognormal.h +++ b/src/app/dialogs/tools/dialognormal.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/dialognormal.ui b/src/app/dialogs/tools/dialognormal.ui index 42ae2e583..2cb96c91c 100644 --- a/src/app/dialogs/tools/dialognormal.ui +++ b/src/app/dialogs/tools/dialognormal.ui @@ -7,7 +7,7 @@ 0 0 517 - 678 + 428 @@ -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,457 +197,261 @@ - + + + + + + 0 + 0 + + + + Point label + + + + + + + + + + + 0 + 0 + + + + First point + + + + + + + First point of line + + + + + + + + 0 + 0 + + + + Second point + + + + + + + Second point of line + + + + + + + - - - - - - - - 0 - 0 - - - - Point label - - - - - - - - - - - 0 - 0 - - - - First point - - - - - - - First point of line - - - - - - - - 0 - 0 - - - - Second point - - - - - - - Second point of line - - - - - - - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - Additional angle degrees - - - true - - - - - - - QLayout::SetMinimumSize - - - 29 - - - 6 - - - - - ... - - - - :/icon/32x32/arrowRightUp.png:/icon/32x32/arrowRightUp.png - - - - 32 - 32 - - - - - - - - ... - - - - :/icon/32x32/arrowLeftUp.png:/icon/32x32/arrowLeftUp.png - - - - 32 - 32 - - - - - - - - ... - - - - :/icon/32x32/arrowLeft.png:/icon/32x32/arrowLeft.png - - - - 32 - 32 - - - - - - - - ... - - - - :/icon/32x32/arrowRight.png:/icon/32x32/arrowRight.png - - - - 32 - 32 - - - - - - - - - 0 - 0 - - - - ... - - - - :/icon/32x32/arrowUp.png:/icon/32x32/arrowUp.png - - - - 32 - 32 - - - - - - - - ... - - - - :/icon/32x32/arrowDown.png:/icon/32x32/arrowDown.png - - - - 32 - 32 - - - - - - - - ... - - - - :/icon/32x32/arrowLeftDown.png:/icon/32x32/arrowLeftDown.png - - - - 32 - 32 - - - - - - - - ... - - - - :/icon/32x32/arrowRightDown.png:/icon/32x32/arrowRightDown.png - - - - 32 - 32 - - - - - - - - - 0 - 0 - - - - - 56 - 0 - - - - -360.000000000000000 - - - 360.000000000000000 - - - - - - - - - - - - - - - - - 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 + + + + + 0 + 0 + + + + Additional angle degrees + + + true + + - - - + + + QLayout::SetMinimumSize + + + 29 + + + 6 + + + - Hide empty measurements + ... - - true + + + :/icon/32x32/arrowRight.png:/icon/32x32/arrowRight.png + + + + 32 + 32 + - - - - Variables - Click twice to insert into formula + + + + + 0 + 0 + + + + + 56 + 0 + + + + -360.000000000000000 + + + 360.000000000000000 + + + + + + + ... + + + + :/icon/32x32/arrowLeftUp.png:/icon/32x32/arrowLeftUp.png + + + + 32 + 32 + + + + + + + + ... + + + + :/icon/32x32/arrowRightUp.png:/icon/32x32/arrowRightUp.png + + + + 32 + 32 + + + + + + + + + 0 + 0 + + + + ... + + + + :/icon/32x32/arrowUp.png:/icon/32x32/arrowUp.png + + + + 32 + 32 + + + + + + + + ... + + + + :/icon/32x32/arrowLeft.png:/icon/32x32/arrowLeft.png + + + + 32 + 32 + + + + + + + + ... + + + + :/icon/32x32/arrowLeftDown.png:/icon/32x32/arrowLeftDown.png + + + + 32 + 32 + + + + + + + + ... + + + + :/icon/32x32/arrowDown.png:/icon/32x32/arrowDown.png + + + + 32 + 32 + + + + + + + + ... + + + + :/icon/32x32/arrowRightDown.png:/icon/32x32/arrowRightDown.png + + + + 32 + 32 + @@ -659,14 +460,50 @@ - - - - - - true - - + + + + + Type of line + + + + + + + + 80 + 0 + + + + + 110 + 16777215 + + + + Show line from first point to this point + + + + 80 + 14 + + + + + + + + + + + Line color + + + + @@ -682,7 +519,6 @@ plainTextEditFormula - toolButtonPutHere pushButtonGrowLength lineEditNamePoint comboBoxFirstPoint @@ -696,15 +532,6 @@ toolButtonArrowLeftDown toolButtonArrowLeft toolButtonArrowLeftUp - radioButtonSizeGrowth - radioButtonStandardTable - radioButtonIncrements - radioButtonLengthLine - radioButtonLengthArc - radioButtonLengthSpline - radioButtonAngleLine - checkBoxHideEmpty - listWidget buttonBox