libopie API Documentation

OColorPanelButton Class Reference

The OColorPanelButton class provides a button for color selection. More...

#include <colorpopupmenu.h>

Inheritance diagram for OColorPanelButton:

Inheritance graph
[legend]
Collaboration diagram for OColorPanelButton:

Collaboration graph
[legend]
List of all members.

Signals

void selected (const QColor &)
 Signal to indicate button has been pressed.


Public Member Functions

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

 ~OColorPanelButton ()
 Object destructor.

void setActive (bool active)
 Sets button selection state.

void enterEvent (QEvent *e)
 Reimplemented for internal reasons.

void leaveEvent (QEvent *e)
 Reimplemented for internal reasons.

void paintEvent (QPaintEvent *e)
 Reimplemented for internal reasons.

void mouseReleaseEvent (QMouseEvent *e)
 Slot executed when button is pressed.


Detailed Description

The OColorPanelButton class provides a button for color selection.

See also:
OColorPopupMenu
The OColorPanelButton class provides a button for color selection. The button is drawn with the desired color and no border. This class is used internally by the OColorPopupMenu class to displaying colors in its menu.

Definition at line 52 of file colorpopupmenu.h.


Constructor & Destructor Documentation

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

Object constructor.

Parameters:
color Desired color.
parent Pointer to parent of this control.
name Name of control.
Constructs a new ColorPanelButton control with parent, name and desired color.

Definition at line 40 of file colorpopupmenu.cpp.

References setActive(), and QWidget::setFixedSize().

OColorPanelButton::~OColorPanelButton  ) 
 

Object destructor.

Definition at line 49 of file colorpopupmenu.cpp.


Member Function Documentation

OColorPanelButton::setActive bool  active  ) 
 

Sets button selection state.

Parameters:
active Boolean indicator of new button state.
Changes button selection state. If button is selected, a highlighted border is drawn.

Definition at line 53 of file colorpopupmenu.cpp.

References QFrame::setFrameStyle().

Referenced by OColorPanelButton().

OColorPanelButton::enterEvent QEvent e  ) 
 

Reimplemented for internal reasons.

Parameters:
e Event currently being processed.
Reimplemented to ensure correct display of button based on whether it is active or not.

Reimplemented from QWidget.

Definition at line 64 of file colorpopupmenu.cpp.

References QFrame::setFrameStyle().

OColorPanelButton::leaveEvent QEvent e  ) 
 

Reimplemented for internal reasons.

Parameters:
e Event currently being processed.
Reimplemented to ensure correct display of button based on whether it is active or not.

Reimplemented from QWidget.

Definition at line 71 of file colorpopupmenu.cpp.

References QFrame::setFrameStyle().

OColorPanelButton::paintEvent QPaintEvent e  ) 
 

Reimplemented for internal reasons.

Parameters:
e Event currently being processed. Reimplemented to ensure correct display of button.

Reimplemented from QFrame.

Definition at line 78 of file colorpopupmenu.cpp.

References QPainter::begin(), QPainter::drawRect(), QPainter::end(), QPainter::fillRect(), QFrame::paintEvent(), and QPainter::setPen().

OColorPanelButton::mouseReleaseEvent QMouseEvent e  ) 
 

Slot executed when button is pressed.

Parameters:
e Mouse event currently being processed.
See also:
selected()
This slot executes when the button has been pressed. It emits the selected signal as notification that it has been pressed.

Reimplemented from QWidget.

Definition at line 90 of file colorpopupmenu.cpp.

References selected().

OColorPanelButton::selected const QColor color  )  [signal]
 

Signal to indicate button has been pressed.

Parameters:
color Button color.
This signal is emitted when the button is pressed. It provides the color associated to this button.

Referenced by mouseReleaseEvent().


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:50 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001