Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

ColorListBox Class Reference

Very nice list box with color names and samples. It's inherited from QListBox with all its methods and properties. I create it as separate class because it's used now in ColorManager and ColorWheel too. You can see it in Extras/Color Wheel or in Edit/Colors dialogs in action. More...

#include <colorlistbox.h>

Collaboration diagram for ColorListBox:

Collaboration graph
[legend]

List of all members.

Public Types

enum  PixmapType { smallPixmap, widePixmap, fancyPixmap }

Public Member Functions

 ColorListBox (QWidget *parent=0)
 Standard QListBox like constructor. Just there are initialized pixmaps for icon drawing.
QString currentColor () const
void updateBox (ColorList &list, ColorListBox::PixmapType type)
 Fill the list box with values taken from list. The list is cleared itself. Then is rendered an icon with color attributes (RGB/CMYK/Spot etc.).
void insertItems (ColorList &list, ColorListBox::PixmapType type)
 Fill the list box with values taken from list. The list is not cleared before items insertion.
void insertSmallPixmapItems (ColorList &list)
 Insert ColorSmallPixmapItems into the list.
void insertWidePixmapItems (ColorList &list)
 Insert ColorWidePixmapItems into the list.
void insertFancyPixmapItems (ColorList &list)
 Insert ColorFancyPixmapItems into the list.

Public Attributes

ColorListcList
 Pointer to the color list displayed by this box.

Protected Member Functions

bool event (QEvent *event)

Protected Attributes

int m_selectedRow


Detailed Description

Very nice list box with color names and samples. It's inherited from QListBox with all its methods and properties. I create it as separate class because it's used now in ColorManager and ColorWheel too. You can see it in Extras/Color Wheel or in Edit/Colors dialogs in action.

Author:
Petr Vanek <petr@yarpen.cz>

Definition at line 67 of file colorlistbox.h.


Member Enumeration Documentation

Enumerator:
smallPixmap 
widePixmap 
fancyPixmap 

Definition at line 73 of file colorlistbox.h.


Constructor & Destructor Documentation

ColorListBox::ColorListBox ( QWidget *  parent = 0  ) 

Standard QListBox like constructor. Just there are initialized pixmaps for icon drawing.

Definition at line 189 of file colorlistbox.cpp.

References cList.


Member Function Documentation

QString ColorListBox::currentColor (  )  const

Definition at line 197 of file colorlistbox.cpp.

References CommonStrings::tr_NoneColor.

void ColorListBox::updateBox ( ColorList list,
ColorListBox::PixmapType  type 
)

Fill the list box with values taken from list. The list is cleared itself. Then is rendered an icon with color attributes (RGB/CMYK/Spot etc.).

Parameters:
list a ColorList to present.
the pixmap type to use

Definition at line 206 of file colorlistbox.cpp.

References insertItems().

Referenced by ColorManager::updateCList().

void ColorListBox::insertItems ( ColorList list,
ColorListBox::PixmapType  type 
)

Fill the list box with values taken from list. The list is not cleared before items insertion.

Parameters:
list a ColorList to present.
the pixmap type to use

Definition at line 213 of file colorlistbox.cpp.

References cList, fancyPixmap, insertFancyPixmapItems(), insertSmallPixmapItems(), insertWidePixmapItems(), smallPixmap, and widePixmap.

Referenced by ColorCombo::insertItems(), updateBox(), ColorCombo::updateBox(), and Cpalette::updateCList().

void ColorListBox::insertSmallPixmapItems ( ColorList list  ) 

Insert ColorSmallPixmapItems into the list.

Parameters:
list a ColorList to present.

Definition at line 224 of file colorlistbox.cpp.

References doc, ColorList::document(), CommonStrings::None, and CommonStrings::tr_NoneColor.

Referenced by insertItems().

void ColorListBox::insertWidePixmapItems ( ColorList list  ) 

Insert ColorWidePixmapItems into the list.

Parameters:
list a ColorList to present.

Definition at line 239 of file colorlistbox.cpp.

References doc, ColorList::document(), CommonStrings::None, and CommonStrings::tr_NoneColor.

Referenced by insertItems().

void ColorListBox::insertFancyPixmapItems ( ColorList list  ) 

Insert ColorFancyPixmapItems into the list.

Parameters:
list a ColorList to present.

Definition at line 254 of file colorlistbox.cpp.

References doc, ColorList::document(), CommonStrings::None, and CommonStrings::tr_NoneColor.

Referenced by insertItems(), and CMYKChoose::SelSwatch().

bool ColorListBox::event ( QEvent *  event  )  [protected]


Member Data Documentation

Pointer to the color list displayed by this box.

Definition at line 112 of file colorlistbox.h.

Referenced by ColorListBox(), event(), insertItems(), Cpalette::setDocument(), and Cpalette::ToggleColorDisplay().

int ColorListBox::m_selectedRow [protected]

Definition at line 116 of file colorlistbox.h.


The documentation for this class was generated from the following files:
Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.