2014-05-30 10:32:40 +02:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file dialogeditwrongformula.h
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
** @date 29 5, 2014
|
|
|
|
**
|
|
|
|
** @brief
|
|
|
|
** @copyright
|
|
|
|
** This source code is part of the Valentine project, a pattern making
|
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
2015-02-27 11:27:48 +01:00
|
|
|
** Copyright (C) 2013-2015 Valentina project
|
2014-05-30 10:32:40 +02:00
|
|
|
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
|
|
|
**
|
|
|
|
** Valentina is free software: you can redistribute it and/or modify
|
|
|
|
** it under the terms of the GNU General Public License as published by
|
|
|
|
** the Free Software Foundation, either version 3 of the License, or
|
|
|
|
** (at your option) any later version.
|
|
|
|
**
|
|
|
|
** Valentina is distributed in the hope that it will be useful,
|
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
** GNU General Public License for more details.
|
|
|
|
**
|
|
|
|
** You should have received a copy of the GNU General Public License
|
|
|
|
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
**
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
#ifndef DIALOGEDITWRONGFORMULA_H
|
|
|
|
#define DIALOGEDITWRONGFORMULA_H
|
|
|
|
|
|
|
|
#include "dialogtool.h"
|
|
|
|
|
2014-06-16 19:18:36 +02:00
|
|
|
namespace Ui
|
|
|
|
{
|
2014-05-30 10:32:40 +02:00
|
|
|
class DialogEditWrongFormula;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief The DialogEditWrongFormula class dialog for editing wrong formula.
|
|
|
|
*
|
|
|
|
* When math parser find in formula error user can try fix issue. Dialog will show all variables that user can use in
|
|
|
|
* this formula. Dialog check fixed variant of formula.
|
|
|
|
*
|
|
|
|
* Don't implemant button "Apply" for this dialog!!
|
|
|
|
*/
|
|
|
|
class DialogEditWrongFormula : public DialogTool
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2014-07-29 14:19:11 +02:00
|
|
|
explicit DialogEditWrongFormula(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
2015-05-21 21:24:31 +02:00
|
|
|
virtual ~DialogEditWrongFormula();
|
2014-06-02 16:28:02 +02:00
|
|
|
|
2015-02-03 11:17:04 +01:00
|
|
|
QString GetFormula() const;
|
|
|
|
void SetFormula(const QString &value);
|
2014-08-29 11:19:11 +02:00
|
|
|
void setCheckZero(bool value);
|
|
|
|
void setPostfix(const QString &value);
|
2014-05-30 10:32:40 +02:00
|
|
|
public slots:
|
|
|
|
virtual void DialogAccepted();
|
|
|
|
virtual void DialogRejected();
|
2014-06-19 11:29:56 +02:00
|
|
|
/**
|
|
|
|
* @brief DeployFormulaTextEdit grow or shrink formula input
|
|
|
|
*/
|
2014-08-11 16:41:17 +02:00
|
|
|
void DeployFormulaTextEdit();
|
|
|
|
virtual void EvalFormula();
|
2015-04-30 13:08:54 +02:00
|
|
|
void ValChenged(int row);
|
|
|
|
void SizeHeight();
|
|
|
|
void PutHere();
|
|
|
|
void PutVal(QListWidgetItem * item);
|
|
|
|
|
|
|
|
void Measurements();
|
|
|
|
void LengthLines();
|
|
|
|
void LengthArcs();
|
|
|
|
void LengthCurves();
|
|
|
|
void AngleLines();
|
|
|
|
void Increments();
|
2014-05-30 10:32:40 +02:00
|
|
|
protected:
|
|
|
|
virtual void CheckState();
|
2014-11-22 19:37:59 +01:00
|
|
|
virtual void closeEvent(QCloseEvent *event);
|
2014-05-30 10:32:40 +02:00
|
|
|
private:
|
|
|
|
Q_DISABLE_COPY(DialogEditWrongFormula)
|
|
|
|
Ui::DialogEditWrongFormula *ui;
|
2014-06-02 16:28:02 +02:00
|
|
|
|
|
|
|
/** @brief formula string with formula */
|
2014-05-30 10:32:40 +02:00
|
|
|
QString formula;
|
2014-06-19 11:29:56 +02:00
|
|
|
|
|
|
|
/** @brief formulaBaseHeight base height defined by dialogui */
|
|
|
|
int formulaBaseHeight;
|
2014-08-29 11:19:11 +02:00
|
|
|
|
|
|
|
bool checkZero;
|
|
|
|
QString postfix;
|
|
|
|
bool restoreCursor;
|
2015-04-30 13:08:54 +02:00
|
|
|
|
|
|
|
void InitVariables();
|
|
|
|
|
|
|
|
template <class key, class val>
|
|
|
|
void ShowVariable(const QMap<key, val> var);
|
2014-05-30 10:32:40 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // DIALOGEDITWRONGFORMULA_H
|