2013-09-18 21:16:19 +02:00
|
|
|
/****************************************************************************
|
|
|
|
**
|
|
|
|
** Copyright (C) 2013 Valentina project All Rights Reserved.
|
|
|
|
**
|
|
|
|
** This file is part of Valentina.
|
|
|
|
**
|
|
|
|
** Tox 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.
|
|
|
|
**
|
2013-10-27 13:36:29 +01:00
|
|
|
** Valentina is distributed in the hope that it will be useful,
|
2013-09-18 21:16:19 +02:00
|
|
|
** 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/>.
|
|
|
|
**
|
|
|
|
****************************************************************************/
|
|
|
|
|
2013-07-28 00:18:06 +02:00
|
|
|
#ifndef DIALOGTOOL_H
|
|
|
|
#define DIALOGTOOL_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
2013-11-06 16:49:07 +01:00
|
|
|
#include "../container/vcontainer.h"
|
2013-07-28 00:18:06 +02:00
|
|
|
|
2013-11-04 21:35:15 +01:00
|
|
|
class DialogTool : public QDialog
|
|
|
|
{
|
2013-07-28 00:18:06 +02:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2013-11-04 21:35:15 +01:00
|
|
|
DialogTool(const VContainer *data, Draw::Draws mode = Draw::Calculation, QWidget *parent = 0);
|
2013-10-26 19:55:06 +02:00
|
|
|
virtual ~DialogTool() {}
|
|
|
|
inline qint64 getIdDetail() const {return idDetail;}
|
|
|
|
inline void setIdDetail(const qint64 &value) {idDetail = value;}
|
2013-07-28 00:18:06 +02:00
|
|
|
signals:
|
|
|
|
void DialogClosed(int result);
|
2013-10-07 13:11:56 +02:00
|
|
|
void ToolTip(const QString &toolTip);
|
2013-07-28 00:18:06 +02:00
|
|
|
public slots:
|
2013-09-27 11:17:00 +02:00
|
|
|
virtual void ChoosedObject(qint64 id, Scene::Scenes type);
|
2013-07-28 00:18:06 +02:00
|
|
|
void NamePointChanged();
|
|
|
|
virtual void DialogAccepted();
|
|
|
|
virtual void DialogRejected();
|
|
|
|
void FormulaChanged();
|
|
|
|
void ArrowUp();
|
|
|
|
void ArrowDown();
|
|
|
|
void ArrowLeft();
|
|
|
|
void ArrowRight();
|
|
|
|
void ArrowLeftUp();
|
|
|
|
void ArrowLeftDown();
|
|
|
|
void ArrowRightUp();
|
|
|
|
void ArrowRightDown();
|
|
|
|
void EvalFormula();
|
|
|
|
void SizeGrowth();
|
|
|
|
void StandartTable();
|
|
|
|
void LengthLines();
|
2013-10-13 17:31:42 +02:00
|
|
|
void LengthArcs();
|
|
|
|
void LengthCurves();
|
2013-07-28 00:18:06 +02:00
|
|
|
void Increments();
|
|
|
|
void PutHere();
|
|
|
|
void PutVal(QListWidgetItem * item);
|
2013-08-06 09:56:09 +02:00
|
|
|
virtual void ValChenged(int row);
|
2013-07-28 00:18:06 +02:00
|
|
|
void UpdateList();
|
|
|
|
protected:
|
2013-09-26 20:50:52 +02:00
|
|
|
Q_DISABLE_COPY(DialogTool)
|
2013-07-28 00:18:06 +02:00
|
|
|
const VContainer *data;
|
|
|
|
bool isInitialized;
|
|
|
|
bool flagName;
|
|
|
|
bool flagFormula;
|
|
|
|
QTimer *timerFormula;
|
|
|
|
QPushButton *bOk;
|
2013-09-12 16:18:31 +02:00
|
|
|
QDoubleSpinBox *spinBoxAngle;
|
2013-07-28 00:18:06 +02:00
|
|
|
QLineEdit *lineEditFormula;
|
|
|
|
QListWidget *listWidget;
|
|
|
|
QLabel *labelResultCalculation;
|
|
|
|
QLabel *labelDescription;
|
2013-10-06 18:22:21 +02:00
|
|
|
QLabel *labelEditNamePoint;
|
|
|
|
QLabel *labelEditFormula;
|
2013-07-28 00:18:06 +02:00
|
|
|
QRadioButton *radioButtonSizeGrowth;
|
|
|
|
QRadioButton *radioButtonStandartTable;
|
|
|
|
QRadioButton *radioButtonIncrements;
|
|
|
|
QRadioButton *radioButtonLengthLine;
|
2013-10-13 17:31:42 +02:00
|
|
|
QRadioButton *radioButtonLengthArc;
|
|
|
|
QRadioButton *radioButtonLengthCurve;
|
2013-09-10 14:29:06 +02:00
|
|
|
qint64 idDetail;
|
2013-10-26 19:55:06 +02:00
|
|
|
Draw::Draws mode;
|
2013-09-10 14:29:06 +02:00
|
|
|
bool CheckObject(const qint64 &id);
|
2013-08-15 22:39:00 +02:00
|
|
|
virtual void closeEvent ( QCloseEvent * event );
|
|
|
|
virtual void showEvent( QShowEvent *event );
|
2013-08-13 18:48:36 +02:00
|
|
|
void FillComboBoxPoints(QComboBox *box, const qint64 &id = 0)const;
|
2013-07-28 00:18:06 +02:00
|
|
|
void FillComboBoxTypeLine(QComboBox *box) const;
|
2013-07-31 13:34:39 +02:00
|
|
|
virtual void CheckState();
|
2013-07-28 00:18:06 +02:00
|
|
|
QString GetTypeLine(const QComboBox *box)const;
|
2013-10-04 13:32:42 +02:00
|
|
|
template <class key, class val> void ShowVariable(const QHash<key, val> *var);
|
2013-07-29 14:55:40 +02:00
|
|
|
void SetupTypeLine(QComboBox *box, const QString &value);
|
|
|
|
void ChangeCurrentText(QComboBox *box, const QString &value);
|
2013-08-13 18:48:36 +02:00
|
|
|
void ChangeCurrentData(QComboBox *box, const qint64 &value) const;
|
2013-08-06 09:56:09 +02:00
|
|
|
void PutValHere(QLineEdit *lineEdit, QListWidget *listWidget);
|
|
|
|
void ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer * timer);
|
|
|
|
void Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label);
|
2013-08-13 18:48:36 +02:00
|
|
|
void setCurrentPointId(QComboBox *box, qint64 &pointId, const qint64 &value, const qint64 &id) const;
|
|
|
|
qint64 getCurrentPointId(QComboBox *box) const;
|
2013-07-28 00:18:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DIALOGTOOL_H
|