]> Shamusworld >> Repos - architektonas/blobdiff - src/widgets/colorbox.cpp
Fixed hatch dialog, added snap/preview to circle tools.
[architektonas] / src / widgets / colorbox.cpp
index 38a77805ce2954b67604597e6a65e6198015a425..f1377b83c31d7f1c247ee41a96617e325e7f3f0b 100644 (file)
 
 #include "colorbox.h"
 
-#include "rs.h"
+#include "enums.h"
 
 /**
  * Default Constructor. You must call init manually if you choose
  * to use this constructor.
  */
-QG_ColorBox::QG_ColorBox(QWidget * parent/*= 0*/, const char */*name = 0*/):
+ColorBox::ColorBox(QWidget * parent/*= 0*/, const char */*name = 0*/):
        QComboBox(parent)
 {
        showByLayer = false;
@@ -36,7 +36,7 @@ QG_ColorBox::QG_ColorBox(QWidget * parent/*= 0*/, const char */*name = 0*/):
  *
  * @param showByLayer true: Show attribute ByLayer, ByBlock.
  */
-QG_ColorBox::QG_ColorBox(bool showByLayer, bool showUnchanged, QWidget * parent/*= 0*/,
+ColorBox::ColorBox(bool showByLayer, bool showUnchanged, QWidget * parent/*= 0*/,
        const char */*name = 0*/): QComboBox(parent)
 {
        unchanged = false;
@@ -46,11 +46,11 @@ QG_ColorBox::QG_ColorBox(bool showByLayer, bool showUnchanged, QWidget * parent/
 /**
  * Destructor
  */
-QG_ColorBox::~QG_ColorBox()
+ColorBox::~ColorBox()
 {
 }
 
-RS_Color QG_ColorBox::getColor()
+Color ColorBox::getColor()
 {
        return currentColor;
 }
@@ -61,7 +61,7 @@ RS_Color QG_ColorBox::getColor()
  *
  * @param showByLayer true: Show attribute ByLayer, ByBlock.
  */
-void QG_ColorBox::init(bool showByLayer, bool showUnchanged)
+void ColorBox::init(bool showByLayer, bool showUnchanged)
 {
        this->showByLayer = showByLayer;
        this->showUnchanged = showUnchanged;
@@ -111,7 +111,7 @@ void QG_ColorBox::init(bool showByLayer, bool showUnchanged)
        slotColorChanged(currentIndex());
 }
 
-bool QG_ColorBox::isUnchanged()
+bool ColorBox::isUnchanged()
 {
        return unchanged;
 }
@@ -119,13 +119,13 @@ bool QG_ColorBox::isUnchanged()
 /**
  * Sets the color shown in the combobox to the given color.
  */
-void QG_ColorBox::setColor(const RS_Color & color)
+void ColorBox::setColor(const Color & color)
 {
 //#warning "!!! Color is being misreported here !!!"
 /*
-And fuck. Probably because the operator== in RS_Color doesn't know how to
+And fuck. Probably because the operator== in Color doesn't know how to
 convert between Qt:: style colors and RGB. Either way, have to fix this shit
-Look at Red: Have to convert them all to RS_Color...
+Look at Red: Have to convert them all to Color...
 */
        currentColor = color;
 
@@ -133,24 +133,24 @@ Look at Red: Have to convert them all to RS_Color...
                setCurrentIndex(0);
        else if (color.isByBlock() && showByLayer)
                setCurrentIndex(1);
-       else if (color == RS_Color(255, 0, 0))          //Qt::red)
+       else if (color == Color(255, 0, 0))             //Qt::red)
                setCurrentIndex(0 + (int)showByLayer * 2 + (int)showUnchanged);
-       else if (color == RS_Color(255, 255, 0))        //Qt::yellow)
+       else if (color == Color(255, 255, 0))   //Qt::yellow)
                setCurrentIndex(1 + (int)showByLayer * 2 + (int)showUnchanged);
-       else if (color == RS_Color(0, 255, 0))          //Qt::green)
+       else if (color == Color(0, 255, 0))             //Qt::green)
                setCurrentIndex(2 + (int)showByLayer * 2 + (int)showUnchanged);
-       else if (color == RS_Color(0, 255, 255))        //Qt::cyan)
+       else if (color == Color(0, 255, 255))   //Qt::cyan)
                setCurrentIndex(3 + (int)showByLayer * 2 + (int)showUnchanged);
-       else if (color == RS_Color(0, 0, 255))          //Qt::blue)
+       else if (color == Color(0, 0, 255))             //Qt::blue)
                setCurrentIndex(4 + (int)showByLayer * 2 + (int)showUnchanged);
-       else if (color == RS_Color(255, 0, 255))        //Qt::magenta)
+       else if (color == Color(255, 0, 255))   //Qt::magenta)
                setCurrentIndex(5 + (int)showByLayer * 2 + (int)showUnchanged);
 //     else if (color == Qt::white || color == Qt::black)
-       else if (color == RS_Color(255, 255, 255) || color == RS_Color(0, 0, 0))
+       else if (color == Color(255, 255, 255) || color == Color(0, 0, 0))
                setCurrentIndex(6 + (int)showByLayer * 2 + (int)showUnchanged);
-       else if (color == RS_Color(127, 127, 127))      //Qt::gray)
+       else if (color == Color(127, 127, 127)) //Qt::gray)
                setCurrentIndex(7 + (int)showByLayer * 2 + (int)showUnchanged);
-       else if (color == RS_Color(191, 191, 191))
+       else if (color == Color(191, 191, 191))
                setCurrentIndex(8 + (int)showByLayer * 2 + (int)showUnchanged);
        else
                setCurrentIndex(9 + (int)showByLayer * 2 + (int)showUnchanged);
@@ -163,7 +163,7 @@ Look at Red: Have to convert them all to RS_Color...
  * Sets the color of the pixmap next to the "By Layer" item
  * to the given color.
  */
-void QG_ColorBox::setLayerColor(const RS_Color & color)
+void ColorBox::setLayerColor(const Color & color)
 {
        if (showByLayer)
        {
@@ -200,7 +200,7 @@ void QG_ColorBox::setLayerColor(const RS_Color & color)
  * offers a dialog to the user that allows him/ her to
  * choose an individual color.
  */
-void QG_ColorBox::slotColorChanged(int index)
+void ColorBox::slotColorChanged(int index)
 {
        currentColor.resetFlags();
 
@@ -217,10 +217,10 @@ void QG_ColorBox::slotColorChanged(int index)
                switch (index - (int)showUnchanged)
                {
                case 0:
-                       currentColor = RS_Color(RS2::FlagByLayer);
+                       currentColor = Color(RS2::FlagByLayer);
                        break;
                case 1:
-                       currentColor = RS_Color(RS2::FlagByBlock);
+                       currentColor = Color(RS2::FlagByBlock);
                        break;
                default:
                        break;