Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Public Member Functions | Private Slots | Private Member Functions | Private Attributes
CWDialog Class Reference

GUI dialog for Color Wheel Plugin. More...

#include <cwdialog.h>

List of all members.

Public Member Functions

 CWDialog (QWidget *parent=0, ScribusDoc *doc=0, const char *name=0, bool modal=FALSE, WFlags fl=0)
 ~CWDialog ()

Private Slots

void colorspaceTab_currentChanged (QWidget *)
void angleSpin_valueChanged (int)
void colorWheel_clicked (int, const QPoint &)
void typeCombo_activated (int)
void documentColorList_currentChanged (QListBoxItem *)
void defectCombo_activated (int)
void addButton_clicked ()
void replaceButton_clicked ()
void cancelButton_clicked ()
void colorList_currentChanged (QListBoxItem *)
void cSpin_valueChanged (int)
void mSpin_valueChanged (int)
void ySpin_valueChanged (int)
void kSpin_valueChanged (int)
void rSpin_valueChanged (int)
void gSpin_valueChanged (int)
void bSpin_valueChanged (int)
void hSpin_valueChanged (int)
void sSpin_valueChanged (int)
void vSpin_valueChanged (int)

Private Member Functions

void setPreview ()
 Draws a strange colorful things as preview of the color schema.
QColor computeDefect (QColor c)
 Main color manipulator for preview.
void fillColorList ()
 It fills colors into list view.
void setupColorComponents ()
 Set the spins with its color component value.
void setupRGBComponent (ScColor col)
 A GUI setter for all components when is one of CMYK changed.
void setupCMYKComponent (ScColor col)
 A GUI setter for all components when is one of RGB changed.
void setupHSVComponent (ScColor col)
 A GUI setter for all components when is one of HSV changed.
void updateNamedLabels ()
 Set named colors for labels.
void connectSlots (bool conn=true)
 Connect or disconnect rgbcmyk spinboxes signals.
void processColors (int index, bool updateSpins=true)
 Call main color calculation.
QString getHexHsv (ScColor c)
 Get a #hhssvv string for given ScColor.

Private Attributes

PrefsContext * prefs
 Configuration structure.
ScribusDoc * m_Doc
 a parent doc reference

Detailed Description

GUI dialog for Color Wheel Plugin.

Quite everything in this class is self explanatory (except few things ;)).

Author:
Petr Vanek petr@.nosp@m.scri.nosp@m.bus.i.nosp@m.nfo
Date:
April 2005

Definition at line 39 of file cwdialog.h.


Constructor & Destructor Documentation

CWDialog::CWDialog ( QWidget *  parent = 0,
ScribusDoc *  doc = 0,
const char *  name = 0,
bool  modal = FALSE,
WFlags  fl = 0 
)

Definition at line 38 of file cwdialog.cpp.

       : CWDialogBase (parent, name, modal, fl),
         m_Doc(doc)
{
       int h, s, v;
       ScColor color;
       QString colorName;
       connectSlots(false);
       // setup combobox
       typeCombo->insertItem(colorWheel->getTypeDescription(colorWheel->Monochromatic), colorWheel->Monochromatic);
       typeCombo->insertItem(colorWheel->getTypeDescription(colorWheel->Analogous), colorWheel->Analogous);
       typeCombo->insertItem(colorWheel->getTypeDescription(colorWheel->Complementary), colorWheel->Complementary);
       typeCombo->insertItem(colorWheel->getTypeDescription(colorWheel->Split), colorWheel->Split);
       typeCombo->insertItem(colorWheel->getTypeDescription(colorWheel->Triadic), colorWheel->Triadic);
       typeCombo->insertItem(colorWheel->getTypeDescription(colorWheel->Tetradic), colorWheel->Tetradic);
       // defects
       defectCombo->insertItem(CommonStrings::trVisionNormal);
       defectCombo->insertItem(CommonStrings::trVisionProtanopia);
       defectCombo->insertItem(CommonStrings::trVisionDeuteranopia);
       defectCombo->insertItem(CommonStrings::trVisionTritanopia);
       defectCombo->insertItem(CommonStrings::trVisionFullColorBlind);
       // document colors
       documentColorList->updateBox(m_Doc->PageColors, ColorListBox::fancyPixmap);
       // preferences
       prefs = PrefsManager::instance()->prefsFile->getPluginContext("colorwheel");
       typeCombo->setCurrentItem(prefs->getInt("cw_type", 0));
       angleSpin->setValue(prefs->getInt("cw_angle", 15));
       colorWheel->currentDoc = m_Doc;
       colorWheel->angle = angleSpin->value();
       colorWheel->baseAngle = prefs->getInt("cw_baseangle", 0);
       colorspaceTab->setCurrentPage(prefs->getInt("cw_space", 0));
       color.setNamedColor(prefs->get("cw_color", "#00000000"));
       // Handle color previously selected in the document tab
       if (colorspaceTab->currentPage() == tabDocument)
       {
              colorName = prefs->get("cw_colorname", "");
              if (!colorName.isEmpty() && m_Doc->PageColors.contains(colorName))
                     color = m_Doc->PageColors[colorName];
              else
                     color.setColorRGB(0, 0, 0); //Trigger use of defaults
       }
       // Handle achromatic colors
       QColor rgb = ScColorEngine::getRGBColor(color, m_Doc);
       rgb.getHsv(&h, &s, &v);
       if (h == -1)
       {   // Reset to defaults
              colorWheel->baseAngle = 0;
              colorWheel->currentColorSpace = colorModelCMYK;
              colorWheel->actualColor = colorWheel->colorByAngle(0);
              colorspaceTab->setCurrentPage(0);
       }
       else if (colorspaceTab->currentPage() == tabDocument)
       {
              colorWheel->actualColor = color;
              documentColorList->setCurrentItem(documentColorList->findItem(colorName));
       }
       else
              colorWheel->actualColor = color;

       resize(QSize(prefs->getInt("cw_width", 640),
                 prefs->getInt("cw_height", 480)).expandedTo(minimumSizeHint()));
       previewLabel->resize(prefs->getInt("cw_samplex", 300), prefs->getInt("cw_sampley", 100));
              
       // setup
       colorspaceTab_currentChanged(colorspaceTab->currentPage());
       currentColorTable->horizontalHeader()->hide();
       currentColorTable->setTopMargin(0);
       currentColorTable->setNumCols(5);

       // signals and slots that cannot be in ui file
       connect(colorWheel, SIGNAL(clicked(int, const QPoint&)),
                     this, SLOT(colorWheel_clicked(int, const QPoint&)));
       connect(documentColorList, SIGNAL(currentChanged(QListBoxItem *)),
                     this, SLOT(documentColorList_currentChanged(QListBoxItem *)));
       connect(colorList, SIGNAL(currentChanged(QListBoxItem *)),
                     this, SLOT(colorList_currentChanged(QListBoxItem *)));
       connectSlots(true);
}

Here is the call graph for this function:

Definition at line 117 of file cwdialog.cpp.

{
       // preferences
       QString colorName = (colorspaceTab->currentPage() == tabDocument) ? documentColorList->currentText() : "";
       prefs->set("cw_type", typeCombo->currentItem());
       prefs->set("cw_angle", angleSpin->value());
       prefs->set("cw_baseangle", colorWheel->baseAngle);
       prefs->set("cw_color", colorWheel->actualColor.name());
       prefs->set("cw_colorname", colorName);
       prefs->set("cw_space", colorspaceTab->currentPageIndex());
       // GUI settings
       prefs->set("cw_width", width());
       prefs->set("cw_height", height());
       prefs->set("cw_samplex", previewLabel->width());
       prefs->set("cw_sampley", previewLabel->height());
}

Member Function Documentation

void CWDialog::addButton_clicked ( ) [private, slot]

Definition at line 308 of file cwdialog.cpp.

{
       QString status("<qt><h2>" + tr("Merging colors") + "</h2><p>");
       bool err = false;
       for (ColorList::iterator it = colorWheel->colorList.begin(); it != colorWheel->colorList.end(); ++it)
       {
              if (m_Doc->PageColors.contains(it.key()))
              {
                     status += "<b>" + tr("Error: ") + "</b>" + tr("Color %1 exists already!").arg(it.key()) + "<br/>";
                     err = true;
              }
              else
              {
                     status += tr("Color %1 appended.").arg(it.key()) + "<br/>";
                     m_Doc->PageColors[it.key()] = it.data();
              }
       }
       status += "<p>" + tr("Now opening the color manager.") + "</p></qt>";
       if (err)
       {
              QMessageBox::information(this, tr("Color Merging"), status);
              m_Doc->scMW()->slotEditColors();
              return;
       }
       m_Doc->scMW()->propertiesPalette->updateColorList();
       accept();
}

Here is the call graph for this function:

void CWDialog::angleSpin_valueChanged ( int  value) [private, slot]

Definition at line 238 of file cwdialog.cpp.

{
       colorWheel->angle = value;
       processColors(typeCombo->currentItem(), false);
}

Here is the call graph for this function:

void CWDialog::bSpin_valueChanged ( int  ) [private, slot]

Definition at line 381 of file cwdialog.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void CWDialog::cancelButton_clicked ( ) [private, slot]

Definition at line 346 of file cwdialog.cpp.

{
       reject();
}
void CWDialog::colorList_currentChanged ( QListBoxItem item) [private, slot]

Definition at line 494 of file cwdialog.cpp.

{
       if (!item)
              return;

       // if it's base color we do not need to recompute it again
       if (item->text() == colorWheel->trBaseColor)
       {
              currentColorTable->setText(0, 4, cmykLabel->text());
              currentColorTable->setText(1, 4, rgbLabel->text());
              currentColorTable->setText(2, 4, hsvLabel->text());
              currentColorTable->setText(0, 0, cSpin->text());
              currentColorTable->setText(0, 1, mSpin->text());
              currentColorTable->setText(0, 2, ySpin->text());
              currentColorTable->setText(0, 3, kSpin->text());
              currentColorTable->setText(1, 0, rSpin->text());
              currentColorTable->setText(1, 1, gSpin->text());
              currentColorTable->setText(1, 2, bSpin->text());
              currentColorTable->setText(2, 0, hSpin->text());
              currentColorTable->setText(2, 1, sSpin->text());
              currentColorTable->setText(2, 2, vSpin->text());

       }
       else
       {
              ScColor col(colorWheel->colorList[item->text()]);
              currentColorTable->setText(0, 4, col.nameCMYK(m_Doc));
              currentColorTable->setText(1, 4, col.nameRGB(m_Doc));
              currentColorTable->setText(2, 4, getHexHsv(col));
              // components
              QString num;
              CMYKColor cmyk;
              ScColorEngine::getCMYKValues(col, m_Doc, cmyk);
              currentColorTable->setText(0, 0, num.setNum(cmyk.c));
              currentColorTable->setText(0, 1, num.setNum(cmyk.m));
              currentColorTable->setText(0, 2, num.setNum(cmyk.y));
              currentColorTable->setText(0, 3, num.setNum(cmyk.k));
              RGBColor rgb;
              ScColorEngine::getRGBValues(col, m_Doc, rgb);
              currentColorTable->setText(1, 0, num.setNum(rgb.r));
              currentColorTable->setText(1, 1, num.setNum(rgb.g));
              currentColorTable->setText(1, 2, num.setNum(rgb.b));
              int h, s, v;
              QColor hsvCol(ScColorEngine::getRGBColor(col, m_Doc));
              hsvCol.getHsv(&h, &s, &v);
              currentColorTable->setText(2, 0, num.setNum(h));
              currentColorTable->setText(2, 1, num.setNum(s));
              currentColorTable->setText(2, 2, num.setNum(v));
       }
       currentColorTable->adjustColumn(0);
       currentColorTable->adjustColumn(1);
       currentColorTable->adjustColumn(2);
       currentColorTable->adjustColumn(3);
       currentColorTable->adjustColumn(4);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void CWDialog::colorspaceTab_currentChanged ( QWidget *  tab) [private, slot]

Definition at line 173 of file cwdialog.cpp.

{
       if (tab == tabCMYK)
              colorWheel->currentColorSpace = colorModelCMYK;
       if (tab == tabRGB)
              colorWheel->currentColorSpace = colorModelRGB;
       if (tab == tabDocument)
       {
              if (documentColorList->currentItem() == -1)
                     documentColorList->setSelected(0, true);
              documentColorList_currentChanged(documentColorList->item(documentColorList->currentItem()));
       }
       processColors(typeCombo->currentItem(), true);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void CWDialog::colorWheel_clicked ( int  ,
const QPoint &   
) [private, slot]

Definition at line 233 of file cwdialog.cpp.

{
       processColors(typeCombo->currentItem(), true);
}

Here is the call graph for this function:

Here is the caller graph for this function:

QColor CWDialog::computeDefect ( QColor  c) [private]

Main color manipulator for preview.

It calls transformations for the other vision defects filters.

Parameters:
cinput color. QColor from sample list.
Return values:
QColorIt returns c for chosen defect filter.

Definition at line 278 of file cwdialog.cpp.

{
       if (defectCombo->currentItem() == VisionDefectColor::normalVision)
              return c;
       VisionDefectColor *defect = new VisionDefectColor(c);
       defect->deficiency = defectCombo->currentItem();
       defect->convertDefect();
       QColor nc = defect->getColor();
       delete defect;
       return nc;
}

Here is the caller graph for this function:

void CWDialog::connectSlots ( bool  conn = true) [private]

Connect or disconnect rgbcmyk spinboxes signals.

Parameters:
connif true perform connect. Disconnect in the case of false

Definition at line 134 of file cwdialog.cpp.

{
       if (conn)
       {
              connect( cSpin, SIGNAL( valueChanged(int) ), this, SLOT( cSpin_valueChanged(int) ) );
              connect( mSpin, SIGNAL( valueChanged(int) ), this, SLOT( mSpin_valueChanged(int) ) );
              connect( ySpin, SIGNAL( valueChanged(int) ), this, SLOT( ySpin_valueChanged(int) ) );
              connect( kSpin, SIGNAL( valueChanged(int) ), this, SLOT( kSpin_valueChanged(int) ) );
              connect( rSpin, SIGNAL( valueChanged(int) ), this, SLOT( rSpin_valueChanged(int) ) );
              connect( gSpin, SIGNAL( valueChanged(int) ), this, SLOT( gSpin_valueChanged(int) ) );
              connect( bSpin, SIGNAL( valueChanged(int) ), this, SLOT( bSpin_valueChanged(int) ) );
              connect( hSpin, SIGNAL( valueChanged(int) ), this, SLOT( hSpin_valueChanged(int) ) );
              connect( sSpin, SIGNAL( valueChanged(int) ), this, SLOT( sSpin_valueChanged(int) ) );
              connect( vSpin, SIGNAL( valueChanged(int) ), this, SLOT( vSpin_valueChanged(int) ) );
       }
       else
       {
              disconnect( cSpin, SIGNAL( valueChanged(int) ), this, SLOT( cSpin_valueChanged(int) ) );
              disconnect( mSpin, SIGNAL( valueChanged(int) ), this, SLOT( mSpin_valueChanged(int) ) );
              disconnect( ySpin, SIGNAL( valueChanged(int) ), this, SLOT( ySpin_valueChanged(int) ) );
              disconnect( kSpin, SIGNAL( valueChanged(int) ), this, SLOT( kSpin_valueChanged(int) ) );
              disconnect( rSpin, SIGNAL( valueChanged(int) ), this, SLOT( rSpin_valueChanged(int) ) );
              disconnect( gSpin, SIGNAL( valueChanged(int) ), this, SLOT( gSpin_valueChanged(int) ) );
              disconnect( bSpin, SIGNAL( valueChanged(int) ), this, SLOT( bSpin_valueChanged(int) ) );
              disconnect( hSpin, SIGNAL( valueChanged(int) ), this, SLOT( hSpin_valueChanged(int) ) );
              disconnect( sSpin, SIGNAL( valueChanged(int) ), this, SLOT( sSpin_valueChanged(int) ) );
              disconnect( vSpin, SIGNAL( valueChanged(int) ), this, SLOT( vSpin_valueChanged(int) ) );
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void CWDialog::cSpin_valueChanged ( int  ) [private, slot]

Definition at line 351 of file cwdialog.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void CWDialog::defectCombo_activated ( int  ) [private, slot]

Definition at line 303 of file cwdialog.cpp.

{
       setPreview();
}

Here is the call graph for this function:

void CWDialog::documentColorList_currentChanged ( QListBoxItem item) [private, slot]

Definition at line 164 of file cwdialog.cpp.

{
       if (!item)
              return;
       ScColor c(m_Doc->PageColors[documentColorList->currentText()]);
       colorWheel->currentColorSpace = c.getColorModel();
       setupColorComponents();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void CWDialog::fillColorList ( ) [private]

It fills colors into list view.

It takes colors from ColorWheel widget.

Definition at line 290 of file cwdialog.cpp.

{
       uint ix = colorList->currentItem();
       colorList->updateBox(colorWheel->colorList, ColorListBox::fancyPixmap);
       QListBoxItem *item = colorList->findItem(colorWheel->trBaseColor);
       if (item->prev())
       {
              colorList->takeItem(item);
              colorList->insertItem(item, 0);
       }
       colorList->setCurrentItem(ix > colorList->count() ? 0 : ix);
}

Here is the caller graph for this function:

QString CWDialog::getHexHsv ( ScColor  c) [private]

Get a #hhssvv string for given ScColor.

Definition at line 550 of file cwdialog.cpp.

{
       int h, s, v;
       QColor hsvCol(ScColorEngine::getRGBColor(c, m_Doc));
       hsvCol.getHsv(&h, &s, &v);
       return QString("#%1%2%3").arg(h, 0, 16).arg(s, 0, 16).arg(v, 0, 16);
}

Here is the caller graph for this function:

void CWDialog::gSpin_valueChanged ( int  ) [private, slot]

Definition at line 376 of file cwdialog.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void CWDialog::hSpin_valueChanged ( int  ) [private, slot]

Definition at line 386 of file cwdialog.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void CWDialog::kSpin_valueChanged ( int  ) [private, slot]

Definition at line 366 of file cwdialog.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void CWDialog::mSpin_valueChanged ( int  ) [private, slot]

Definition at line 356 of file cwdialog.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void CWDialog::processColors ( int  index,
bool  updateSpins = true 
) [private]

Call main color calculation.

It calls a ColorWheel methods to get requested harmonious colors depending on the dialog's settings.

Parameters:
indexan index of the typeCombo (Color Scheme Method)
updateSpinsif true call setupCMYKComponent() and setupRGBComponent() methods. if false don't reset any of these component spins - it's used for colorWheel mouse clicked/released events.

Definition at line 193 of file cwdialog.cpp.

{
       bool angEnable = false;
       //colorList->clear();
       if (index == colorWheel->Monochromatic)
              colorWheel->currentType = colorWheel->Monochromatic;
       if (index == colorWheel->Analogous)
       {
              angEnable = true;
              colorWheel->currentType = colorWheel->Analogous;
       }
       if (index == colorWheel->Complementary)
              colorWheel->currentType = colorWheel->Complementary;
       if (index == colorWheel->Split)
       {
              angEnable = true;
              colorWheel->currentType = colorWheel->Split;
       }
       if (index == colorWheel->Triadic)
              colorWheel->currentType = colorWheel->Triadic;
       if (index == colorWheel->Tetradic)
       {
              angEnable = true;
              colorWheel->currentType = colorWheel->Tetradic;
       }
       angleSpin->setEnabled(angEnable);
       angleLabel->setEnabled(angEnable);
       colorWheel->makeColors();
       fillColorList();
       setPreview();
       if (updateSpins)
       {
//            setupFromColor(colorWheel->actualColor);
              setupRGBComponent(colorWheel->actualColor);
              setupCMYKComponent(colorWheel->actualColor);
              setupHSVComponent(colorWheel->actualColor);
       }
       updateNamedLabels();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void CWDialog::replaceButton_clicked ( ) [private, slot]

Definition at line 336 of file cwdialog.cpp.

{
       for (ColorList::iterator it = colorWheel->colorList.begin(); it != colorWheel->colorList.end(); ++it)
       {
              m_Doc->PageColors[it.key()] = it.data();
       }
       m_Doc->scMW()->propertiesPalette->updateColorList();
       accept();
}
void CWDialog::rSpin_valueChanged ( int  ) [private, slot]

Definition at line 371 of file cwdialog.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void CWDialog::setPreview ( ) [private]

Draws a strange colorful things as preview of the color schema.

User can see what will see a person with selected kind of color blindness.

Definition at line 244 of file cwdialog.cpp.

{
       int x = previewLabel->width();
       int y = previewLabel->height();
       QValueList<ScColor> cols = colorWheel->colorList.values();
       int xstep = x / cols.count();
       QPixmap pm = QPixmap(x, y);
       QPainter *p = new QPainter(&pm);
       QFontMetrics fm = p->fontMetrics();

       pm.fill(Qt::white);
       p->setPen(Qt::white);
       p->drawRect(0, 0, x, y);
       QColor c;
       for (uint i = 0; i < cols.count(); ++i)
       {
              //c = computeDefect(cols[i].getRGBColor());
              c = computeDefect( ScColorEngine::getDisplayColor(cols[i], m_Doc) );
              p->setPen(c);
              p->setBrush(c);
              p->drawRect(i * xstep, 0, xstep, y);
       }
       p->setPen(Qt::black);
       p->setBrush(Qt::black);
       p->drawText(15, 5 + fm.height(), "Lorem ipsum dolor sit amet");
       p->setPen(Qt::white);
       p->setBrush(Qt::white);
       p->drawText(90, y - 5 - fm.height(), "Lorem ipsum dolor sit amet");
       p->end();
       delete(p);
       previewLabel->clear();
       previewLabel->setPixmap(pm);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void CWDialog::setupCMYKComponent ( ScColor  col) [private]

A GUI setter for all components when is one of RGB changed.

Definition at line 412 of file cwdialog.cpp.

{
       CMYKColor cmyk;
       ScColorEngine::getCMYKValues(col, m_Doc, cmyk);
       connectSlots(false);
       cSpin->setValue(qRound(cmyk.c / 2.55));
       mSpin->setValue(qRound(cmyk.m / 2.55));
       ySpin->setValue(qRound(cmyk.y / 2.55));
       kSpin->setValue(qRound(cmyk.k / 2.55));
       connectSlots(true);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void CWDialog::setupColorComponents ( ) [private]

Set the spins with its color component value.

It fills recomputed components regarding chosen color model and the changed channel. E.g. if user change R in RGB palette all CMYK channels are recomputed calling setupCMYKComponent().

Definition at line 436 of file cwdialog.cpp.

{
       ScColor c;
       if (colorspaceTab->currentPage() == tabCMYK)
       {
              c = ScColor(qRound(cSpin->value() * 2.55), qRound(mSpin->value() * 2.55),
                                   qRound(ySpin->value() * 2.55), qRound(kSpin->value() * 2.55));
              c = ScColorEngine::convertToModel(c, m_Doc, colorModelCMYK);
              setupRGBComponent(c);
              setupHSVComponent(c);
       }
       if (colorspaceTab->currentPage() == tabRGB)
       {
              c = ScColor(rSpin->value(), gSpin->value(), bSpin->value());
              c = ScColorEngine::convertToModel(c, m_Doc, colorModelRGB);
              setupCMYKComponent(c);
              setupHSVComponent(c);
       }
       if (colorspaceTab->currentPage() == tabHSV)
       {
              QColor qc;
              qc.setHsv(hSpin->value(), sSpin->value(), vSpin->value());
              c.fromQColor(qc);
              c = ScColorEngine::convertToModel(c, m_Doc, colorModelRGB);
              setupCMYKComponent(c);
              setupRGBComponent(c);
       }
       if (colorspaceTab->currentPage() == tabDocument)
       {
              c = m_Doc->PageColors[documentColorList->currentText()];
              setupRGBComponent(c);
              setupCMYKComponent(c);
              setupHSVComponent(c);
       }

       if (colorWheel->recomputeColor(c))
              processColors(typeCombo->currentItem(), false);
       else
       {
              colorList->clear();
              QMessageBox::information(this, caption(),
                                                         "<qt>" + tr("Unable to find the requested color. "
                                                                       "You have probably selected black, gray or white. "
                                                                       "There is no way to process this color.") + "</qt>");
       }
       updateNamedLabels();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void CWDialog::setupHSVComponent ( ScColor  col) [private]

A GUI setter for all components when is one of HSV changed.

It uses a dummy QColor->ScColor conversion

Definition at line 424 of file cwdialog.cpp.

{
       int h, s, v;
       QColor qc(ScColorEngine::getRGBColor(col, m_Doc));
       qc.getHsv(&h, &s, &v);
       connectSlots(false);
       hSpin->setValue(h);
       sSpin->setValue(s);
       vSpin->setValue(v);
       connectSlots(true);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void CWDialog::setupRGBComponent ( ScColor  col) [private]

A GUI setter for all components when is one of CMYK changed.

Definition at line 401 of file cwdialog.cpp.

{
       RGBColor rgb;
       ScColorEngine::getRGBValues(col, m_Doc, rgb);
       connectSlots(false);
       rSpin->setValue(rgb.r);
       gSpin->setValue(rgb.g);
       bSpin->setValue(rgb.b);
       connectSlots(true);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void CWDialog::sSpin_valueChanged ( int  ) [private, slot]

Definition at line 391 of file cwdialog.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void CWDialog::typeCombo_activated ( int  index) [private, slot]

Definition at line 188 of file cwdialog.cpp.

{
       processColors(index, false);
}

Here is the call graph for this function:

void CWDialog::updateNamedLabels ( ) [private]

Set named colors for labels.

Definition at line 484 of file cwdialog.cpp.

{
       cmykLabel->setText(colorWheel->actualColor.nameCMYK(m_Doc));
       cmykLabel2->setText(colorWheel->actualColor.nameCMYK(m_Doc));
       rgbLabel->setText(colorWheel->actualColor.nameRGB(m_Doc));
       rgbLabel2->setText(colorWheel->actualColor.nameRGB(m_Doc));
       hsvLabel->setText(getHexHsv(colorWheel->actualColor));
       hsvLabel2->setText(getHexHsv(colorWheel->actualColor));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void CWDialog::vSpin_valueChanged ( int  ) [private, slot]

Definition at line 396 of file cwdialog.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void CWDialog::ySpin_valueChanged ( int  ) [private, slot]

Definition at line 361 of file cwdialog.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

ScribusDoc* CWDialog::m_Doc [private]

a parent doc reference

Definition at line 49 of file cwdialog.h.

PrefsContext* CWDialog::prefs [private]

Configuration structure.

Definition at line 47 of file cwdialog.h.


The documentation for this class was generated from the following files: