]> Shamusworld >> Repos - architektonas/commitdiff
Start of bringing back missing forms/dialogs
authorShamus Hammons <jlhamm@acm.org>
Wed, 9 Jun 2010 04:26:48 +0000 (04:26 +0000)
committerShamus Hammons <jlhamm@acm.org>
Wed, 9 Jun 2010 04:26:48 +0000 (04:26 +0000)
33 files changed:
architektonas.pro
src/base/rs_eventhandler.cpp
src/base/rs_snapper.cpp
src/forms/arcoptions.cpp [new file with mode: 0644]
src/forms/arcoptions.h [new file with mode: 0644]
src/forms/arctangentialoptions.cpp [new file with mode: 0644]
src/forms/arctangentialoptions.h [new file with mode: 0644]
src/forms/beveloptions.cpp [new file with mode: 0644]
src/forms/beveloptions.h [new file with mode: 0644]
src/forms/cadtoolbar.cpp
src/forms/cadtoolbarmain.cpp
src/forms/cadtoolbarmain.ui
src/forms/circleoptions.cpp [new file with mode: 0644]
src/forms/circleoptions.h [new file with mode: 0644]
src/forms/lineoptions.cpp
src/forms/lineoptions.h
src/forms/printpreviewoptions.cpp
src/forms/printpreviewoptions.h
src/forms/printpreviewoptions.ui
src/forms/res/architektonas.qrc
src/forms/res/splash.png [new file with mode: 0644]
src/forms/textoptions.cpp
src/forms/textoptions.h
src/mainapp/main.cpp
src/mainapp/qc_applicationwindow.cpp
src/mainapp/qc_applicationwindow.h
src/mainapp/qc_dialogfactory.cpp
src/mainapp/qc_dialogfactory.h
src/widgets/qg_actionhandler.cpp
src/widgets/qg_blockwidget.cpp
src/widgets/qg_dialogfactory.cpp
src/widgets/qg_dialogfactory.h
src/widgets/qg_graphicview.cpp

index 7c4f4bae73412eaa170c38fb68d1a615b6a76673..48889a5d21ae997e217deeab97be1fb22e86b6f7 100644 (file)
@@ -404,6 +404,9 @@ SOURCES += \
        src/actions/rs_actionzoomwindow.cpp
 
 HEADERS += \
+       src/forms/arcoptions.h \
+       src/forms/arctangentialoptions.h \
+       src/forms/beveloptions.h \
        src/forms/blockdialog.h \
        src/forms/cadtoolbar.h \
        src/forms/cadtoolbararcs.h \
@@ -419,6 +422,7 @@ HEADERS += \
        src/forms/cadtoolbarselect.h \
        src/forms/cadtoolbarsnap.h \
        src/forms/cadtoolbarsplines.h \
+       src/forms/circleoptions.h \
        src/forms/commandwidget.h \
        src/forms/coordinatewidget.h \
        src/forms/dlgattributes.h \
@@ -458,6 +462,9 @@ HEADERS += \
        src/widgets/qg_widthbox.h
 
 SOURCES += \
+       src/forms/arcoptions.cpp \
+       src/forms/arctangentialoptions.cpp \
+       src/forms/beveloptions.cpp \
        src/forms/blockdialog.cpp \
        src/forms/cadtoolbar.cpp \
        src/forms/cadtoolbararcs.cpp \
@@ -473,6 +480,7 @@ SOURCES += \
        src/forms/cadtoolbarselect.cpp \
        src/forms/cadtoolbarsnap.cpp \
        src/forms/cadtoolbarsplines.cpp \
+       src/forms/circleoptions.cpp \
        src/forms/commandwidget.cpp \
        src/forms/coordinatewidget.cpp \
        src/forms/dlgattributes.cpp \
@@ -511,10 +519,6 @@ SOURCES += \
 
 #The following line was changed from FORMS to FORMS3 by qt3to4
 #FORMS3 = \
-#      ui/qg_arcoptions.ui \
-#      ui/qg_arctangentialoptions.ui \
-#      ui/qg_beveloptions.ui \
-#      ui/qg_circleoptions.ui \
 #      ui/qg_dimensionlabeleditor.ui \
 #      ui/qg_dimlinearoptions.ui \
 #      ui/qg_dimoptions.ui \
@@ -547,9 +551,11 @@ SOURCES += \
 #      ui/qg_roundoptions.ui \
 #      ui/qg_snapdistoptions.ui \
 #      ui/qg_splineoptions.ui \
-#      ui/qg_textoptions.ui \
 #      ui/qg_trimamountoptions.ui
 
+#      src/forms/arcoptions.ui \
+#      src/forms/arctangentialoptions.ui \
+#
 FORMS = \
        src/forms/blockdialog.ui \
        src/forms/cadtoolbar.ui \
index 2961ff733d4e2e8b4e902e62462d67c8cc1ab732..260998a133aeefc59de93e64d784a2fb5c472f17 100644 (file)
@@ -326,7 +326,6 @@ void RS_EventHandler::commandEvent(RS_CommandEvent * e)
                                if (actionIndex >= 0 && currentActions[actionIndex] != NULL
                                        && !currentActions[actionIndex]->isFinished())
                                {
-//                                     int commaPos = cmd.find('<');
                                        int commaPos = cmd.indexOf('<');
                                        bool ok1, ok2;
                                        double r = RS_Math::eval(cmd.left(commaPos), &ok1);
index cc58b1ae161cca1ca755457041280d9975d450ca..016b48db92b2e0350ca3565b19e59ddc56fb0d85 100644 (file)
@@ -464,7 +464,7 @@ void RS_Snapper::resume()
 void RS_Snapper::hideOptions()
 {
        if (snapMode == RS2::SnapDist)
-               if (RS_DIALOGFACTORY!=NULL)
+               if (RS_DIALOGFACTORY != NULL)
                        RS_DIALOGFACTORY->requestSnapDistOptions(distance, false);
 }
 
diff --git a/src/forms/arcoptions.cpp b/src/forms/arcoptions.cpp
new file mode 100644 (file)
index 0000000..0f794e7
--- /dev/null
@@ -0,0 +1,84 @@
+// arcoptions.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/08/2010  Created this file. :-)
+// JLH  06/08/2010  Fixed problem with widget not showing up in toolbar.
+//
+
+#include "arcoptions.h"
+
+#include "rs_actiondrawarc.h"
+#include "rs_actioninterface.h"
+#include "settings.h"
+
+ArcOptions::ArcOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
+       QWidget(parent, flags)
+{
+       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"));
+
+       layout->addWidget(rbPos);
+       layout->addWidget(rbNeg);
+
+       connect(rbPos, SIGNAL(toggled(bool)), this, SLOT(updateDirection(bool)));
+       connect(rbNeg, SIGNAL(toggled(bool)), this, SLOT(updateDirection(bool)));
+
+       // 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);
+}
+
+ArcOptions::~ArcOptions()
+{
+       settings.beginGroup("Draw");
+       settings.setValue("ArcReversed", rbNeg->isChecked());
+       settings.endGroup();
+}
+
+void ArcOptions::setAction(RS_ActionInterface * a, bool update)
+{
+       if (a != NULL && a->rtti() == RS2::ActionDrawArc)
+       {
+               action = (RS_ActionDrawArc *)a;
+
+               bool reversed;
+
+               if (update)
+                       reversed = action->isReversed();
+               else
+               {
+                       settings.beginGroup("Draw");
+                       reversed = settings.value("ArcReversed", false).toBool();
+                       settings.endGroup();
+                       action->setReversed(reversed);
+               }
+
+               rbNeg->setChecked(reversed);
+       }
+       else
+       {
+               RS_DEBUG->print(RS_Debug::D_ERROR, "QG_ArcOptions::setAction: wrong action type");
+               action = NULL;
+       }
+}
+
+void ArcOptions::updateDirection(bool /*pos*/)
+{
+       if (action != NULL)
+               action->setReversed(rbNeg->isChecked());
+}
diff --git a/src/forms/arcoptions.h b/src/forms/arcoptions.h
new file mode 100644 (file)
index 0000000..66f2eda
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef __ARCOPTIONS_H__
+#define __ARCOPTIONS_H__
+
+//#include "ui_arcoptions.h"
+#include <QtGui>
+
+class RS_ActionDrawArc;
+class RS_ActionInterface;
+
+class ArcOptions: public QWidget
+{
+       Q_OBJECT
+
+       public:
+               ArcOptions(QToolBar * parent = 0, Qt::WindowFlags flags = 0);
+               ~ArcOptions();
+
+       public slots:
+               void setAction(RS_ActionInterface * a, bool update);
+               void updateDirection(bool);
+
+       protected:
+               RS_ActionDrawArc * action;
+               QRadioButton * rbPos;
+               QRadioButton * rbNeg;
+
+       private:
+//             Ui::ArcOptions ui;
+};
+
+#endif // __ARCOPTIONS_H__
diff --git a/src/forms/arctangentialoptions.cpp b/src/forms/arctangentialoptions.cpp
new file mode 100644 (file)
index 0000000..54a92f2
--- /dev/null
@@ -0,0 +1,143 @@
+// arctangentialoptions.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/08/2010  Created this file. :-)
+//
+
+#include "arctangentialoptions.h"
+
+#include "rs_actiondrawarctangential.h"
+#include "settings.h"
+
+ArcTangentialOptions::ArcTangentialOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
+       QWidget(parent, flags)
+{
+#if 1
+       QHBoxLayout * layout = new QHBoxLayout(this);
+       layout->setContentsMargins(0, 0, 0, 0);
+
+       lRadius = new QLabel(tr("Radius:"));
+       leRadius = new QLineEdit(this);
+       leRadius->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Ignored));
+
+       layout->addWidget(lRadius);
+       layout->addWidget(leRadius);
+
+       connect(leRadius, SIGNAL(textChanged(QString)), this, SLOT(updateRadius(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);
+#else
+       if (objectName().isEmpty())
+               setObjectName(QString::fromUtf8("ArcTangentialOptions"));
+
+       resize(160, 24);
+       QSizePolicy policy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+       policy.setHorizontalStretch(0);
+       policy.setVerticalStretch(0);
+       policy.setHeightForWidth(sizePolicy().hasHeightForWidth());
+       setSizePolicy(policy);
+       setMinimumSize(QSize(160, 22));
+
+       QHBoxLayout * hboxLayout = new QHBoxLayout(this);
+       hboxLayout->setSpacing(6);
+       hboxLayout->setContentsMargins(0, 0, 0, 0);
+       hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
+       lRadius = new QLabel(this);
+       lRadius->setObjectName(QString::fromUtf8("lRadius"));
+       lRadius->setWordWrap(false);
+
+       hboxLayout->addWidget(lRadius);
+
+       leRadius = new QLineEdit(this);
+       leRadius->setObjectName(QString::fromUtf8("leRadius"));
+       QSizePolicy sizePolicy1(QSizePolicy::Ignored, QSizePolicy::Fixed);
+       sizePolicy1.setHorizontalStretch(0);
+       sizePolicy1.setVerticalStretch(0);
+       sizePolicy1.setHeightForWidth(leRadius->sizePolicy().hasHeightForWidth());
+       leRadius->setSizePolicy(sizePolicy1);
+
+       hboxLayout->addWidget(leRadius);
+
+       sep1 = new QFrame(this);
+       sep1->setObjectName(QString::fromUtf8("sep1"));
+       QSizePolicy sizePolicy2(QSizePolicy::Fixed, QSizePolicy::Minimum);
+       sizePolicy2.setHorizontalStretch(0);
+       sizePolicy2.setVerticalStretch(0);
+       sizePolicy2.setHeightForWidth(sep1->sizePolicy().hasHeightForWidth());
+       sep1->setSizePolicy(sizePolicy2);
+       sep1->setFrameShape(QFrame::VLine);
+       sep1->setFrameShadow(QFrame::Sunken);
+
+       hboxLayout->addWidget(sep1);
+
+//     retranslateUi(ArcTangentialOptions);
+       QObject::connect(leRadius, SIGNAL(textChanged(QString)), this, SLOT(updateRadius(QString)));
+       QMetaObject::connectSlotsByName(this);
+#endif
+}
+
+ArcTangentialOptions::~ArcTangentialOptions()
+{
+       settings.beginGroup("Draw");
+       settings.setValue("ArcTangentialRadius", leRadius->text());
+       settings.endGroup();
+}
+
+void ArcTangentialOptions::setAction(RS_ActionInterface * a, bool update)
+{
+       if (a != NULL && a->rtti() == RS2::ActionDrawArcTangential)
+       {
+               action = (RS_ActionDrawArcTangential *)a;
+
+               QString sr;
+
+               if (update)
+                       sr = QString("%1").arg(action->getRadius());
+               else
+               {
+                       settings.beginGroup("Draw");
+                       sr = settings.value("ArcTangentialRadius", "1.0").toString();
+                       settings.endGroup();
+                       action->setRadius(sr.toDouble());
+               }
+               leRadius->setText(sr);
+       }
+       else
+       {
+               RS_DEBUG->print(RS_Debug::D_ERROR,
+                       "ArcTangentialOptions::setAction: wrong action type");
+               action = NULL;
+       }
+}
+
+/*void ArcTangentialOptions::init() {
+    data = NULL;
+    RS_SETTINGS->beginGroup("/Draw");
+    bool reversed = RS_SETTINGS->readNumEntry("/ArcReversed", 0);
+    RS_SETTINGS->endGroup();
+
+    rbNeg->setChecked(reversed);
+   }*/
+
+/*void ArcTangentialOptions::setData(RS_ArcData* d) {
+    data = d;
+    updateDirection(false);
+   }*/
+
+void ArcTangentialOptions::updateRadius(const QString & s)
+{
+       if (action != NULL)
+               action->setRadius(RS_Math::eval(s));
+}
+
diff --git a/src/forms/arctangentialoptions.h b/src/forms/arctangentialoptions.h
new file mode 100644 (file)
index 0000000..813116f
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef __ARCTANGENTIALOPTIONS_H__
+#define __ARCTANGENTIALOPTIONS_H__
+
+//#include "ui_arctangentialoptions.h"
+#include <QtGui>
+
+class RS_ActionDrawArcTangential;
+class RS_ActionInterface;
+
+class ArcTangentialOptions: public QWidget
+{
+       Q_OBJECT
+
+       public:
+               ArcTangentialOptions(QToolBar * parent = 0, Qt::WindowFlags flags = 0);
+               ~ArcTangentialOptions();
+
+       public slots:
+               void setAction(RS_ActionInterface * a, bool update);
+               void updateRadius(const QString & s);
+
+       protected:
+               RS_ActionDrawArcTangential * action;
+               QLabel * lRadius;
+               QLineEdit * leRadius;
+               QFrame * sep1;
+
+       private:
+//             Ui::ArcTangentialOptions ui;
+};
+
+#endif // __ARCTANGENTIALOPTIONS_H__
diff --git a/src/forms/beveloptions.cpp b/src/forms/beveloptions.cpp
new file mode 100644 (file)
index 0000000..94887b4
--- /dev/null
@@ -0,0 +1,109 @@
+// beveloptions.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/08/2010  Created this file. :-)
+//
+
+#include "beveloptions.h"
+
+#include "rs.h"
+#include "rs_actioninterface.h"
+#include "rs_actionmodifybevel.h"
+#include "settings.h"
+
+BevelOptions::BevelOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
+       QWidget(parent, flags),
+       cbTrim(new QCheckBox(tr("Trim"))),
+       lLength1(new QLabel(tr("Length 1:"))),
+       lLength2(new QLabel(tr("Length 2:"))),
+       leLength1(new QLineEdit(this)),
+       leLength2(new QLineEdit(this)),
+       sep1(new QFrame(this))
+{
+       QHBoxLayout * layout = new QHBoxLayout(this);
+       layout->setContentsMargins(0, 0, 0, 0);
+
+       leLength1->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Ignored));
+       leLength2->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Ignored));
+       sep1->setFrameShape(QFrame::VLine);
+       sep1->setFrameShadow(QFrame::Sunken);
+
+       layout->addWidget(cbTrim);
+       layout->addWidget(sep1);
+       layout->addWidget(lLength1);
+       layout->addWidget(leLength1);
+       layout->addWidget(lLength2);
+       layout->addWidget(leLength2);
+
+       connect(cbTrim, SIGNAL(toggled(bool)), this, SLOT(updateData()));
+       connect(leLength1, SIGNAL(textChanged(QString)), this, SLOT(updateData()));
+       connect(leLength2, SIGNAL(textChanged(QString)), this, SLOT(updateData()));
+
+       // 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);
+}
+
+BevelOptions::~BevelOptions()
+{
+       settings.beginGroup("Modify");
+       settings.setValue("BevelLength1", leLength1->text());
+       settings.setValue("BevelLength2", leLength2->text());
+       settings.setValue("BevelTrim", cbTrim->isChecked());
+       settings.endGroup();
+}
+
+void BevelOptions::setAction(RS_ActionInterface * a, bool update)
+{
+       if (a != NULL && a->rtti() == RS2::ActionModifyBevel)
+       {
+               action = (RS_ActionModifyBevel *)a;
+
+               QString sd1;
+               QString sd2;
+               bool st;
+
+               if (update)
+               {
+                       sd1 = QString("%1").arg(action->getLength1());
+                       sd2 = QString("%1").arg(action->getLength2());
+                       st = action->isTrimOn();
+               }
+               else
+               {
+                       settings.beginGroup("Modify");
+                       sd1 = settings.value("BevelLength1", "1.0").toString();
+                       sd2 = settings.value("BevelLength2", "1.0").toString();
+                       st = settings.value("BevelTrim", true).toBool();
+                       settings.endGroup();
+               }
+
+               leLength1->setText(sd1);
+               leLength2->setText(sd2);
+               cbTrim->setChecked(st);
+       }
+       else
+       {
+               RS_DEBUG->print(RS_Debug::D_ERROR, "BevelOptions::setAction: wrong action type");
+               action = NULL;
+       }
+}
+
+void BevelOptions::updateData()
+{
+       if (action != NULL)
+       {
+               action->setTrim(cbTrim->isChecked());
+               action->setLength1(RS_Math::eval(leLength1->text()));
+               action->setLength2(RS_Math::eval(leLength2->text()));
+       }
+}
diff --git a/src/forms/beveloptions.h b/src/forms/beveloptions.h
new file mode 100644 (file)
index 0000000..f98ead0
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef __BEVELOPTIONS_H__
+#define __BEVELOPTIONS_H__
+
+#include <QtGui>
+
+class RS_ActionInterface;
+class RS_ActionModifyBevel;
+
+class BevelOptions: public QWidget
+{
+       Q_OBJECT
+
+       public:
+               BevelOptions(QToolBar * parent = 0, Qt::WindowFlags flags = 0);
+               ~BevelOptions();
+
+       public slots:
+               void setAction(RS_ActionInterface * a, bool update);
+               void updateData();
+
+       protected:
+               RS_ActionModifyBevel * action;
+
+       private:
+               QCheckBox * cbTrim;
+               QLabel * lLength1;
+               QLabel * lLength2;
+               QLineEdit * leLength1;
+               QLineEdit * leLength2;
+               QFrame * sep1;
+};
+
+#endif  // __BEVELOPTIONS_H__
index 07a7aa3084e3653a49f7d2f57d50748a44881617..4bfe299ab4c4a50bd25d75b361d179b2806cb9c4 100644 (file)
@@ -1,5 +1,6 @@
 // cadtoolbar.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
@@ -35,6 +36,9 @@ CadToolBar::CadToolBar(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
        tbSelect(NULL), tbPolylines(NULL)
 {
        ui.setupUi(this);
+//hm. here maybe?
+if (parent)
+       ((QToolBar *)parent)->addWidget(this);
 }
 
 CadToolBar::~CadToolBar()
index b2111e9a1f731fb02979ef6ad09925b9004f0616..3cc4aa22ad80572f456f8c7be436a72626629b89 100644 (file)
@@ -1,5 +1,6 @@
 // cadtoolbarmain.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
@@ -16,6 +17,8 @@
 #include "cadtoolbar.h"
 #include "qg_actionhandler.h"
 
+#include "createqtactions.h"
+
 CadToolBarMain::CadToolBarMain(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
        QWidget(parent, flags)
 {
@@ -25,6 +28,11 @@ CadToolBarMain::CadToolBarMain(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*=
 //#ifndef RS_PROF
 //     ui.bMenuPolyline->hide();
 //#endif
+
+//hm.
+//well, it looks like something else is messing with this...
+//     if (parent)
+//             ((QToolBar *)parent)->addWidget(this);
 }
 
 CadToolBarMain::~CadToolBarMain()
@@ -35,12 +43,12 @@ void CadToolBarMain::setCadToolBar(CadToolBar * tb)
 {
        QG_ActionHandler * ah = NULL;
 
-       if (tb != NULL)
+       if (tb)
                ah = tb->getActionHandler();
        else
                RS_DEBUG->print(RS_Debug::D_ERROR, "QG_CadToolBarMain::setCadToolBar(): No valid toolbar set.");
 
-       if (ah != NULL)
+       if (ah)
        {
                connect(ui.bMenuPoint, SIGNAL(clicked()), ah, SLOT(slotDrawPoint()));
                connect(ui.bMenuLine, SIGNAL(clicked()), tb, SLOT(showToolBarLines()));
index 3f11b244393b9eb370ca0766fd05e41a4f4c32d6..b20cf86aab7a04bf516f908f6f0078030727a761 100644 (file)
@@ -7,11 +7,11 @@
     <x>0</x>
     <y>0</y>
     <width>86</width>
-    <height>336</height>
+    <height>224</height>
    </rect>
   </property>
   <property name="sizePolicy">
-   <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+   <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
   <property name="minimumSize">
    <size>
     <width>56</width>
-    <height>336</height>
+    <height>200</height>
    </size>
   </property>
   <property name="windowTitle">
    <string>Main</string>
   </property>
   <layout class="QGridLayout" name="gridLayout">
+   <property name="margin">
+    <number>0</number>
+   </property>
+   <property name="spacing">
+    <number>0</number>
+   </property>
    <item row="0" column="0">
     <widget class="QToolButton" name="bMenuPoint">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="toolTip">
       <string>Points</string>
      </property>
       <iconset resource="res/architektonas.qrc">
        <normaloff>:/res/qg_menupoint.xpm</normaloff>:/res/qg_menupoint.xpm</iconset>
      </property>
+     <property name="iconSize">
+      <size>
+       <width>18</width>
+       <height>18</height>
+      </size>
+     </property>
     </widget>
    </item>
    <item row="0" column="1">
     <widget class="QToolButton" name="bMenuLine">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="toolTip">
       <string>Show menu &quot;Lines&quot;</string>
      </property>
       <iconset resource="res/architektonas.qrc">
        <normaloff>:/res/qg_menuline.xpm</normaloff>:/res/qg_menuline.xpm</iconset>
      </property>
+     <property name="iconSize">
+      <size>
+       <width>18</width>
+       <height>18</height>
+      </size>
+     </property>
     </widget>
    </item>
    <item row="1" column="0">
     <widget class="QToolButton" name="bMenuArc">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="toolTip">
       <string>Show menu &quot;Arcs&quot;</string>
      </property>
       <iconset resource="res/architektonas.qrc">
        <normaloff>:/res/qg_menuarc.xpm</normaloff>:/res/qg_menuarc.xpm</iconset>
      </property>
+     <property name="iconSize">
+      <size>
+       <width>18</width>
+       <height>18</height>
+      </size>
+     </property>
     </widget>
    </item>
    <item row="1" column="1">
     <widget class="QToolButton" name="bMenuCircle">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="toolTip">
       <string>Show menu &quot;Circles&quot;</string>
      </property>
       <iconset resource="res/architektonas.qrc">
        <normaloff>:/res/qg_menucircle.xpm</normaloff>:/res/qg_menucircle.xpm</iconset>
      </property>
+     <property name="iconSize">
+      <size>
+       <width>18</width>
+       <height>18</height>
+      </size>
+     </property>
     </widget>
    </item>
    <item row="2" column="0">
     <widget class="QToolButton" name="bMenuEllipse">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="toolTip">
       <string>Show menu &quot;Ellipses&quot;</string>
      </property>
       <iconset resource="res/architektonas.qrc">
        <normaloff>:/res/qg_menuellipse.xpm</normaloff>:/res/qg_menuellipse.xpm</iconset>
      </property>
+     <property name="iconSize">
+      <size>
+       <width>18</width>
+       <height>18</height>
+      </size>
+     </property>
     </widget>
    </item>
    <item row="2" column="1">
     <widget class="QToolButton" name="bMenuSpline">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="toolTip">
       <string>Splines</string>
      </property>
       <iconset resource="res/architektonas.qrc">
        <normaloff>:/res/qg_menuspline.xpm</normaloff>:/res/qg_menuspline.xpm</iconset>
      </property>
+     <property name="iconSize">
+      <size>
+       <width>18</width>
+       <height>18</height>
+      </size>
+     </property>
     </widget>
    </item>
    <item row="3" column="0">
     <widget class="QToolButton" name="bMenuPolyline">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="toolTip">
       <string>Polylines</string>
      </property>
       <iconset resource="res/architektonas.qrc">
        <normaloff>:/res/qg_menupolyline.xpm</normaloff>:/res/qg_menupolyline.xpm</iconset>
      </property>
+     <property name="iconSize">
+      <size>
+       <width>18</width>
+       <height>18</height>
+      </size>
+     </property>
     </widget>
    </item>
    <item row="4" column="0">
     <widget class="QToolButton" name="bMenuText">
      <property name="sizePolicy">
-      <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+      <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
       <iconset resource="res/architektonas.qrc">
        <normaloff>:/res/qg_menutext.xpm</normaloff>:/res/qg_menutext.xpm</iconset>
      </property>
+     <property name="iconSize">
+      <size>
+       <width>18</width>
+       <height>18</height>
+      </size>
+     </property>
     </widget>
    </item>
    <item row="4" column="1">
     <widget class="QToolButton" name="bMenuDim">
      <property name="sizePolicy">
-      <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+      <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
       <iconset resource="res/architektonas.qrc">
        <normaloff>:/res/qg_menudim.png</normaloff>:/res/qg_menudim.png</iconset>
      </property>
+     <property name="iconSize">
+      <size>
+       <width>18</width>
+       <height>18</height>
+      </size>
+     </property>
     </widget>
    </item>
    <item row="5" column="0">
     <widget class="QToolButton" name="bMenuHatch">
      <property name="sizePolicy">
-      <sizepolicy hsizetype="Maximum" vsizetype="Minimum">
+      <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
       <iconset resource="res/architektonas.qrc">
        <normaloff>:/res/qg_menuhatch.xpm</normaloff>:/res/qg_menuhatch.xpm</iconset>
      </property>
+     <property name="iconSize">
+      <size>
+       <width>18</width>
+       <height>18</height>
+      </size>
+     </property>
     </widget>
    </item>
    <item row="5" column="1">
     <widget class="QToolButton" name="bMenuImage">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="toolTip">
       <string>Raster Image</string>
      </property>
       <iconset resource="res/architektonas.qrc">
        <normaloff>:/res/qg_menuimage.xpm</normaloff>:/res/qg_menuimage.xpm</iconset>
      </property>
+     <property name="iconSize">
+      <size>
+       <width>18</width>
+       <height>18</height>
+      </size>
+     </property>
     </widget>
    </item>
    <item row="6" column="0">
     <widget class="QToolButton" name="bMenuModify">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="toolTip">
       <string>Show menu &quot;Edit&quot;</string>
      </property>
       <iconset resource="res/architektonas.qrc">
        <normaloff>:/res/qg_menuedit.xpm</normaloff>:/res/qg_menuedit.xpm</iconset>
      </property>
+     <property name="iconSize">
+      <size>
+       <width>18</width>
+       <height>18</height>
+      </size>
+     </property>
     </widget>
    </item>
    <item row="6" column="1">
     <widget class="QToolButton" name="bMenuInfo">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="toolTip">
       <string>Show menu &quot;Measure&quot;</string>
      </property>
       <iconset resource="res/architektonas.qrc">
        <normaloff>:/res/qg_menumeasure.xpm</normaloff>:/res/qg_menumeasure.xpm</iconset>
      </property>
+     <property name="iconSize">
+      <size>
+       <width>18</width>
+       <height>18</height>
+      </size>
+     </property>
     </widget>
    </item>
    <item row="7" column="0">
     <widget class="QToolButton" name="bMenuBlock">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="toolTip">
       <string>Create Block</string>
      </property>
       <iconset resource="res/architektonas.qrc">
        <normaloff>:/res/qg_menublock.xpm</normaloff>:/res/qg_menublock.xpm</iconset>
      </property>
+     <property name="iconSize">
+      <size>
+       <width>18</width>
+       <height>18</height>
+      </size>
+     </property>
     </widget>
    </item>
    <item row="7" column="1">
     <widget class="QToolButton" name="bMenuSelect">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="toolTip">
       <string>Show menu &quot;Select&quot;</string>
      </property>
       <iconset resource="res/architektonas.qrc">
        <normaloff>:/res/qg_menuselect.xpm</normaloff>:/res/qg_menuselect.xpm</iconset>
      </property>
-    </widget>
-   </item>
-   <item row="8" column="0" colspan="2">
-    <spacer name="verticalSpacer">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
+     <property name="iconSize">
       <size>
-       <width>20</width>
-       <height>40</height>
+       <width>18</width>
+       <height>18</height>
       </size>
      </property>
-    </spacer>
+    </widget>
    </item>
-   <item row="3" column="2" rowspan="3">
+   <item row="4" column="2">
     <spacer name="horizontalSpacer">
      <property name="orientation">
       <enum>Qt::Horizontal</enum>
      </property>
      <property name="sizeHint" stdset="0">
       <size>
-       <width>40</width>
+       <width>8</width>
        <height>20</height>
       </size>
      </property>
diff --git a/src/forms/circleoptions.cpp b/src/forms/circleoptions.cpp
new file mode 100644 (file)
index 0000000..9a0f65e
--- /dev/null
@@ -0,0 +1,82 @@
+// circleoptions.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/08/2010  Created this file. :-)
+//
+
+#include "circleoptions.h"
+
+#include "rs.h"
+#include "rs_actioninterface.h"
+#include "rs_actiondrawcirclecr.h"
+#include "settings.h"
+
+CircleOptions::CircleOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
+       QWidget(parent, flags)
+{
+       QHBoxLayout * layout = new QHBoxLayout(this);
+       layout->setContentsMargins(0, 0, 0, 0);
+
+       lRadius = new QLabel(tr("Radius:"));
+       leRadius = new QLineEdit(this);
+       leRadius->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Ignored));
+
+       layout->addWidget(lRadius);
+       layout->addWidget(leRadius);
+
+       connect(leRadius, SIGNAL(textChanged(QString)), this, SLOT(updateRadius(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);
+}
+
+CircleOptions::~CircleOptions()
+{
+       settings.beginGroup("Draw");
+       settings.setValue("CircleRadius", leRadius->text());
+       settings.endGroup();
+}
+
+void CircleOptions::setAction(RS_ActionInterface * a, bool update)
+{
+       if (a != NULL && a->rtti() == RS2::ActionDrawCircleCR)
+       {
+               action = (RS_ActionDrawCircleCR *)a;
+
+               QString sr;
+
+               if (update)
+                       sr = QString("%1").arg(action->getRadius());
+               else
+               {
+                       settings.beginGroup("Draw");
+                       sr = settings.value("CircleRadius", "1.0").toString();
+                       settings.endGroup();
+                       action->setRadius(sr.toDouble());
+               }
+
+               leRadius->setText(sr);
+       }
+       else
+       {
+               RS_DEBUG->print(RS_Debug::D_ERROR,
+                       "CircleOptions::setAction: wrong action type");
+               action = NULL;
+       }
+}
+
+void CircleOptions::updateRadius(const QString & r)
+{
+       if (action != NULL)
+               action->setRadius(RS_Math::eval(r));
+}
diff --git a/src/forms/circleoptions.h b/src/forms/circleoptions.h
new file mode 100644 (file)
index 0000000..3af5d51
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef __CIRCLEOPTIONS_H__
+#define __CIRCLEOPTIONS_H__
+
+#include <QtGui>
+
+class RS_ActionInterface;
+class RS_ActionDrawCircleCR;
+
+class CircleOptions: public QWidget
+{
+       Q_OBJECT
+
+       public:
+               CircleOptions(QToolBar * parent = 0, Qt::WindowFlags flags = 0);
+               ~CircleOptions();
+
+       public slots:
+               void setAction(RS_ActionInterface * a, bool update);
+               void updateRadius(const QString & r);
+
+       protected:
+               RS_ActionDrawCircleCR * action;
+
+       private:
+               QLabel * lRadius;
+               QLineEdit * leRadius;
+};
+
+#endif  // __CIRCLEOPTIONS_H__
index c625973bbf0ddbf73ef24b660cc73f78444226cb..289d85a9870c40101f0c2090edbe3c969c552b63 100644 (file)
@@ -1,5 +1,6 @@
 // lineoptions.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
 #include "rs_actiondrawline.h"
 #include "rs_actioninterface.h"
 
-LineOptions::LineOptions(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
+LineOptions::LineOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
        QWidget(parent, flags), action(NULL)
 {
        ui.setupUi(this);
+
+       // 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);
 }
 
 LineOptions::~LineOptions()
@@ -42,12 +48,12 @@ void LineOptions::setAction(RS_ActionInterface * a)
 
 void LineOptions::close()
 {
-       if (action != NULL)
+       if (action)
                action->close();
 }
 
 void LineOptions::undo()
 {
-       if (action != NULL)
+       if (action)
                action->undo();
 }
index 80009f4213ee6936726fba08a1a997aa439823a2..59ae1196f4c530ce5ab9fa307776572fb9a8e894 100644 (file)
@@ -5,13 +5,14 @@
 
 class RS_ActionDrawLine;
 class RS_ActionInterface;
+class QToolBar;
 
 class LineOptions: public QWidget
 {
        Q_OBJECT
 
        public:
-               LineOptions(QWidget * parent = 0, Qt::WindowFlags flags = 0);
+               LineOptions(QToolBar * parent = 0, Qt::WindowFlags flags = 0);
                ~LineOptions();
 
        public slots:
index 036a13c0010fea218576661de56fe72efc89724d..a88bbf253dfb35a5bb9529db35c467f9ce29cfcd 100644 (file)
 #include "rs.h"
 #include "rs_actioninterface.h"
 #include "rs_actionprintpreview.h"
+#include "rs_debug.h"
+#include "rs_math.h"
 
-PrintPreviewOptions::PrintPreviewOptions(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
+//PrintPreviewOptions::PrintPreviewOptions(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
+PrintPreviewOptions::PrintPreviewOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
        QWidget(parent, flags), updateDisabled(false)
 {
        imperialScales
-       << "1\" = 1\""
-       << "1\" = 2\""
-       << "1\" = 4\""
-       << "1\" = 8\""
-       << "1\" = 16\""
-       << "1\" = 32\""
-       << "1\" = 64\""
-       << "1\" = 128\""
-       << "1\" = 256\"";
+               << "1\" = 1\""
+               << "1\" = 2\""
+               << "1\" = 4\""
+               << "1\" = 8\""
+               << "1\" = 16\""
+               << "1\" = 32\""
+               << "1\" = 64\""
+               << "1\" = 128\""
+               << "1\" = 256\"";
 
        metricScales
-       << "1:1" << "1:2" << "1:5" << "1:10"
-       << "1:20" << "1:25" << "1:50" << "1:75" << "1:100"
-       << "1:125" << "1:150" << "1:175" << "1:200"
-       << "1:250" << "1:500" << "1:750" << "1:1000"
-       << "1:2500" << "1:5000" << "1:7500" << "1:10000"
-       << "1:25000" << "1:50000" << "1:75000" << "1:100000"
-       << "2:1" << "5:1" << "10:1"
-       << "20:1" << "25:1" << "50:1" << "75:1" << "100:1"
-       << "125:1" << "150:1" << "175:1" << "200:1"
-       << "250:1" << "500:1" << "750:1" << "1000:1"
-       << "2500:1" << "5000:1" << "7500:1" << "10000:1"
-       << "25000:1" << "50000:1" << "75000:1" << "100000:1";
+               << "1:1" << "1:2" << "1:5" << "1:10"
+               << "1:20" << "1:25" << "1:50" << "1:75" << "1:100"
+               << "1:125" << "1:150" << "1:175" << "1:200"
+               << "1:250" << "1:500" << "1:750" << "1:1000"
+               << "1:2500" << "1:5000" << "1:7500" << "1:10000"
+               << "1:25000" << "1:50000" << "1:75000" << "1:100000"
+               << "2:1" << "5:1" << "10:1"
+               << "20:1" << "25:1" << "50:1" << "75:1" << "100:1"
+               << "125:1" << "150:1" << "175:1" << "200:1"
+               << "250:1" << "500:1" << "750:1" << "1000:1"
+               << "2500:1" << "5000:1" << "7500:1" << "10000:1"
+               << "25000:1" << "50000:1" << "75000:1" << "100000:1";
 
        ui.setupUi(this);
+
+       if (parent)
+               parent->addWidget(this);
 }
 
 PrintPreviewOptions::~PrintPreviewOptions()
@@ -58,7 +64,7 @@ PrintPreviewOptions::~PrintPreviewOptions()
        */
 }
 
-void PrintPreviewOptions::setAction(RS_ActionInterface* a, bool/*update*/)
+void PrintPreviewOptions::setAction(RS_ActionInterface * a, bool/*update*/)
 {
        if (a != NULL && a->rtti() == RS2::ActionPrintPreview)
        {
@@ -145,7 +151,6 @@ void PrintPreviewOptions::scale(const QString & s)
        {
                bool ok1 = false;
                bool ok2 = false;
-//             int i = s.find(':');
                int i = s.indexOf(':');
                double n = s.left(i).toDouble(&ok1);
                double d = s.mid(i + 1).toDouble(&ok2);
@@ -156,7 +161,6 @@ void PrintPreviewOptions::scale(const QString & s)
        else if (s.contains('='))
        {
                bool ok = false;
-//             int i = s.find('=');
                int i = s.indexOf('=');
                double d = s.mid(i + 2, s.length() - i - 3).toDouble(&ok);
 
index 7c34ba533a8890384b62a25e65836af9dba254c8..3e9dd34a1e1444d1c0e6aa375a28c5576b8cc8f6 100644 (file)
@@ -5,13 +5,15 @@
 
 class RS_ActionInterface;
 class RS_ActionPrintPreview;
+class QToolBar;
 
 class PrintPreviewOptions: public QWidget
 {
        Q_OBJECT
 
        public:
-               PrintPreviewOptions(QWidget * parent = 0, Qt::WindowFlags fl = 0);
+//             PrintPreviewOptions(QWidget * parent = 0, Qt::WindowFlags fl = 0);
+               PrintPreviewOptions(QToolBar * parent = 0, Qt::WindowFlags fl = 0);
                ~PrintPreviewOptions();
 
        public slots:
index 2193de41e0aec5a7120fc54dd68c4218a655888f..096e7f264b04cec73c491d284be19d12bfb0d8c4 100644 (file)
@@ -66,8 +66,8 @@
       <string/>
      </property>
      <property name="icon">
-      <iconset>
-       <normaloff>xpm/qg_printbw.xpm</normaloff>xpm/qg_printbw.xpm</iconset>
+      <iconset resource="res/architektonas.qrc">
+       <normaloff>:/res/qg_printbw.xpm</normaloff>:/res/qg_printbw.xpm</iconset>
      </property>
      <property name="checkable">
       <bool>true</bool>
@@ -89,8 +89,8 @@
       <string/>
      </property>
      <property name="icon">
-      <iconset>
-       <normaloff>xpm/qg_printcenter.xpm</normaloff>xpm/qg_printcenter.xpm</iconset>
+      <iconset resource="res/architektonas.qrc">
+       <normaloff>:/res/qg_printcenter.xpm</normaloff>:/res/qg_printcenter.xpm</iconset>
      </property>
     </widget>
    </item>
       <string/>
      </property>
      <property name="icon">
-      <iconset>
-       <normaloff>xpm/qg_printscale.xpm</normaloff>xpm/qg_printscale.xpm</iconset>
+      <iconset resource="res/architektonas.qrc">
+       <normaloff>:/res/qg_printfit.xpm</normaloff>:/res/qg_printfit.xpm</iconset>
      </property>
     </widget>
    </item>
   </layout>
  </widget>
  <layoutdefault spacing="6" margin="11"/>
- <resources/>
+ <resources>
+  <include location="res/architektonas.qrc"/>
+ </resources>
  <connections>
   <connection>
    <sender>bCenter</sender>
    <slot>center()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>20</x>
+     <x>156</x>
      <y>20</y>
     </hint>
     <hint type="destinationlabel">
    <slot>setBlackWhite(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>20</x>
+     <x>126</x>
      <y>20</y>
     </hint>
     <hint type="destinationlabel">
    <slot>fit()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>20</x>
+     <x>186</x>
      <y>20</y>
     </hint>
     <hint type="destinationlabel">
index 36754870cbfea5e8db733973e23c4e74aa86e5ed..caca8884ef4f32f1054a19120904f9f83d1858b9 100644 (file)
                <file>qg_tolerance2.xpm</file>
                <file>qg_widthbox.xpm</file>
                <file>redo2.png</file>
+               <file>splash.png</file>
                <file>splash_camexpert.xpm</file>
                <file>splash_qcad.xpm</file>
                <file>undo2.png</file>
diff --git a/src/forms/res/splash.png b/src/forms/res/splash.png
new file mode 100644 (file)
index 0000000..06d72e3
Binary files /dev/null and b/src/forms/res/splash.png differ
index 055de11d6201cf0b62ad5364868691073994592d..2190360edc0050934904de0f35074d5ea422eee5 100644 (file)
 #include "rs_actiondrawtext.h"
 #include "rs_actioninterface.h"
 
-TextOptions::TextOptions(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/)
+TextOptions::TextOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
+       QWidget(parent, flags)
 {
        ui.setupUi(this);
+
+       // 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);
 }
 
 TextOptions::~TextOptions()
index b9975348922644eb33b6be758f935e24ee219ebb..c701fd56eb2b53de65d5b9b46dde4d684552b885 100644 (file)
@@ -5,13 +5,14 @@
 
 class RS_ActionInterface;
 class RS_ActionDrawText;
+class QToolBar;
 
 class TextOptions: public QWidget
 {
        Q_OBJECT
 
        public:
-               TextOptions(QWidget * parent = 0, Qt::WindowFlags flags = 0);
+               TextOptions(QToolBar * parent = 0, Qt::WindowFlags flags = 0);
                ~TextOptions();
 
        public slots:
index 5bbc2ebdd7c6d5d6a0ede16091f0e22bad6c3cd6..558465c7e0de30b4992aed95ee96c3d518dfcbaf 100644 (file)
@@ -145,7 +145,8 @@ int main(int argc, char * argv[])
 //     QPixmap * pixmap = new QPixmap(qPixmapFromMimeSource(QC_CUSTOM_SPLASH));
 //# else
 ////   QPixmap * pixmap = new QPixmap(":/res/splash.xpm");
-       QPixmap * pixmap = new QPixmap(":/res/splash_qcad.xpm");
+//     QPixmap * pixmap = new QPixmap(":/res/splash_qcad.xpm");
+       QPixmap * pixmap = new QPixmap(":/res/splash.png");
 //# endif
 
 /*
index 1c762552b1539d9533ddded7aa4cd214e48a8020..9b173a37337486987564bdf629f7b21dc6dca8c5 100644 (file)
@@ -17,7 +17,6 @@
 #include "qc_applicationwindow.h"
 
 #include <fstream>
-#include "rs_application.h"
 #include "rs_actiondrawlinefree.h"
 #include "rs_actionprintpreview.h"
 #include "rs_creation.h"
@@ -2972,19 +2971,6 @@ void QC_ApplicationWindow::slotScriptRun()
 void QC_ApplicationWindow::slotHelpAbout()
 {
        RS_DEBUG->print("QC_ApplicationWindow::slotHelpAbout()");
-
-       QString edition;
-
-#ifdef RS_DEMO
-       //demo; // = " [Demo]";
-#else
-#ifdef RS_PROF
-       edition = " [Professional]";
-#else
-       edition = " [Community Edition]";
-#endif
-#endif
-
        QStringList modules;
 
 #ifdef RS_CAM
@@ -3003,7 +2989,6 @@ void QC_ApplicationWindow::slotHelpAbout()
                modulesString = tr("None");
 
        QMessageBox box(this);
-//     box.setCaption(tr("About..."));
        box.setWindowTitle(tr("About..."));
        box.setText(QString("<qt>") +  // no center for main stream QCad
 #ifdef QC_ABOUT_HEADER
@@ -3013,16 +2998,14 @@ void QC_ApplicationWindow::slotHelpAbout()
 //FAIL                       "<h2>"+ QC_APPNAME+ "</h2>" +
                "<h2>Architektonas</h2>" +
 #endif
-               tr("Version: %1 %2").arg(QC_VERSION).arg(edition) + "<br>" +
+               tr("Version: %1").arg("1.0.0") + "<br>" +
                tr("Date: %1").arg(__DATE__) + "<br>" +
-               QString("(c) 2001-2005 by RibbonSoft,<br> Andrew Mustun") +
-               "<br>" +
-               tr("Modules: %1").arg(modulesString) + "<br>" +
-               QString("http://www.ribbonsoft.com")
+               QString("&copy; 2010 Underground Software,<br>James Hammons") +
+               "<br>"
 #ifdef QC_ABOUT_ADD_COMPANY
                + QString("<br>") + QC_ABOUT_ADD_COMPANY
-               + QString("</center>")
 #endif
+               + QString("</center>")
                );
 #ifndef QC_ABOUT_HEADER
 #warning "Failure..."
index 24dc78066d077949631111feb1d373ae1e23cc45..c80ab1fad59d8b89e035cbd21b679512a4765711 100644 (file)
@@ -89,7 +89,7 @@ class QC_ApplicationWindow: public QMainWindow, public QG_MainWindowInterface
                /**
                * opens the given file.
                */
-               void slotFileOpen(const QString& fileName, RS2::FormatType type);
+               void slotFileOpen(const QString & fileName, RS2::FormatType type);
                /** saves a document */
                void slotFileSave();
                /** saves a document under a different filename*/
index 414d31d012653d1978af83b05e802d98496e77ed..8a6c79ac86682231c01d399b098db4d002b66151 100644 (file)
@@ -16,7 +16,8 @@
 
 #include "qc_applicationwindow.h"
 
-QC_DialogFactory::QC_DialogFactory(QWidget * parent, QWidget * ow): QG_DialogFactory(parent, ow)
+//QC_DialogFactory::QC_DialogFactory(QWidget * parent, QWidget * ow): QG_DialogFactory(parent, ow)
+QC_DialogFactory::QC_DialogFactory(QWidget * parent, QToolBar * ow): QG_DialogFactory(parent, ow)
 {
 }
 
index b5f456e30bb5c883efffa99ee91f6e8dcc9fb531..3ddd8d9358871c4c16f97aef6ae0be339337c930 100644 (file)
@@ -12,7 +12,8 @@
 class QC_DialogFactory: public QG_DialogFactory
 {
        public:
-               QC_DialogFactory(QWidget * parent, QWidget * ow);
+//             QC_DialogFactory(QWidget * parent, QWidget * ow);
+               QC_DialogFactory(QWidget * parent, QToolBar * ow);
                virtual ~QC_DialogFactory();
 
                virtual void requestEditBlockWindow(RS_BlockList * blockList = NULL);
index 11d4b3f3440cc8799327ce12f631c406483a033e..5e8627942363e2ff1b1bd4eab3e977331d3265a0 100644 (file)
@@ -185,10 +185,10 @@ RS_ActionInterface * QG_ActionHandler::getCurrentAction()
 {
        RS_GraphicView * gv = mainWindow->getGraphicView();
 
-       if (gv != NULL)
+       if (gv)
                return gv->getCurrentAction();
-       else
-               return NULL;
+
+       return NULL;
 }
 
 #if 0
@@ -214,6 +214,12 @@ Then you'd call it with:
 
 Hmmm.... We need gv & doc *before* we call this...
 
+What you'd do then is have the form of the thing worked ahead of time and the function
+itself would create the gv & doc. So for the EditUndo, we'd have:
+       FunctionCreateAction(bool);
+       FunctionCreateAction(void);
+
+Well... The problem is the action, they're all different...
 #endif
 
 /**
index 9b9cbb43791223b2fcbdde81c007c40e484d3b63..e5f67e08aa3dfb54a8c171d93dcf8024ac247fa3 100644 (file)
 
 #include "qg_blockwidget.h"
 
-/*#include "xpm/visibleblock.xpm"
-#include "xpm/hiddenblock.xpm"
-#include "xpm/blockadd.xpm"
-#include "xpm/blockremove.xpm"
-#include "xpm/blockedit.xpm"
-#include "xpm/blockattributes.xpm"
-#include "xpm/blockinsert.xpm"*/
-
 /**
  * Constructor.
  */
 QG_BlockWidget::QG_BlockWidget(QG_ActionHandler * ah, QWidget * parent, const char * name, Qt::WFlags f):
 //     QWidget(parent, name, f),
        QWidget(parent, f),
-//     pxmVisible(visibleblock_xpm),
-//     pxmHidden(hiddenblock_xpm),
-//     pxmAdd(blockadd_xpm),
-//     pxmRemove(blockremove_xpm),
-//     pxmAttributes(blockattributes_xpm),
-//     pxmEdit(blockedit_xpm),
-//     pxmInsert(blockinsert_xpm),
-//     pxmDefreezeAll(visibleblock_xpm),
-//     pxmFreezeAll(hiddenblock_xpm)
        pxmVisible(":/res/visibleblock.xpm"),
        pxmHidden(":/res/hiddenblock.xpm"),
        pxmAdd(":/res/blockadd.xpm"),
index f698cdb363eb8c51ee613894c441f844d6ba4f5b..632ce8dc174b21c78bfe7e92a1b79b77c58db9ea 100644 (file)
 #include "rs_text.h"
 
 #if 0
-#include "ui/qg_arcoptions.h"
-#include "ui/qg_arctangentialoptions.h"
-#include "ui/qg_beveloptions.h"
+       #include "ui/qg_arcoptions.h"
+       #include "ui/qg_arctangentialoptions.h"
+       #include "ui/qg_beveloptions.h"
        #include "ui/qg_blockdialog.h"
        #include "ui/qg_cadtoolbar.h"
-#include "ui/qg_circleoptions.h"
+       #include "ui/qg_circleoptions.h"
        #include "ui/qg_commandwidget.h"
        #include "ui/qg_coordinatewidget.h"
 #include "ui/qg_dimlinearoptions.h"
        #include "ui/qg_textoptions.h"
 #include "ui/qg_trimamountoptions.h"
 #endif
+#include "arcoptions.h"
+#include "arctangentialoptions.h"
+#include "beveloptions.h"
 #include "blockdialog.h"
 #include "cadtoolbar.h"
+#include "circleoptions.h"
 #include "commandwidget.h"
 #include "coordinatewidget.h"
 #include "dlgattributes.h"
  * @param parent Pointer to parent widget which can host dialogs.
  * @param ow Pointer to widget that can host option widgets.
  */
-QG_DialogFactory::QG_DialogFactory(QWidget * parent, QWidget * ow):
+//QG_DialogFactory::QG_DialogFactory(QWidget * parent, QWidget * ow):
+QG_DialogFactory::QG_DialogFactory(QWidget * parent, QToolBar * ow):
        RS_DialogFactoryInterface()
 {
        RS_DEBUG->print("QG_DialogFactory::QG_DialogFactory");
@@ -138,7 +143,8 @@ QG_DialogFactory::~QG_DialogFactory()
 /**
  * Links factory to a widget that can host tool options.
  */
-/*virtual*/ void QG_DialogFactory::setOptionWidget(QWidget * ow)
+///*virtual*/ void QG_DialogFactory::setOptionWidget(QWidget * ow)
+/*virtual*/ void QG_DialogFactory::setOptionWidget(QToolBar * ow)
 {
        RS_DEBUG->print("QG_DialogFactory::setOptionWidget");
        optionWidget = ow;
@@ -859,18 +865,19 @@ void QG_DialogFactory::requestPrintPreviewOptions(RS_ActionInterface * action, b
 {
        static PrintPreviewOptions * toolWidget = NULL;
 
-       if (optionWidget != NULL)
+       if (!optionWidget)
+               return;
+
+       if (toolWidget)
        {
-               if (toolWidget != NULL)
-               {
-                       delete toolWidget;
-                       toolWidget = NULL;
-               }
-               if (on && toolWidget == NULL)
-               {
-                       toolWidget = new PrintPreviewOptions(optionWidget);
-                       toolWidget->setAction(action, update);
-               }
+               delete toolWidget;
+               toolWidget = NULL;
+       }
+
+       if (on)
+       {
+               toolWidget = new PrintPreviewOptions(optionWidget);
+               toolWidget->setAction(action, update);
        }
 }
 
@@ -879,21 +886,29 @@ void QG_DialogFactory::requestPrintPreviewOptions(RS_ActionInterface * action, b
  */
 void QG_DialogFactory::requestLineOptions(RS_ActionInterface * action, bool on)
 {
+/*
+The way I see it, this is failure. We're constantly creating & deleting
+these objects all the time when we could create them once, and then reuse
+them over and over. May need to do some more refactoring based on this idea...
+*/
+       //ugh.
        static LineOptions * toolWidget = NULL;
 
-       if (optionWidget != NULL)
+       if (!optionWidget)
+               return;
+
+       // Get rid of the LineOptions object if it exists...
+       if (toolWidget)
        {
-               if (toolWidget != NULL)
-               {
-                       delete toolWidget;
-                       toolWidget = NULL;
-               }
+               delete toolWidget;
+               toolWidget = NULL;
+       }
 
-               if (on == true && toolWidget == NULL)
-               {
-                       toolWidget = new LineOptions(optionWidget);
-                       toolWidget->setAction(action);
-               }
+       // Create a new one for the passed in action
+       if (on)
+       {
+               toolWidget = new LineOptions(optionWidget);
+               toolWidget->setAction(action);
        }
 
        RS_DEBUG->print("QG_DialogFactory::requestLineOptions: OK");
@@ -1065,68 +1080,6 @@ void QG_DialogFactory::requestLinePolygon2Options(RS_ActionInterface* action,
     }
 }
 
-/**
- * Shows a widget for arc options.
- */
-void QG_DialogFactory::requestArcOptions(RS_ActionInterface* action,
-        bool on, bool update)
-{
-    static QG_ArcOptions* toolWidget = NULL;
-
-    if (optionWidget!=NULL) {
-        if (toolWidget!=NULL) {
-            delete toolWidget;
-            toolWidget = NULL;
-        }
-        if (on==true && toolWidget==NULL) {
-            toolWidget = new QG_ArcOptions(optionWidget);
-            toolWidget->setAction(action, update);
-            //toolWidget->setData(&data);
-        }
-    }
-}
-
-/**
- * Shows a widget for tangential arc options.
- */
-void QG_DialogFactory::requestArcTangentialOptions(RS_ActionInterface* action,
-        bool on, bool update)
-{
-    static QG_ArcTangentialOptions* toolWidget = NULL;
-
-    if (optionWidget!=NULL) {
-        if (toolWidget!=NULL) {
-            delete toolWidget;
-            toolWidget = NULL;
-        }
-        if (on==true && toolWidget==NULL) {
-            toolWidget = new QG_ArcTangentialOptions(optionWidget);
-            toolWidget->setAction(action, update);
-            //toolWidget->setData(&data);
-        }
-    }
-}
-
-/**
- * Shows a widget for arc options.
- */
-void QG_DialogFactory::requestCircleOptions(RS_ActionInterface* action,
-        bool on, bool update)
-{
-    static QG_CircleOptions* toolWidget = NULL;
-
-    if (optionWidget!=NULL) {
-        if (toolWidget!=NULL) {
-            delete toolWidget;
-            toolWidget = NULL;
-        }
-        if (on==true && toolWidget==NULL) {
-            toolWidget = new QG_CircleOptions(optionWidget);
-            toolWidget->setAction(action, update);
-        }
-    }
-}
-
 /**
  * Shows a widget for spline options.
  */
@@ -1147,26 +1100,6 @@ void QG_DialogFactory::requestSplineOptions(RS_ActionInterface* action,
     }
 }
 
-/**
- * Shows a widget for text options.
- */
-void QG_DialogFactory::requestTextOptions(RS_ActionInterface* action,
-        bool on, bool update)
-{
-    static QG_TextOptions* toolWidget = NULL;
-
-    if (optionWidget!=NULL) {
-        if (toolWidget!=NULL) {
-            delete toolWidget;
-            toolWidget = NULL;
-        }
-        if (on==true && toolWidget==NULL) {
-            toolWidget = new QG_TextOptions(optionWidget);
-            toolWidget->setAction(action, update);
-        }
-    }
-}
-
 /**
  * Shows a widget for insert options.
  */
@@ -1308,26 +1241,6 @@ void QG_DialogFactory::requestTrimAmountOptions(RS_ActionInterface* action,
     }
 }
 
-/**
- * Shows a widget for beveling options.
- */
-void QG_DialogFactory::requestBevelOptions(RS_ActionInterface* action,
-        bool on, bool update)
-{
-    static QG_BevelOptions* toolWidget = NULL;
-
-    if (optionWidget!=NULL) {
-        if (toolWidget!=NULL) {
-            delete toolWidget;
-            toolWidget = NULL;
-        }
-        if (on==true && toolWidget==NULL) {
-            toolWidget = new QG_BevelOptions(optionWidget);
-            toolWidget->setAction(action, update);
-        }
-    }
-}
-
 /**
  * Shows a widget for rounding options.
  */
@@ -1396,16 +1309,75 @@ void QG_DialogFactory::requestLinePolygon2Options(RS_ActionInterface* action, bo
 {
 }
 
-void QG_DialogFactory::requestArcOptions(RS_ActionInterface* action, bool on, bool update)
+/**
+ * Shows a widget for arc options.
+ */
+void QG_DialogFactory::requestArcOptions(RS_ActionInterface * action, bool on, bool update)
 {
+       static ArcOptions * toolWidget = NULL;
+
+       if (optionWidget != NULL)
+       {
+               if (toolWidget != NULL)
+               {
+                       delete toolWidget;
+                       toolWidget = NULL;
+               }
+
+               if (on && toolWidget == NULL)
+               {
+                       toolWidget = new ArcOptions(optionWidget);
+                       toolWidget->setAction(action, update);
+                       //toolWidget->setData(&data);
+               }
+       }
 }
 
-void QG_DialogFactory::requestArcTangentialOptions(RS_ActionInterface* action, bool on, bool update)
+/**
+ * Shows a widget for tangential arc options.
+ */
+void QG_DialogFactory::requestArcTangentialOptions(RS_ActionInterface * action, bool on, bool update)
 {
+       static ArcTangentialOptions * toolWidget = NULL;
+
+       if (!optionWidget)
+               return;
+
+       if (toolWidget)
+       {
+               delete toolWidget;
+               toolWidget = NULL;
+       }
+
+       if (on)
+       {
+               toolWidget = new ArcTangentialOptions(optionWidget);
+               toolWidget->setAction(action, update);
+               //toolWidget->setData(&data);
+       }
 }
 
-void QG_DialogFactory::requestCircleOptions(RS_ActionInterface* action, bool on, bool update)
+/**
+ * Shows a widget for circle options.
+ */
+void QG_DialogFactory::requestCircleOptions(RS_ActionInterface * action, bool on, bool update)
 {
+    static CircleOptions * toolWidget = NULL;
+
+    if (optionWidget)
+       {
+        if (toolWidget)
+               {
+            delete toolWidget;
+            toolWidget = NULL;
+        }
+
+        if (on && toolWidget == NULL)
+               {
+            toolWidget = new CircleOptions(optionWidget);
+            toolWidget->setAction(action, update);
+        }
+    }
 }
 
 void QG_DialogFactory::requestSplineOptions(RS_ActionInterface* action, bool on, bool update)
@@ -1419,19 +1391,19 @@ void QG_DialogFactory::requestTextOptions(RS_ActionInterface * action, bool on,
 {
        static TextOptions * toolWidget = NULL;
 
-       if (optionWidget != NULL)
+       if (!optionWidget)
+               return;
+
+       if (toolWidget)
        {
-               if (toolWidget != NULL)
-               {
-                       delete toolWidget;
-                       toolWidget = NULL;
-               }
+               delete toolWidget;
+               toolWidget = NULL;
+       }
 
-               if (on == true && toolWidget == NULL)
-               {
-                       toolWidget = new TextOptions(optionWidget);
-                       toolWidget->setAction(action, update);
-               }
+       if (on)
+       {
+               toolWidget = new TextOptions(optionWidget);
+               toolWidget->setAction(action, update);
        }
 }
 
@@ -1463,8 +1435,27 @@ void QG_DialogFactory::requestTrimAmountOptions(RS_ActionInterface* action, bool
 {
 }
 
-void QG_DialogFactory::requestBevelOptions(RS_ActionInterface* action, bool on, bool update)
+/**
+ * Shows a widget for beveling options.
+ */
+void QG_DialogFactory::requestBevelOptions(RS_ActionInterface * action, bool on, bool update)
 {
+    static BevelOptions * toolWidget = NULL;
+
+    if (optionWidget != NULL)
+       {
+        if (toolWidget != NULL)
+               {
+            delete toolWidget;
+            toolWidget = NULL;
+        }
+
+               if (on && toolWidget == NULL)
+               {
+            toolWidget = new BevelOptions(optionWidget);
+            toolWidget->setAction(action, update);
+        }
+    }
 }
 
 void QG_DialogFactory::requestRoundOptions(RS_ActionInterface* action, bool on, bool update)
index aee54b575fa2a59e133088a771e699ebeb216094..d901cd7e07ab0cca17255254704cfbf03d50e6d5 100644 (file)
@@ -24,11 +24,13 @@ class RS_Document;
 class QG_DialogFactory: public RS_DialogFactoryInterface
 {
        public:
-               QG_DialogFactory(QWidget * parent, QWidget * ow);
+//             QG_DialogFactory(QWidget * parent, QWidget * ow);
+               QG_DialogFactory(QWidget * parent, QToolBar * ow);
                virtual ~QG_DialogFactory();
 
        protected:
-               virtual void setOptionWidget(QWidget * ow);
+//             virtual void setOptionWidget(QWidget * ow);
+               virtual void setOptionWidget(QToolBar * ow);
 
        public:
                virtual void setCoordinateWidget(CoordinateWidget * cw);
@@ -127,7 +129,9 @@ class QG_DialogFactory: public RS_DialogFactoryInterface
                //! Pointer to the widget which can host dialogs
                QWidget * parent;
                //! Pointer to the widget which can host individual tool options
-               QWidget * optionWidget;
+//[DONE]#warning "!!! Need to change optionWidget from class QWidget to QToolBar !!!"
+//             QWidget * optionWidget;
+               QToolBar * optionWidget;
                //! Pointer to the coordinate widget.
                CoordinateWidget * coordinateWidget;
                //! Pointer to the mouse widget.
index c26d8af1710d6aca3b10245762dd301d2bad8884..0ecf4805625db33dabb42ee0fbc899c4a1a41699 100644 (file)
@@ -19,6 +19,9 @@
 #include "rs_actionzoomscroll.h"
 #include "rs_actionmodifydelete.h"
 #include "rs_actionselectsingle.h"
+#include "rs_dialogfactory.h"
+#include "rs_graphicview.h"
+#include "rs_preview.h"
 #include "drawing.h"
 #include "settings.h"
 #include "rs_system.h"