org.kde.koala

Class KDualColorButton

public class KDualColorButton extends QWidget

KDualColorButton allows the user to select two cascaded colors (usually a foreground and background color). Other features include drag and drop from other KDE color widgets, a reset to black and white control, and a swap colors control. When the user clicks on the foreground or background rectangle the rectangle is first sunken and the currentChanged() signal is emitted. Further clicks will present a color dialog and emit either the fgChanged() or bgChanged() if a new color is selected. 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. \image html kdualcolorbutton.png "KDE Dual Color Button" See KDualColorButtonSignals for signals emitted by KDualColorButton

Author: Daniel M. Duley

UNKNOWN: A widget for selecting two related colors.

Field Summary
static intBackground
static intForeground
Constructor Summary
protected KDualColorButton(Class dummy)
KDualColorButton(QWidget parent, String name, QWidget dialogParent)
Constructs a new KDualColorButton using the default black and white colors.
KDualColorButton(QWidget parent, String name)
KDualColorButton(QWidget parent)
KDualColorButton()
KDualColorButton(QColor fgColor, QColor bgColor, QWidget parent, String name, QWidget dialogParent)
Constructs a new KDualColorButton with the supplied foreground and background colors.
KDualColorButton(QColor fgColor, QColor bgColor, QWidget parent, String name)
KDualColorButton(QColor fgColor, QColor bgColor, QWidget parent)
KDualColorButton(QColor fgColor, QColor bgColor)
Method Summary
QColorbackground()
Returns the current background color.
StringclassName()
intcurrent()
Returns the current color item selected by the user.
QColorcurrentColor()
Returns the color of the selected item.
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
protected voiddragEnterEvent(QDragEnterEvent ev)
protected voiddropEvent(QDropEvent ev)
protected voidfinalize()
Deletes the wrapped C++ instance
QColorforeground()
Returns the current foreground color.
booleanisDisposed()
Has the wrapped C++ instance been deleted?
QMetaObjectmetaObject()
protected voidmetrics(QRect fgRect, QRect bgRect)
Sets the supplied rectangles to the proper size and position for the current widget size.
protected voidmouseMoveEvent(QMouseEvent ev)
protected voidmousePressEvent(QMouseEvent ev)
protected voidmouseReleaseEvent(QMouseEvent ev)
protected voidpaintEvent(QPaintEvent ev)
voidsetBackground(QColor c)
Sets the background color.
voidsetCurrent(int s)
Sets the current selected color item.
voidsetCurrentColor(QColor c)
Sets the color of the selected item.
voidsetForeground(QColor c)
Sets the foreground color.
QSizesizeHint()
Returns the minimum size needed to display the widget and all its controls.

Field Detail

Background

public static final int Background

Foreground

public static final int Foreground

Constructor Detail

KDualColorButton

protected KDualColorButton(Class dummy)

KDualColorButton

public KDualColorButton(QWidget parent, String name, QWidget dialogParent)
Constructs a new KDualColorButton using the default black and white colors.

UNKNOWN: Constructs a new KDualColorButton using the default black and white colors.

KDualColorButton

public KDualColorButton(QWidget parent, String name)

KDualColorButton

public KDualColorButton(QWidget parent)

KDualColorButton

public KDualColorButton()

KDualColorButton

public KDualColorButton(QColor fgColor, QColor bgColor, QWidget parent, String name, QWidget dialogParent)
Constructs a new KDualColorButton with the supplied foreground and background colors.

UNKNOWN: Constructs a new KDualColorButton with the supplied foreground and background colors.

KDualColorButton

public KDualColorButton(QColor fgColor, QColor bgColor, QWidget parent, String name)

KDualColorButton

public KDualColorButton(QColor fgColor, QColor bgColor, QWidget parent)

KDualColorButton

public KDualColorButton(QColor fgColor, QColor bgColor)

Method Detail

background

public QColor background()
Returns the current background color.

UNKNOWN: Returns the current background color.

className

public String className()

current

public int current()
Returns the current color item selected by the user.

UNKNOWN: Returns the current color item selected by the user.

currentColor

public QColor currentColor()
Returns the color of the selected item.

UNKNOWN: Returns the color of the selected item.

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()

dragEnterEvent

protected void dragEnterEvent(QDragEnterEvent ev)

dropEvent

protected void dropEvent(QDropEvent ev)

finalize

protected void finalize()
Deletes the wrapped C++ instance

foreground

public QColor foreground()
Returns the current foreground color.

UNKNOWN: Returns the current foreground color.

isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?

metaObject

public QMetaObject metaObject()

metrics

protected void metrics(QRect fgRect, QRect bgRect)
Sets the supplied rectangles to the proper size and position for the current widget size. 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.

UNKNOWN: Sets the supplied rectangles to the proper size and position for the current widget size.

mouseMoveEvent

protected void mouseMoveEvent(QMouseEvent ev)

mousePressEvent

protected void mousePressEvent(QMouseEvent ev)

mouseReleaseEvent

protected void mouseReleaseEvent(QMouseEvent ev)

paintEvent

protected void paintEvent(QPaintEvent ev)

setBackground

public void setBackground(QColor c)
Sets the background color.

UNKNOWN: Sets the background color.

setCurrent

public void setCurrent(int s)
Sets the current selected color item.

UNKNOWN: Sets the current selected color item.

setCurrentColor

public void setCurrentColor(QColor c)
Sets the color of the selected item.

UNKNOWN: Sets the color of the selected item.

setForeground

public void setForeground(QColor c)
Sets the foreground color.

UNKNOWN: Sets the foreground color.

sizeHint

public QSize sizeHint()
Returns the minimum size needed to display the widget and all its controls.

UNKNOWN: Returns the minimum size needed to display the widget and all its controls.