.TH "KDualColorButton" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KDualColorButton \- A widget for selecting two related colors.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kdualcolorbutton.h>\fP
.PP
Inherits \fBQWidget\fP.
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBDualColor\fP { \fBForeground\fP, \fBBackground\fP }"
.br
.in -1c
.SS "Public Slots"

.in +1c
.ti -1c
.RI "void \fBsetForeground\fP (const \fBQColor\fP &c)"
.br
.ti -1c
.RI "void \fBsetBackground\fP (const \fBQColor\fP &c)"
.br
.ti -1c
.RI "void \fBsetCurrent\fP (DualColor s)"
.br
.ti -1c
.RI "void \fBsetCurrentColor\fP (const \fBQColor\fP &c)"
.br
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBfgChanged\fP (const \fBQColor\fP &c)"
.br
.ti -1c
.RI "void \fBbgChanged\fP (const \fBQColor\fP &c)"
.br
.ti -1c
.RI "void \fBcurrentChanged\fP (KDualColorButton::DualColor s)"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKDualColorButton\fP (\fBQWidget\fP *parent=0, const char *name=0, \fBQWidget\fP *dialogParent=0)"
.br
.ti -1c
.RI "\fBKDualColorButton\fP (const \fBQColor\fP &fgColor, const \fBQColor\fP &bgColor, \fBQWidget\fP *parent=0, const char *name=0, \fBQWidget\fP *dialogParent=0)"
.br
.ti -1c
.RI "\fBQColor\fP \fBforeground\fP () const "
.br
.ti -1c
.RI "\fBQColor\fP \fBbackground\fP () const "
.br
.ti -1c
.RI "DualColor \fBcurrent\fP () const "
.br
.ti -1c
.RI "\fBQColor\fP \fBcurrentColor\fP () const "
.br
.ti -1c
.RI "virtual \fBQSize\fP \fBsizeHint\fP () const "
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBmetrics\fP (\fBQRect\fP &fgRect, \fBQRect\fP &bgRect)"
.br
.ti -1c
.RI "virtual void \fBpaintEvent\fP (\fBQPaintEvent\fP *ev)"
.br
.ti -1c
.RI "virtual void \fBmousePressEvent\fP (\fBQMouseEvent\fP *ev)"
.br
.ti -1c
.RI "virtual void \fBmouseMoveEvent\fP (\fBQMouseEvent\fP *ev)"
.br
.ti -1c
.RI "virtual void \fBmouseReleaseEvent\fP (\fBQMouseEvent\fP *ev)"
.br
.ti -1c
.RI "virtual void \fBdragEnterEvent\fP (\fBQDragEnterEvent\fP *ev)"
.br
.ti -1c
.RI "virtual void \fBdropEvent\fP (\fBQDropEvent\fP *ev)"
.br
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Properties"

.in +1c
.ti -1c
.RI "\fBQColor\fP \fBforeground\fP"
.br
.ti -1c
.RI "\fBQColor\fP \fBbackground\fP"
.br
.ti -1c
.RI "\fBQColor\fP \fBcurrentColor\fP"
.br
.ti -1c
.RI "DualColor \fBcurrent\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
A widget for selecting two related colors. 

KDualColorButton allows the user to select two cascaded colors (usually a foreground and background color). Other features include drag and drop from other \fBKDE\fP color widgets, a reset to black and white control, and a swap colors control.
.PP
When the user clicks on the foreground or background rectangle the rectangle is first sunken and the \fBcurrentChanged()\fP signal is emitted. Further clicks will present a color dialog and emit either the \fBfgChanged()\fP or \fBbgChanged()\fP if a new color is selected.
.PP
Note: With drag and drop when dropping a color the current selected color will be set, while when dragging a color it will use whatever color rectangle the mouse was pressed inside.
.PP
KDE Dual Color Button 
.PP
\fBAuthor:\fP
.RS 4
Daniel M. Duley <mosfet@kde.org> 
.RE
.PP

.PP
Definition at line 48 of file kdualcolorbutton.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KDualColorButton::KDualColorButton (\fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP, \fBQWidget\fP * dialogParent = \fC0\fP)"
.PP
Constructs a new KDualColorButton using the default black and white colors. 
.PP
Definition at line 35 of file kdualcolorbutton.cpp.
.PP
References QSize::isValid(), QWidget::setAcceptDrops(), QWidget::setMinimumSize(), and sizeHint().
.SS "KDualColorButton::KDualColorButton (const \fBQColor\fP & fgColor, const \fBQColor\fP & bgColor, \fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP, \fBQWidget\fP * dialogParent = \fC0\fP)"
.PP
Constructs a new KDualColorButton with the supplied foreground and background colors. 
.PP
Definition at line 55 of file kdualcolorbutton.cpp.
.PP
References QSize::isValid(), QWidget::setAcceptDrops(), QWidget::setMinimumSize(), and sizeHint().
.SH "Member Function Documentation"
.PP 
.SS "\fBQColor\fP KDualColorButton::foreground () const"
.PP
Returns the current foreground color. 
.PP
.SS "\fBQColor\fP KDualColorButton::background () const"
.PP
Returns the current background color. 
.PP
.SS "DualColor KDualColorButton::current () const"
.PP
Returns the current color item selected by the user. 
.PP
.SS "\fBQColor\fP KDualColorButton::currentColor () const"
.PP
Returns the color of the selected item. 
.PP
.SS "\fBQSize\fP KDualColorButton::sizeHint () const\fC [virtual]\fP"
.PP
Returns the minimum size needed to display the widget and all its controls. 
.PP
Reimplemented from \fBQWidget\fP.
.PP
Definition at line 103 of file kdualcolorbutton.cpp.
.PP
Referenced by KDualColorButton().
.SS "void KDualColorButton::setForeground (const \fBQColor\fP & c)\fC [slot]\fP"
.PP
Sets the foreground color. 
.PP
Definition at line 108 of file kdualcolorbutton.cpp.
.PP
References QBrush::color(), fgChanged(), and QWidget::repaint().
.SS "void KDualColorButton::setBackground (const \fBQColor\fP & c)\fC [slot]\fP"
.PP
Sets the background color. 
.PP
Definition at line 116 of file kdualcolorbutton.cpp.
.PP
References bgChanged(), QBrush::color(), and QWidget::repaint().
.SS "void KDualColorButton::setCurrent (DualColor s)\fC [slot]\fP"
.PP
Sets the current selected color item. 
.PP
Definition at line 133 of file kdualcolorbutton.cpp.
.PP
References QWidget::repaint().
.SS "void KDualColorButton::setCurrentColor (const \fBQColor\fP & c)\fC [slot]\fP"
.PP
Sets the color of the selected item. 
.PP
Definition at line 124 of file kdualcolorbutton.cpp.
.PP
References QWidget::repaint().
.SS "void KDualColorButton::fgChanged (const \fBQColor\fP & c)\fC [signal]\fP"
.PP
Emitted when the foreground color is changed. 
.PP
Referenced by setForeground().
.SS "void KDualColorButton::bgChanged (const \fBQColor\fP & c)\fC [signal]\fP"
.PP
Emitted when the background color is changed. 
.PP
Referenced by setBackground().
.SS "void KDualColorButton::currentChanged (KDualColorButton::DualColor s)\fC [signal]\fP"
.PP
Emitted when the user changes the current color selection. 
.PP
.SS "void KDualColorButton::metrics (\fBQRect\fP & fgRect, \fBQRect\fP & bgRect)\fC [protected, virtual]\fP"
.PP
Sets the supplied rectangles to the proper size and position for the current widget size. 
.PP
You can reimplement this to change the layout of the widget. Restrictions are that the swap control will always be at the top right, the reset control will always be at the bottom left, and you must leave at least a 14x14 space in those corners. 
.PP
Definition at line 139 of file kdualcolorbutton.cpp.
.PP
References QWidget::height(), and QWidget::width().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
