Main Page | Class List | Directories | File List | Class Members | File Members | Related Pages

ColorDlg Class Reference

#include <colordlg.h>

Collaboration diagram for ColorDlg:

Collaboration graph
[legend]
List of all members.

Public Slots

void colorChanged (const rColor &)
void rgbChanged (int)
void hsvChanged (int)
void alphaChanged (int)
void grabPixel ()
void addCustomColor ()
void toHistory (const rColor &)
void deleteHistory (HistoryFrame *)
void htmlChanged ()

Public Member Functions

 ColorDlg (QWidget *parent=0, const char *name=0, bool modal=false, WFlags f=0)
void setColor (const rColor &c)
void setColor (const QColor &)
const rColorgetRColor ()
const QColor & getQColor ()
void setHistory (int, const rColor &)
const rColorgetHistory (int)

Protected Member Functions

void mouseReleaseEvent (QMouseEvent *)

Private Attributes

rColor curColor
ColorCirclecolci
QHBoxLayout * upperLayout
QVBoxLayout * colorsLayout
QVBoxLayout * ColorDlgLayout
QGridLayout * SliderLayout
QGridLayout * sampleLayout
QGridLayout * lowerLayout
bool useSpinBoxes
bool grabbing
SliderhueSlider
SlidersatSlider
SlidervalSlider
SliderredSlider
SlidergreenSlider
SliderblueSlider
QSpinBox * hueSpinBox
QSpinBox * satSpinBox
QSpinBox * valSpinBox
QSpinBox * redSpinBox
QSpinBox * greenSpinBox
QSpinBox * blueSpinBox
QLabel * hueLabel
QLabel * satLabel
QLabel * valLabel
QLabel * redLabel
QLabel * greenLabel
QLabel * blueLabel
QLabel * alphaLabel
QLabel * htmlLabel
QLabel * newLabel
QLabel * oldLabel
QSpinBox * alphaSpinBox
SlideralphaSlider
QLineEdit * htmlText
SamplenewSample
SampleoldSample
HistoryFrame ** history
int historyFrames
int nextFrame
QPushButton * acceptButton
QPushButton * rejectButton
QToolButton * addHistory
QToolButton * pickColor
QColor retQCol
rColor retRCol

Detailed Description

All the text intended to appear at this place I decided to move to the Main Page. So there is nothing I would like to add here right now.


Constructor & Destructor Documentation

ColorDlg::ColorDlg QWidget *  parent = 0,
const char *  name = 0,
bool  modal = false,
WFlags  f = 0
 

The one and only c'tor. Here is where the necessary widgets are created and put in their divers layouts. Connections between signals and slots are made: The usual rather boring thing.


Member Function Documentation

void ColorDlg::addCustomColor  )  [inline, slot]
 

void ColorDlg::alphaChanged int  a  )  [slot]
 

Takes care of changes in the desired alpha value.

void ColorDlg::colorChanged const rColor f  )  [slot]
 

The heavily used function for setting the current Color, whenever changes have taken place in the various input modules.

void ColorDlg::deleteHistory HistoryFrame f  )  [slot]
 

This slot is called when a history entry should be deleted. The frame is cleared and the remaining colors are shifted to the left to fill the gap. ( Not really true, but sounds better. )

const rColor & ColorDlg::getHistory int  n  ) 
 

Retrieves the rColor from history frame n. If n is out of range, returns opaque white.

Here is the call graph for this function:

const QColor & ColorDlg::getQColor  ) 
 

Returns the current color as a QColor.

Here is the call graph for this function:

const rColor& ColorDlg::getRColor  )  [inline]
 

void ColorDlg::grabPixel  )  [slot]
 

Starts the color picker. I had to create my own cross cursor here, because Qt uses the X11 cross cursor. And this cursor is not masked for transparency at the relevant hot spot.

void ColorDlg::hsvChanged int   )  [slot]
 

This constructs a new color whenever one of the hue, saturation or value components change.

void ColorDlg::htmlChanged  )  [slot]
 

This slot is called whenever return is pressed in the HTML field. The text is evaluated as an hex integer. If the result turns out to have more than 24 bits, a new value for alpha is taken from the topmost bits. If not, alpha is set to 255 ( opaque ).
If the text can be interpreted as integer, the values are taken to construct a new current color. If not, the current color is set to apaque white.

void ColorDlg::mouseReleaseEvent QMouseEvent *  e  )  [protected]
 

The mouseReleaseEvent is reimplemented in order to get to the selected color if color picking is active. Sets a new current color if this is the case.

Here is the call graph for this function:

void ColorDlg::rgbChanged int   )  [slot]
 

The input widgets for the red, green and blue color components are connected to this slot, as a new current color must be created out of them. rColor does not have a constructor for this.

void ColorDlg::setColor const QColor &  c  ) 
 

Builds a new current rColor from a QColor.

Here is the call graph for this function:

void ColorDlg::setColor const rColor c  )  [inline]
 

Sets a new current rColor.

void ColorDlg::setHistory int  n,
const rColor c
 

Adds the rColor c to the history frame
. Does nothing if n is out of range.

Here is the call graph for this function:

void ColorDlg::toHistory const rColor c  )  [slot]
 

Add the current color to the history, if it is not opaque white.


Member Data Documentation

QPushButton* ColorDlg::acceptButton [private]
 

QToolButton* ColorDlg::addHistory [private]
 

QLabel* ColorDlg::alphaLabel [private]
 

Slider* ColorDlg::alphaSlider [private]
 

QSpinBox* ColorDlg::alphaSpinBox [private]
 

QLabel * ColorDlg::blueLabel [private]
 

Slider * ColorDlg::blueSlider [private]
 

QSpinBox * ColorDlg::blueSpinBox [private]
 

ColorCircle* ColorDlg::colci [private]
 

QVBoxLayout * ColorDlg::ColorDlgLayout [private]
 

QVBoxLayout* ColorDlg::colorsLayout [private]
 

rColor ColorDlg::curColor [private]
 

bool ColorDlg::grabbing [private]
 

QLabel * ColorDlg::greenLabel [private]
 

Slider * ColorDlg::greenSlider [private]
 

QSpinBox * ColorDlg::greenSpinBox [private]
 

HistoryFrame** ColorDlg::history [private]
 

int ColorDlg::historyFrames [private]
 

QLabel * ColorDlg::htmlLabel [private]
 

QLineEdit* ColorDlg::htmlText [private]
 

QLabel* ColorDlg::hueLabel [private]
 

Slider* ColorDlg::hueSlider [private]
 

QSpinBox* ColorDlg::hueSpinBox [private]
 

QGridLayout * ColorDlg::lowerLayout [private]
 

QLabel* ColorDlg::newLabel [private]
 

Sample* ColorDlg::newSample [private]
 

int ColorDlg::nextFrame [private]
 

QLabel * ColorDlg::oldLabel [private]
 

Sample * ColorDlg::oldSample [private]
 

QToolButton * ColorDlg::pickColor [private]
 

QLabel* ColorDlg::redLabel [private]
 

Slider* ColorDlg::redSlider [private]
 

QSpinBox* ColorDlg::redSpinBox [private]
 

QPushButton * ColorDlg::rejectButton [private]
 

QColor ColorDlg::retQCol [private]
 

rColor ColorDlg::retRCol [private]
 

QGridLayout * ColorDlg::sampleLayout [private]
 

QLabel * ColorDlg::satLabel [private]
 

Slider * ColorDlg::satSlider [private]
 

QSpinBox * ColorDlg::satSpinBox [private]
 

QGridLayout* ColorDlg::SliderLayout [private]
 

QHBoxLayout* ColorDlg::upperLayout [private]
 

bool ColorDlg::useSpinBoxes [private]
 

QLabel * ColorDlg::valLabel [private]
 

Slider * ColorDlg::valSlider [private]
 

QSpinBox * ColorDlg::valSpinBox [private]
 


The documentation for this class was generated from the following files:
Go back to rwm - the window manager's - Home page.
created 13 Jun 2005 for colordlg $Revision:1.1$ by Rolf C. Rönnau using doxygen 1.4.2