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

Slider Class Reference

#include <slider.h>

Collaboration diagram for Slider:

Collaboration graph
[legend]
List of all members.

Public Types

enum  mode {
  hue, sat, val, red,
  green, blue, alpha
}

Signals

void colorChanged (const rColor &)

Public Member Functions

 Slider (mode m=hue, QWidget *parent=0, const char *name=0, WFlags f=0)
 ~Slider ()
void setColor (const rColor &)
void setValue (int n)

Protected Member Functions

void drawContents (QPainter *)
void mouseMoveEvent (QMouseEvent *)
void mousePressEvent (QMouseEvent *)
void mouseReleaseEvent (QMouseEvent *)

Private Member Functions

void useVal (int)

Private Attributes

int maxValue
int curValue
QPixmap bg
QPixmap txt
rColor curCol
int iwidth
int iheight
int triang
bool mouseMoving
int displacement
mode Mode

Detailed Description

Instances of this class show individual components of a color and reflect the effect of changes to their values.


Member Enumeration Documentation

enum Slider::mode
 

Enumeration values:
hue 
sat 
val 
red 
green 
blue 
alpha 


Constructor & Destructor Documentation

Slider::Slider mode  m = hue,
QWidget *  parent = 0,
const char *  name = 0,
WFlags  f = 0
 

Constructs a Slider frame for use whith the mode m. The geometry for the Slider is derived from the currently used font geometry.

Here is the call graph for this function:

Slider::~Slider  ) 
 


Member Function Documentation

void Slider::colorChanged const rColor  )  [signal]
 

void Slider::drawContents QPainter *  p  )  [protected]
 

Reimplemeted from QFrame. Additional to the background pixmap a white and a black triangle are displayed, denoting the current value for this Slider.

void Slider::mouseMoveEvent QMouseEvent *  e  )  [protected]
 

Updates the current position of the Slider while the mouse button is held down.

Here is the call graph for this function:

void Slider::mousePressEvent QMouseEvent *  e  )  [protected]
 

Used if the slider should be gripped with the mouse. The Slider value will subsequently follow the horizontal mouse moves.

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

This event stops the movement of the Slider, if it ever began. In any case the Slider is set to the value given by the position of the mouse pointer at the time of the click. Too complicated? Try this: You clicked it, you got it.

Here is the call graph for this function:

void Slider::setColor const rColor nc  ) 
 

This sets the color, for which the slider will influence a component. A background pixmap is calculated based on the minimal and maximal values for this component.

Here is the call graph for this function:

void Slider::setValue int  n  )  [inline]
 

Updates the current value of the Slider tobe n.

void Slider::useVal int  z  )  [private]
 

Updates the current color according to the value that changed. Emits a signal with the new color as argument.

Here is the call graph for this function:


Member Data Documentation

QPixmap Slider::bg [private]
 

rColor Slider::curCol [private]
 

int Slider::curValue [private]
 

int Slider::displacement [private]
 

int Slider::iheight [private]
 

int Slider::iwidth [private]
 

int Slider::maxValue [private]
 

mode Slider::Mode [private]
 

bool Slider::mouseMoving [private]
 

int Slider::triang [private]
 

QPixmap Slider::txt [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