libopie API Documentation

OColorPopupMenu Class Reference

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

#include <colorpopupmenu.h>

Inheritance diagram for OColorPopupMenu:

Inheritance graph
[legend]
Collaboration diagram for OColorPopupMenu:

Collaboration graph
[legend]
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.


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 95 of file colorpopupmenu.cpp.

References QMenuData::activateItemAt(), QPopupMenu::insertItem(), QPopupMenu::insertSeparator(), moreColorClicked(), QWidget::QWidget(), and QObject::tr().

OColorPopupMenu::~OColorPopupMenu  ) 
 

Object destructor.

Definition at line 149 of file colorpopupmenu.cpp.


Member Function Documentation

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::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 160 of file colorpopupmenu.cpp.

References colorSelected(), and QWidget::hide().

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 167 of file colorpopupmenu.cpp.

References colorSelected(), and QWidget::hide().

Referenced by OColorPopupMenu().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for OPIE Version 1.1.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:24:51 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001