X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fwidgets%2Fcolorbox.cpp;h=f1377b83c31d7f1c247ee41a96617e325e7f3f0b;hb=2ee84c5948ede7fc2f7b4435c5edef42a030ac05;hp=38a77805ce2954b67604597e6a65e6198015a425;hpb=e5a77a32dbe17d9534d3099f1fd3fdacba199516;p=architektonas diff --git a/src/widgets/colorbox.cpp b/src/widgets/colorbox.cpp index 38a7780..f1377b8 100644 --- a/src/widgets/colorbox.cpp +++ b/src/widgets/colorbox.cpp @@ -16,13 +16,13 @@ #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;