#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;
*
* @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;
/**
* Destructor
*/
-QG_ColorBox::~QG_ColorBox()
+ColorBox::~ColorBox()
{
}
-RS_Color QG_ColorBox::getColor()
+Color ColorBox::getColor()
{
return currentColor;
}
*
* @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;
slotColorChanged(currentIndex());
}
-bool QG_ColorBox::isUnchanged()
+bool ColorBox::isUnchanged()
{
return unchanged;
}
/**
* 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;
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);
* 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)
{
* 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();
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;