Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Public Types | Public Member Functions
ColorCombo Class Reference

The ColorCombo widget is a combo box for displaying list of colors. More...

#include <colorcombo.h>

Inheritance diagram for ColorCombo:
Inheritance graph
[legend]

List of all members.

Public Types

enum  PixmapType { smallPixmaps, widePixmaps, fancyPixmaps }

Public Member Functions

 ColorCombo (QWidget *parent=0, const char *name=0)
 ColorCombo (bool rw, QWidget *parent=0, const char *name=0)
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)

Detailed Description

The ColorCombo widget is a combo box for displaying list of colors.

Definition at line 30 of file colorcombo.h.


Member Enumeration Documentation

Enumerator:
smallPixmaps 
widePixmaps 
fancyPixmaps 

Definition at line 51 of file colorcombo.h.


Constructor & Destructor Documentation

ColorCombo::ColorCombo ( QWidget *  parent = 0,
const char *  name = 0 
)

Definition at line 22 of file colorcombo.cpp.

                                                          : QComboBox(false, parent, name)
{
#ifdef QT_MAC
       setStyle( new ColorCombo::ScMacStyle() );
#endif
       setListBox( new ColorListBox( this, "in-combo", WType_Popup ) );
}
ColorCombo::ColorCombo ( bool  rw,
QWidget *  parent = 0,
const char *  name = 0 
)

Definition at line 30 of file colorcombo.cpp.

                                                                   : QComboBox(rw, parent, name)
{
#ifdef QT_MAC
       setStyle( new ColorCombo::ScMacStyle() );
#endif
       setListBox( new ColorListBox( this, "in-combo", WType_Popup ) );
}

Member Function Documentation

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

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 
)

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 
)

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 
)

Definition at line 76 of file colorcombo.cpp.

{
       ColorListBox* clb = (ColorListBox*) listBox();
       if ( clb )
              clb->insertItem( new ColorWidePixmapItem(col, doc, colName) );
}
void ColorCombo::updateBox ( ColorList &  list,
ColorCombo::PixmapType  pixType,
bool  insertNone = true 
)

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);
       }
}

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