src/forms/circleoptions.h \
src/forms/commandwidget.h \
src/forms/coordinatewidget.h \
+ src/forms/dimlinearoptions.h \
+ src/forms/dimoptions.h \
src/forms/dlgattributes.h \
src/forms/dlgimageoptions.h \
src/forms/dlginitial.h \
src/forms/mousewidget.h \
src/forms/printpreviewoptions.h \
src/forms/selectionwidget.h \
+ src/forms/splineoptions.h \
src/forms/textoptions.h \
+ src/forms/trimamountoptions.h \
src/forms/widgetpen.h \
src/widgets/qg_actionhandler.h \
src/widgets/qg_blockwidget.h \
src/forms/circleoptions.cpp \
src/forms/commandwidget.cpp \
src/forms/coordinatewidget.cpp \
+ src/forms/dimlinearoptions.cpp \
+ src/forms/dimoptions.cpp \
src/forms/dlgattributes.cpp \
src/forms/dlgimageoptions.cpp \
src/forms/dlginitial.cpp \
src/forms/mousewidget.cpp \
src/forms/printpreviewoptions.cpp \
src/forms/selectionwidget.cpp \
+ src/forms/splineoptions.cpp \
src/forms/textoptions.cpp \
+ src/forms/trimamountoptions.cpp \
src/forms/widgetpen.cpp \
src/widgets/qg_actionhandler.cpp \
src/widgets/qg_blockwidget.cpp \
#The following line was changed from FORMS to FORMS3 by qt3to4
#FORMS3 = \
# ui/qg_dimensionlabeleditor.ui \
-# ui/qg_dimlinearoptions.ui \
-# ui/qg_dimoptions.ui \
# ui/qg_dlghatch.ui \
# ui/qg_dlginsert.ui \
# ui/qg_dlgarc.ui \
# ui/qg_moverotateoptions.ui \
# ui/qg_roundoptions.ui \
# ui/qg_snapdistoptions.ui \
-# ui/qg_splineoptions.ui \
-# ui/qg_trimamountoptions.ui
# src/forms/arcoptions.ui \
# src/forms/arctangentialoptions.ui \
+# src/forms/dimlinearoptions.ui \
+# src/forms/dimoptions.ui \
+# src/forms/splineoptions.ui \
+# src/forms/trimamountoptions.ui
#
FORMS = \
src/forms/blockdialog.ui \
#include "settings.h"
ArcOptions::ArcOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
- QWidget(parent, flags)
+ QWidget(parent, flags),
+ rbPos(new QRadioButton(this)),
+ rbNeg(new QRadioButton(this))
{
QHBoxLayout * layout = new QHBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
- rbPos = new QRadioButton(this);
- rbNeg = new QRadioButton(this);
-
- rbPos->setIcon(QIcon(":/res/qg_dirpos.xpm"));
- rbNeg->setIcon(QIcon(":/res/qg_dirneg.xpm"));
+ rbPos->setIcon(QIcon(":/res/qg_dirpos"));
+ rbNeg->setIcon(QIcon(":/res/qg_dirneg"));
layout->addWidget(rbPos);
layout->addWidget(rbNeg);
--- /dev/null
+// dimlinearoptions.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who When What
+// --- ---------- -----------------------------------------------------------
+// JLH 06/09/2010 Created this file. :-)
+//
+
+#include "dimlinearoptions.h"
+
+#include "rs_actiondimlinear.h"
+#include "rs_actioninterface.h"
+#include "settings.h"
+
+DimLinearOptions::DimLinearOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
+ QWidget(parent, flags),
+ lAngle(new QLabel(tr("Angle:"))),
+ leAngle(new QLineEdit(this)),
+ bHor(new QToolButton(this)),
+ bVer(new QToolButton(this))
+{
+ QHBoxLayout * layout = new QHBoxLayout(this);
+ layout->setContentsMargins(0, 0, 0, 0);
+
+ leAngle->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Ignored));
+//still need to tweak this so it displays properly...
+ bHor->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::MinimumExpanding));
+ bHor->setIcon(QIcon(":/res/qg_dimhor"));
+ bVer->setIcon(QIcon(":/res/qg_dimver"));
+
+ layout->addWidget(lAngle);
+ layout->addWidget(leAngle);
+ layout->addWidget(bHor);
+ layout->addWidget(bVer);
+
+ connect(leAngle, SIGNAL(textChanged(QString)), this, SLOT(updateAngle(QString)));
+ connect(bHor, SIGNAL(clicked()), this, SLOT(setHor()));
+ connect(bVer, SIGNAL(clicked()), this, SLOT(setVer()));
+
+ // We need to add the widget (this thing) to the toolbar passed in. Otherwise,
+ // nothing will show up on the screen. :-)
+ if (parent)
+ parent->addWidget(this);
+}
+
+DimLinearOptions::~DimLinearOptions()
+{
+ settings.beginGroup("Dimension");
+ settings.setValue("Angle", leAngle->text());
+ settings.endGroup();
+}
+
+void DimLinearOptions::setAction(RS_ActionInterface * a, bool update)
+{
+ if (a != NULL && a->rtti() == RS2::ActionDimLinear)
+ {
+ action = (RS_ActionDimLinear *)a;
+
+ QString sa;
+
+ if (update)
+ sa = QString("%1").arg(RS_Math::rad2deg(action->getAngle()));
+ else
+ {
+ settings.beginGroup("Dimension");
+ sa = settings.value("Angle", "0.0").toString();
+ settings.endGroup();
+ }
+ leAngle->setText(sa);
+ }
+ else
+ {
+ RS_DEBUG->print(RS_Debug::D_ERROR, "DimLinearOptions::setAction: wrong action type");
+ action = NULL;
+ }
+}
+
+void DimLinearOptions::updateAngle(const QString & a)
+{
+ if (action != NULL)
+ action->setAngle(RS_Math::deg2rad(RS_Math::eval(a)));
+}
+
+void DimLinearOptions::setHor()
+{
+ leAngle->setText("0");
+}
+
+void DimLinearOptions::setVer()
+{
+ leAngle->setText("90");
+}
+
--- /dev/null
+#ifndef __DIMLINEAROPTIONS_H__
+#define __DIMLINEAROPTIONS_H__
+
+#include <QtGui>
+
+class RS_ActionDimLinear;
+class RS_ActionInterface;
+
+class DimLinearOptions: public QWidget
+{
+ Q_OBJECT
+
+ public:
+ DimLinearOptions(QToolBar * parent = 0, Qt::WindowFlags flags = 0);
+ ~DimLinearOptions();
+
+ public slots:
+ void setAction(RS_ActionInterface * a, bool update);
+ void updateAngle(const QString & a);
+ void setHor();
+ void setVer();
+
+ protected:
+ RS_ActionDimLinear * action;
+
+ private:
+ QLabel * lAngle;
+ QLineEdit * leAngle;
+ QToolButton * bHor;
+ QToolButton * bVer;
+};
+
+#endif // __DIMLINEAROPTIONS_H__
<file>qg_deselectwindow.xpm</file>
<file>qg_dimaligned.xpm</file>
<file>qg_dimangular.xpm</file>
+ <file>qg_dimdia.xpm</file>
<file>qg_dimdiametric.xpm</file>
<file>qg_dimhor.xpm</file>
<file>qg_dimleader.xpm</file>
<file>qg_dimlinear.xpm</file>
<file>qg_dimradial.xpm</file>
+ <file>qg_dimtol1.xpm</file>
+ <file>qg_dimtol2.xpm</file>
<file>qg_dimver.xpm</file>
<file>qg_dirneg.xpm</file>
<file>qg_dirpos.xpm</file>
--- /dev/null
+/* XPM */
+static char * qg_dimdia_xpm[] = {
+"15 15 2 1",
+". c None",
+"# c #000000",
+"...............",
+"...............",
+"...............",
+".....####.#....",
+"....#....#.....",
+"...#....#.#....",
+"...#...#..#....",
+"...#..#...#....",
+"...#.#....#....",
+"....#....#.....",
+"...#.####......",
+"...............",
+"...............",
+"...............",
+"..............."};
--- /dev/null
+/* XPM */
+static char * qg_dimtol1_xpm[] = {
+"32 10 3 1",
+"# c None",
+". c #000000",
+"a c #ff0000",
+"..................##............",
+".################.##.aaaaaaaaaa.",
+".################.##.aaaaaaaaaa.",
+".################.##............",
+".################.##############",
+".################.##############",
+".################.##............",
+".################.##.##########.",
+".################.##.##########.",
+"..................##............"};
--- /dev/null
+/* XPM */
+static char * qg_dimtol2_xpm[] = {
+"32 10 3 1",
+"# c None",
+". c #000000",
+"a c #ff0000",
+"..................##............",
+".################.##.##########.",
+".################.##.##########.",
+".################.##............",
+".################.##############",
+".################.##############",
+".################.##............",
+".################.##.aaaaaaaaaa.",
+".################.##.aaaaaaaaaa.",
+"..................##............"};
--- /dev/null
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename functions or slots use
+** Qt Designer which will update this file, preserving your code. Create an
+** init() function in place of a constructor, and a destroy() function in
+** place of a destructor.
+*****************************************************************************/
+
+void QG_SnapDistOptions::destroy()
+{
+ RS_SETTINGS->beginGroup("/Snap");
+ RS_SETTINGS->writeEntry("/Distance", leDist->text());
+ RS_SETTINGS->endGroup();
+}
+
+void QG_SnapDistOptions::setDist(double * d)
+{
+ dist = d;
+
+ RS_SETTINGS->beginGroup("/Snap");
+ QString r = RS_SETTINGS->readEntry("/Distance", "1.0");
+ RS_SETTINGS->endGroup();
+
+ leDist->setText(r);
+}
+
+void QG_SnapDistOptions::updateDist(const QString & d)
+{
+ if (dist != NULL)
+ *dist = RS_Math::eval(d, 1.0);
+}
+
--- /dev/null
+#ifndef QG_SNAPDISTOPTIONS_H
+#define QG_SNAPDISTOPTIONS_H
+
+#include <qvariant.h>
+
+#include <Qt3Support/Q3MimeSourceFactory>
+#include <QtCore/QVariant>
+#include <QtGui/QAction>
+#include <QtGui/QApplication>
+#include <QtGui/QButtonGroup>
+#include <QtGui/QFrame>
+#include <QtGui/QHBoxLayout>
+#include <QtGui/QHeaderView>
+#include <QtGui/QLabel>
+#include <QtGui/QLineEdit>
+#include <QtGui/QWidget>
+#include "rs_circle.h"
+#include "rs_settings.h"
+
+QT_BEGIN_NAMESPACE
+
+class Ui_QG_SnapDistOptions
+{
+ public:
+ QHBoxLayout *hboxLayout;
+ QLabel *lDist;
+ QLineEdit *leDist;
+ QFrame *sep1;
+
+ void setupUi(QWidget *QG_SnapDistOptions)
+ {
+ if (QG_SnapDistOptions->objectName().isEmpty())
+ QG_SnapDistOptions->setObjectName(QString::fromUtf8("QG_SnapDistOptions"));
+ QG_SnapDistOptions->resize(150, 24);
+ QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(4), static_cast<QSizePolicy::Policy>(0));
+ sizePolicy.setHorizontalStretch(0);
+ sizePolicy.setVerticalStretch(0);
+ sizePolicy.setHeightForWidth(QG_SnapDistOptions->sizePolicy().hasHeightForWidth());
+ QG_SnapDistOptions->setSizePolicy(sizePolicy);
+ QG_SnapDistOptions->setMinimumSize(QSize(130, 22));
+ QG_SnapDistOptions->setMaximumSize(QSize(150, 32767));
+ hboxLayout = new QHBoxLayout(QG_SnapDistOptions);
+ hboxLayout->setSpacing(6);
+ hboxLayout->setContentsMargins(1, 1, 1, 1);
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
+ lDist = new QLabel(QG_SnapDistOptions);
+ lDist->setObjectName(QString::fromUtf8("lDist"));
+ lDist->setWordWrap(false);
+
+ hboxLayout->addWidget(lDist);
+
+ leDist = new QLineEdit(QG_SnapDistOptions);
+ leDist->setObjectName(QString::fromUtf8("leDist"));
+
+ hboxLayout->addWidget(leDist);
+
+ sep1 = new QFrame(QG_SnapDistOptions);
+ sep1->setObjectName(QString::fromUtf8("sep1"));
+ QSizePolicy sizePolicy1(static_cast<QSizePolicy::Policy>(0), static_cast<QSizePolicy::Policy>(1));
+ sizePolicy1.setHorizontalStretch(0);
+ sizePolicy1.setVerticalStretch(0);
+ sizePolicy1.setHeightForWidth(sep1->sizePolicy().hasHeightForWidth());
+ sep1->setSizePolicy(sizePolicy1);
+ sep1->setFrameShape(QFrame::VLine);
+ sep1->setFrameShadow(QFrame::Sunken);
+
+ hboxLayout->addWidget(sep1);
+
+ retranslateUi(QG_SnapDistOptions);
+ QObject::connect(leDist, SIGNAL(textChanged(QString)), QG_SnapDistOptions, SLOT(updateDist(QString)));
+
+ QMetaObject::connectSlotsByName(QG_SnapDistOptions);
+ } // setupUi
+
+ void retranslateUi(QWidget *QG_SnapDistOptions)
+ {
+ QG_SnapDistOptions->setWindowTitle(QApplication::translate("QG_SnapDistOptions", "Snap Distance Options", 0, QApplication::UnicodeUTF8));
+ lDist->setText(QApplication::translate("QG_SnapDistOptions", "Distance:", 0, QApplication::UnicodeUTF8));
+ } // retranslateUi
+};
+
+namespace Ui {
+class QG_SnapDistOptions: public Ui_QG_SnapDistOptions
+{
+};
+} // namespace Ui
+
+QT_END_NAMESPACE
+
+class QG_SnapDistOptions: public QWidget, public Ui::QG_SnapDistOptions
+{
+ Q_OBJECT
+
+ public:
+ QG_SnapDistOptions(QWidget * parent = 0, const char * name = 0, Qt::WindowFlags fl = 0);
+ ~QG_SnapDistOptions();
+
+ public slots:
+ virtual void setDist(double * d);
+ virtual void updateDist(const QString & d);
+
+ protected:
+ double * dist;
+
+ protected slots:
+ virtual void languageChange();
+
+ private:
+ void destroy();
+};
+
+#endif // QG_SNAPDISTOPTIONS_H
--- /dev/null
+// splineoptions.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who When What
+// --- ---------- -----------------------------------------------------------
+// JLH 06/10/2010 Created this file. :-)
+//
+
+#include "splineoptions.h"
+
+#include "rs_actiondrawspline.h"
+#include "rs_actioninterface.h"
+#include "settings.h"
+
+SplineOptions::SplineOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
+ QWidget(parent, flags),
+ lDegree(new QLabel(tr("Degree:"))),
+ cbDegree(new QComboBox(this)),
+ cbClosed(new QCheckBox(tr("Closed"))),
+ bUndo(new QToolButton(this))
+{
+ QHBoxLayout * layout = new QHBoxLayout(this);
+ layout->setContentsMargins(0, 0, 0, 0);
+
+// leDist->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Ignored));
+ QStringList degrees;
+ degrees << "1" << "2" << "3";
+ cbDegree->addItems(degrees);
+ bUndo->setText(tr("Undo"));
+
+ layout->addWidget(lDegree);
+ layout->addWidget(cbDegree);
+ layout->addWidget(cbClosed);
+ layout->addWidget(bUndo);
+
+ connect(cbDegree, SIGNAL(activated(QString)), this, SLOT(setDegree(QString)));
+ connect(cbClosed, SIGNAL(toggled(bool)), this, SLOT(setClosed(bool)));
+ connect(bUndo, SIGNAL(clicked()), this, SLOT(undo()));
+
+ // We need to add the widget (this thing) to the toolbar passed in. Otherwise,
+ // nothing will show up on the screen. :-)
+ if (parent)
+ parent->addWidget(this);
+}
+
+SplineOptions::~SplineOptions()
+{
+ settings.beginGroup("Draw");
+ settings.setValue("SplineDegree", cbDegree->currentText().toInt());
+ settings.setValue("SplineClosed", cbClosed->isChecked());
+ settings.endGroup();
+}
+
+void SplineOptions::setAction(RS_ActionInterface * a, bool update)
+{
+ if (a != NULL && a->rtti() == RS2::ActionDrawSpline)
+ {
+ action = (RS_ActionDrawSpline *)a;
+
+ int degree;
+ bool closed;
+
+ if (update)
+ {
+ degree = action->getDegree();
+ closed = action->isClosed();
+ }
+ else
+ {
+ settings.beginGroup("Draw");
+ degree = settings.value("SplineDegree", 3).toInt();
+ closed = settings.value("SplineClosed", false).toBool();
+ settings.endGroup();
+ action->setDegree(degree);
+ action->setClosed(closed);
+ }
+
+ cbDegree->setCurrentIndex(cbDegree->findText(QString("%1").arg(degree)));
+ cbClosed->setChecked(closed);
+ }
+ else
+ {
+ RS_DEBUG->print(RS_Debug::D_ERROR, "SplineOptions::setAction: wrong action type");
+ action = NULL;
+ }
+}
+
+void SplineOptions::setClosed(bool c)
+{
+ if (action != NULL)
+ action->setClosed(c);
+}
+
+void SplineOptions::undo()
+{
+ if (action != NULL)
+ action->undo();
+}
+
+void SplineOptions::setDegree(const QString & deg)
+{
+ if (action != NULL)
+ action->setDegree(deg.toInt());
+}
--- /dev/null
+#ifndef __SPLINEOPTIONS_H__
+#define __SPLINEOPTIONS_H__
+
+#include <QtGui>
+
+class RS_ActionDrawSpline;
+class RS_ActionInterface;
+
+class SplineOptions: public QWidget
+{
+ Q_OBJECT
+
+ public:
+ SplineOptions(QToolBar * parent = 0, Qt::WindowFlags fl = 0);
+ ~SplineOptions();
+
+ public slots:
+ void setAction(RS_ActionInterface * a, bool update);
+ void setClosed(bool c);
+ void undo();
+ void setDegree(const QString & deg);
+
+ protected:
+ RS_ActionDrawSpline * action;
+
+ private:
+ QLabel * lDegree;
+ QComboBox * cbDegree;
+ QCheckBox * cbClosed;
+ QToolButton * bUndo;
+};
+
+#endif // __SPLINEOPTIONS_H__
--- /dev/null
+// trimamountoptions.cpp
+//
+// Part of the Architektonas Project
+// Originally part of QCad Community Edition by Andrew Mustun
+// Extensively rewritten and refactored by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who When What
+// --- ---------- -----------------------------------------------------------
+// JLH 06/10/2010 Created this file. :-)
+//
+
+#include "trimamountoptions.h"
+
+#include "rs_actionmodifytrimamount.h"
+#include "rs_actioninterface.h"
+#include "rs_debug.h"
+#include "rs_math.h"
+#include "settings.h"
+
+TrimAmountOptions::TrimAmountOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
+ QWidget(parent, flags),
+ lDist(new QLabel(tr("Amount:"))),
+ leDist(new QLineEdit(this))
+{
+ QHBoxLayout * layout = new QHBoxLayout(this);
+ layout->setContentsMargins(0, 0, 0, 0);
+
+ leDist->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Ignored));
+
+ layout->addWidget(lDist);
+ layout->addWidget(leDist);
+
+ connect(leDist, SIGNAL(textChanged(QString)), this, SLOT(updateDist(QString)));
+
+ // We need to add the widget (this thing) to the toolbar passed in. Otherwise,
+ // nothing will show up on the screen. :-)
+ if (parent)
+ parent->addWidget(this);
+}
+
+TrimAmountOptions::~TrimAmountOptions()
+{
+ settings.beginGroup("Modify");
+ settings.setValue("TrimAmount", leDist->text());
+ settings.endGroup();
+}
+
+void TrimAmountOptions::setAction(RS_ActionInterface * a, bool update)
+{
+ if (a != NULL && a->rtti() == RS2::ActionModifyTrimAmount)
+ {
+ action = (RS_ActionModifyTrimAmount *)a;
+
+ QString sd;
+
+ // settings from action:
+ if (update)
+ sd = QString("%1").arg(action->getDistance());
+ // settings from config file:
+ else
+ {
+ settings.beginGroup("Modify");
+ sd = settings.value("TrimAmount", "1.0").toString();
+ settings.endGroup();
+ }
+
+ leDist->setText(sd);
+ }
+ else
+ {
+ RS_DEBUG->print(RS_Debug::D_ERROR, "ModifyTrimAmountOptions::setAction: wrong action type");
+ this->action = NULL;
+ }
+}
+
+void TrimAmountOptions::updateDist(const QString & d)
+{
+ if (action != NULL)
+ action->setDistance(RS_Math::eval(d, 1.0));
+}
--- /dev/null
+#ifndef __TRIMAMOUNTOPTIONS_H__
+#define __TRIMAMOUNTOPTIONS_H__
+
+#include <QtGui>
+
+class RS_ActionModifyTrimAmount;
+class RS_ActionInterface;
+
+class TrimAmountOptions: public QWidget
+{
+ Q_OBJECT
+
+ public:
+ TrimAmountOptions(QToolBar * parent = 0, Qt::WindowFlags fl = 0);
+ ~TrimAmountOptions();
+
+ public slots:
+ void setAction(RS_ActionInterface * a, bool update);
+ void updateDist(const QString & d);
+
+ protected:
+ RS_ActionModifyTrimAmount * action;
+
+ private:
+ QLabel * lDist;
+ QLineEdit * leDist;
+};
+
+#endif // __TRIMAMOUNTOPTIONS_H__
#include "qc_mdiwindow.h"
-#include "rs_application.h"
+#include "drawing.h"
#include "rs_eventhandler.h"
#include "exitdialog.h"
#include "qg_filedialog.h"
#include "ui/qg_circleoptions.h"
#include "ui/qg_commandwidget.h"
#include "ui/qg_coordinatewidget.h"
-#include "ui/qg_dimlinearoptions.h"
-#include "ui/qg_dimoptions.h"
+ #include "ui/qg_dimlinearoptions.h"
+ #include "ui/qg_dimoptions.h"
#include "ui/qg_dlgarc.h"
#include "ui/qg_dlgattributes.h"
#include "ui/qg_dlgcircle.h"
#include "ui/qg_roundoptions.h"
#include "ui/qg_selectionwidget.h"
#include "ui/qg_snapdistoptions.h"
-#include "ui/qg_splineoptions.h"
+ #include "ui/qg_splineoptions.h"
#include "ui/qg_textoptions.h"
-#include "ui/qg_trimamountoptions.h"
+ #include "ui/qg_trimamountoptions.h"
#endif
#include "arcoptions.h"
#include "arctangentialoptions.h"
#include "circleoptions.h"
#include "commandwidget.h"
#include "coordinatewidget.h"
+#include "dimlinearoptions.h"
+#include "dimoptions.h"
#include "dlgattributes.h"
#include "dlgoptionsdrawing.h"
#include "dlgoptionsgeneral.h"
#include "mousewidget.h"
#include "printpreviewoptions.h"
#include "selectionwidget.h"
+#include "splineoptions.h"
#include "textoptions.h"
+#include "trimamountoptions.h"
#ifdef RS_PROF
#include "qg_polylineoptions.h"
}
}
-/**
- * Shows a widget for spline options.
- */
-void QG_DialogFactory::requestSplineOptions(RS_ActionInterface* action,
- bool on, bool update)
-{
- static QG_SplineOptions* toolWidget = NULL;
-
- if (optionWidget!=NULL) {
- if (toolWidget!=NULL) {
- delete toolWidget;
- toolWidget = NULL;
- }
- if (on==true && toolWidget==NULL) {
- toolWidget = new QG_SplineOptions(optionWidget);
- toolWidget->setAction(action, update);
- }
- }
-}
-
/**
* Shows a widget for insert options.
*/
}
}
-/**
- * Shows a widget for dimension options.
- */
-void QG_DialogFactory::requestDimensionOptions(RS_ActionInterface* action,
- bool on, bool update)
-{
- //static QLabel* l = NULL;
- static QG_DimOptions* toolWidget = NULL;
-
- if (optionWidget!=NULL) {
- if (toolWidget!=NULL) {
- delete toolWidget;
- toolWidget = NULL;
- }
- if (on==true && toolWidget==NULL) {
- toolWidget = new QG_DimOptions(optionWidget);
- toolWidget->setAction(action, update);
- }
- }
-}
-
-/**
- * Shows a widget for linear dimension options.
- */
-void QG_DialogFactory::requestDimLinearOptions(RS_ActionInterface* action,
- bool on, bool update)
-{
- //static QLabel* l = NULL;
- static QG_DimLinearOptions* toolWidget = NULL;
-
- if (optionWidget!=NULL) {
- if (toolWidget!=NULL) {
- delete toolWidget;
- toolWidget = NULL;
- }
- if (on==true && toolWidget==NULL) {
- toolWidget = new QG_DimLinearOptions(optionWidget);
- toolWidget->setAction(action, update);
- }
- }
-}
-
/**
* Shows a widget for 'snap to a point with a given distance' options.
*/
}
}
-/**
- * Shows a widget for 'trim amount' options.
- */
-void QG_DialogFactory::requestTrimAmountOptions(RS_ActionInterface* action,
- bool on, bool update)
-{
- static QG_TrimAmountOptions* toolWidget = NULL;
-
- if (optionWidget!=NULL) {
- if (toolWidget!=NULL) {
- delete toolWidget;
- toolWidget = NULL;
- }
- if (on==true && toolWidget==NULL) {
- toolWidget = new QG_TrimAmountOptions(optionWidget);
- toolWidget->setAction(action, update);
- }
- }
-}
-
/**
* Shows a widget for rounding options.
*/
}
}
-void QG_DialogFactory::requestSplineOptions(RS_ActionInterface* action, bool on, bool update)
+/**
+ * Shows a widget for spline options.
+ */
+void QG_DialogFactory::requestSplineOptions(RS_ActionInterface * action, bool on, bool update)
{
+ static SplineOptions * toolWidget = NULL;
+
+ if (optionWidget!=NULL) {
+ if (toolWidget!=NULL) {
+ delete toolWidget;
+ toolWidget = NULL;
+ }
+ if (on==true && toolWidget==NULL) {
+ toolWidget = new SplineOptions(optionWidget);
+ toolWidget->setAction(action, update);
+ }
+ }
}
/**
{
}
-void QG_DialogFactory::requestDimensionOptions(RS_ActionInterface* action, bool on, bool update)
+/**
+ * Shows a widget for dimension options.
+ */
+void QG_DialogFactory::requestDimensionOptions(RS_ActionInterface * action, bool on, bool update)
{
+ static DimOptions * toolWidget = NULL;
+
+ if (optionWidget!=NULL) {
+ if (toolWidget!=NULL) {
+ delete toolWidget;
+ toolWidget = NULL;
+ }
+ if (on==true && toolWidget==NULL) {
+ toolWidget = new DimOptions(optionWidget);
+ toolWidget->setAction(action, update);
+ }
+ }
}
-void QG_DialogFactory::requestDimLinearOptions(RS_ActionInterface* action, bool on, bool update)
+/**
+ * Shows a widget for linear dimension options.
+ */
+void QG_DialogFactory::requestDimLinearOptions(RS_ActionInterface * action, bool on, bool update)
{
+ static DimLinearOptions * toolWidget = NULL;
+
+ if (!optionWidget)
+ return;
+
+ if (toolWidget)
+ {
+ delete toolWidget;
+ toolWidget = NULL;
+ }
+
+ if (on)
+ {
+ toolWidget = new DimLinearOptions(optionWidget);
+ toolWidget->setAction(action, update);
+ }
}
void QG_DialogFactory::requestSnapDistOptions(double& dist, bool on)
{
}
-void QG_DialogFactory::requestTrimAmountOptions(RS_ActionInterface* action, bool on, bool update)
+/**
+ * Shows a widget for 'trim amount' options.
+ */
+void QG_DialogFactory::requestTrimAmountOptions(RS_ActionInterface * action, bool on, bool update)
{
+ static TrimAmountOptions * toolWidget = NULL;
+
+ if (!optionWidget)
+ return;
+
+ if (toolWidget)
+ {
+ delete toolWidget;
+ toolWidget = NULL;
+ }
+
+ if (on)
+ {
+ toolWidget = new TrimAmountOptions(optionWidget);
+ toolWidget->setAction(action, update);
+ }
}
/**