#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);
+ }
}
/**