Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OColorPopupMenu Class Reference

The OColorPopupMenu class provides a small color selection popup menu. More...

#include </home/clem/local/src/opie/noncore/unsupported/libopie/colorpopupmenu.h>

List of all members.

Signals

void colorSelected (const QColor &color)
 Signal to indicate color chosen from the menu.

Public Member Functions

 OColorPopupMenu (const QColor &color, QWidget *parent=0, const char *name=0)
 Object constructor.
 ~OColorPopupMenu ()
 Object destructor.

Protected Slots

void buttonSelected (const QColor &color)
 Slot to process selected color.
void moreColorClicked ()
 Slot to process display color selection dialog.

Private Member Functions

void addColor (const QColor &color, int row, int col)
 Adds color selection option to popup menu.

Private Attributes

ColorPopupMenuPrivate * d
QColor m_color
QWidget * colorPanel
QGridLayout * colorLayout


Detailed Description

The OColorPopupMenu class provides a small color selection popup menu.

OColorPopupMenu is a derivation of TrollTech's QPopupMenu and provides a small color selection popup menu which can be attached to another control such as a toolbar button of menu item.

The popup menu displays 30 default colors available in a grid, and also includes an option at the bottom to display a color selection dialog box for finer color control.

Definition at line 165 of file colorpopupmenu.h.


Constructor & Destructor Documentation

OColorPopupMenu::OColorPopupMenu const QColor &  color,
QWidget *  parent = 0,
const char *  name = 0
 

Object constructor.

Parameters:
color Initial color selected in menu.
parent Pointer to parent of this control.
name Name of control.
Constructs a new OColorPopupMenu control with parent, name and initial color selected.

Definition at line 94 of file colorpopupmenu.cpp.

References addColor(), colorLayout, colorPanel, m_color, moreColorClicked(), and tr.

OColorPopupMenu::~OColorPopupMenu  ) 
 

Object destructor.

Definition at line 148 of file colorpopupmenu.cpp.


Member Function Documentation

OColorPopupMenu::addColor const QColor &  color,
int  row,
int  col
[private]
 

Adds color selection option to popup menu.

Parameters:
color Color to be displayed in menu.
row Row where color is to appear in menu.
col Column where color is to appear in menu.
Adds a color selection option to popup menu. Used internally when initially constructing the menu control.

Definition at line 152 of file colorpopupmenu.cpp.

References buttonSelected(), colorLayout, and colorPanel.

Referenced by OColorPopupMenu().

OColorPopupMenu::buttonSelected const QColor &  color  )  [protected, slot]
 

Slot to process selected color.

Parameters:
color Color selected from the menu.
See also:
colorSelected()
This slot executes when a color has been selected from the menu. It performs two functions:
  • Emit the colorSelected signal with the color selected.
  • Hide the menu.

Definition at line 159 of file colorpopupmenu.cpp.

References colorSelected(), and m_color.

Referenced by addColor().

OColorPopupMenu::colorSelected const QColor &  color  )  [signal]
 

Signal to indicate color chosen from the menu.

Parameters:
color Color selected from the menu.
This signal is emitted when a color has been selected either directly from the menu, or chosen from the color selection dialog.

Referenced by buttonSelected(), and moreColorClicked().

OColorPopupMenu::moreColorClicked  )  [protected, slot]
 

Slot to process display color selection dialog.

See also:
colorSelected()
This slot executes when the 'More...' option is selected at the bottom of the menu. It performs the following functions:
  • Constructs and executes a OColorDialog to allow finer color selection.
  • Emit the colorSelected signal with the color selected.
  • Hide the menu.

Definition at line 166 of file colorpopupmenu.cpp.

References colorSelected(), OColorDialog::getColor(), and m_color.

Referenced by OColorPopupMenu().


Member Data Documentation

QGridLayout* OColorPopupMenu::colorLayout [private]
 

Definition at line 195 of file colorpopupmenu.h.

Referenced by addColor(), and OColorPopupMenu().

QWidget* OColorPopupMenu::colorPanel [private]
 

Definition at line 194 of file colorpopupmenu.h.

Referenced by addColor(), and OColorPopupMenu().

ColorPopupMenuPrivate* OColorPopupMenu::d [private]
 

Definition at line 191 of file colorpopupmenu.h.

QColor OColorPopupMenu::m_color [private]
 

Definition at line 193 of file colorpopupmenu.h.

Referenced by buttonSelected(), moreColorClicked(), and OColorPopupMenu().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:41:50 2005 for OPIE by  doxygen 1.4.2