Back to index

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

#include <smwidgets.h>

Inheritance diagram for SMColorCombo:
Inheritance graph
[legend]
Collaboration diagram for SMColorCombo:
Collaboration graph
[legend]

List of all members.

Public Types

enum  PixmapType { smallPixmaps, widePixmaps, fancyPixmaps }

Public Member Functions

 SMColorCombo (QWidget *parent, const char *name)
 SMColorCombo (bool rw, QWidget *parent, const char *name)
 ~SMColorCombo ()
void setCurrentItem (int i)
void setCurrentItem (int i, bool isParentValue)
void setCurrentText (const QString &s)
void setCurrentText (const QString &s, bool isParentValue)
void setParentItem (int i)
void setParentText (const QString &s)
bool useParentValue ()
void updateBox (ColorList &list, ColorCombo::PixmapType pixType, bool insertNone=true)
void insertItems (ColorList &list, ColorCombo::PixmapType type)
void insertSmallItem (const ScColor &col, ScribusDoc *doc, const QString &colName)
void insertWideItem (const ScColor &col, ScribusDoc *doc, const QString &colName)
void insertFancyItem (const ScColor &col, ScribusDoc *doc, const QString &colName)

Private Slots

void currentChanged ()

Private Member Functions

void setFont (bool wantBold)

Private Attributes

bool hasParent_
bool useParentValue_
int pItem_
QString pText_

Detailed Description

Definition at line 184 of file smwidgets.h.


Member Enumeration Documentation

enum ColorCombo::PixmapType [inherited]
Enumerator:
smallPixmaps 
widePixmaps 
fancyPixmaps 

Definition at line 51 of file colorcombo.h.


Constructor & Destructor Documentation

SMColorCombo::SMColorCombo ( QWidget *  parent,
const char *  name 
)

Definition at line 561 of file smwidgets.cpp.

: ColorCombo(parent, name),
  hasParent_(false),
  useParentValue_(false),
  pItem_(0)
{
       
}
SMColorCombo::SMColorCombo ( bool  rw,
QWidget *  parent,
const char *  name 
)

Definition at line 570 of file smwidgets.cpp.

: ColorCombo(rw, parent, name),
  hasParent_(false),
  useParentValue_(false),
  pItem_(0),
  pText_(QString::null)
{
       
}

Definition at line 190 of file smwidgets.h.

{};

Member Function Documentation

void SMColorCombo::currentChanged ( ) [private, slot]

Definition at line 664 of file smwidgets.cpp.

{
       if (hasParent_ && !useParentValue_)
       {
              setFont(true);
              insertItem( tr("Use Parent Value"));
              useParentValue_ = true;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void ColorCombo::insertFancyItem ( const ScColor &  col,
ScribusDoc *  doc,
const QString &  colName 
) [inherited]

Definition at line 83 of file colorcombo.cpp.

{
       ColorListBox* clb = (ColorListBox*) listBox();
       if ( clb )
              clb->insertItem( new ColorFancyPixmapItem(col, doc, colName) );
}
void ColorCombo::insertItems ( ColorList &  list,
ColorCombo::PixmapType  type 
) [inherited]

Definition at line 55 of file colorcombo.cpp.

{
       ColorListBox* clb = (ColorListBox*) listBox();
       if ( clb )
       {
              if ( pixType == ColorCombo::fancyPixmaps )
                     clb->insertItems(list, ColorListBox::fancyPixmap);
              else if ( pixType == ColorCombo::widePixmaps )
                     clb->insertItems(list, ColorListBox::widePixmap);
              else if ( pixType == ColorCombo::smallPixmaps )
                     clb->insertItems(list, ColorListBox::smallPixmap);
       }
}
void ColorCombo::insertSmallItem ( const ScColor &  col,
ScribusDoc *  doc,
const QString &  colName 
) [inherited]

Definition at line 69 of file colorcombo.cpp.

{
       ColorListBox* clb = (ColorListBox*) listBox();
       if ( clb )
              clb->insertItem( new ColorSmallPixmapItem(col, doc, colName) );
}

Here is the caller graph for this function:

void ColorCombo::insertWideItem ( const ScColor &  col,
ScribusDoc *  doc,
const QString &  colName 
) [inherited]

Definition at line 76 of file colorcombo.cpp.

{
       ColorListBox* clb = (ColorListBox*) listBox();
       if ( clb )
              clb->insertItem( new ColorWidePixmapItem(col, doc, colName) );
}

Definition at line 580 of file smwidgets.cpp.

{
       disconnect(this, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
       setFont(false);
       hasParent_ = false;
       pItem_ = 0;
       pText_ = QString::null;
       ColorCombo::setCurrentItem(i);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void SMColorCombo::setCurrentItem ( int  i,
bool  isParentValue 
)

Definition at line 590 of file smwidgets.cpp.

{
       disconnect(this, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
       hasParent_ = true;
       pItem_ = i;
       pText_ = QString::null;
       ColorCombo::setCurrentItem(i);
       setFont(!isParentValue);
       connect(this, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
}

Here is the call graph for this function:

void SMColorCombo::setCurrentText ( const QString &  s)

Definition at line 601 of file smwidgets.cpp.

{
       disconnect(this, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
       setFont(false);
       hasParent_ = false;
       pItem_ = -1;
       pText_ = s;
       ColorCombo::setCurrentText(s);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void SMColorCombo::setCurrentText ( const QString &  s,
bool  isParentValue 
)

Definition at line 611 of file smwidgets.cpp.

{
       disconnect(this, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
       hasParent_ = true;
       pItem_ = -1;
       pText_ = s;
       ColorCombo::setCurrentText(s);
       setFont(!isParentValue);
       connect(this, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
}

Here is the call graph for this function:

void SMColorCombo::setFont ( bool  wantBold) [private]

Definition at line 657 of file smwidgets.cpp.

{
       QFont f(font());
       f.setBold(wantBold);
       ColorCombo::setFont(f);
}

Here is the caller graph for this function:

Definition at line 622 of file smwidgets.cpp.

{
       hasParent_ = true;
       pItem_ = i;
       pText_ = QString::null;
}
void SMColorCombo::setParentText ( const QString &  s)

Definition at line 629 of file smwidgets.cpp.

{
       hasParent_ = true;
       pText_ = s;
}

Here is the caller graph for this function:

void ColorCombo::updateBox ( ColorList &  list,
ColorCombo::PixmapType  pixType,
bool  insertNone = true 
) [inherited]

Definition at line 38 of file colorcombo.cpp.

{
       ColorListBox* clb = (ColorListBox*) listBox();
       if ( clb )
       {
              clb->clear();
              if ( insertNone )
                     clb->insertItem(CommonStrings::tr_NoneColor);
              if ( pixType == ColorCombo::fancyPixmaps )
                     clb->insertItems(list, ColorListBox::fancyPixmap);
              else if ( pixType == ColorCombo::widePixmaps )
                     clb->insertItems(list, ColorListBox::widePixmap);
              else if ( pixType == ColorCombo::smallPixmaps )
                     clb->insertItems(list, ColorListBox::smallPixmap);
       }
}

Definition at line 635 of file smwidgets.cpp.

{
       bool ret = false;

       if (useParentValue_ && hasParent_)
       {
              ret = currentItem() == (count() - 1);
              if (ret)
              {
                     removeItem(count() - 1);
                     setFont(false);
                     if (!pText_.isNull())
                            setCurrentText(pText_, true);
                     else
                            setCurrentItem(pItem_, true);
                     useParentValue_ = false;
              }
       }

       return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 204 of file smwidgets.h.

Definition at line 206 of file smwidgets.h.

QString SMColorCombo::pText_ [private]

Definition at line 207 of file smwidgets.h.

Definition at line 205 of file smwidgets.h.


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