Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

KSelector Class Reference

#include <kselect.h>

Inheritance diagram for KSelector:

KGradientSelector KValueSelector List of all members.

Signals

void valueChanged (int value)

Public Methods

 KSelector (QWidget *parent=0, const char *name=0)
 KSelector (Orientation o, QWidget *parent=0L, const char *name=0L)
Orientation orientation () const
QRect contentsRect () const
void setIndent (bool i)
bool indent () const
void setValue (int value)
int value () const
void setMinValue (int value)
int minValue () const
void setMaxValue (int value)
int maxValue () const

Protected Methods

virtual void drawContents (QPainter *)
virtual void drawArrow (QPainter *painter, bool show, const QPoint &pos)
virtual void valueChange ()
virtual void paintEvent (QPaintEvent *)
virtual void mousePressEvent (QMouseEvent *e)
virtual void mouseMoveEvent (QMouseEvent *e)

Detailed Description

KSelector is the base class for other widgets which provides the ability to choose from a one-dimensional range of values. An example is the KGradientSelector which allows to choose from a range of colors.

A custom drawing routine for the widget surface has to be provided by the subclass.

Definition at line 142 of file kselect.h.


Constructor & Destructor Documentation

KSelector::KSelector QWidget *    parent = 0,
const char *    name = 0
 

Constructs a horizontal one-dimensional selection widget.

KSelector::KSelector Orientation    o,
QWidget *    parent = 0L,
const char *    name = 0L
 

Constructs a one-dimensional selection widget with a given orientation.


Member Function Documentation

QRect KSelector::contentsRect  
 

Returns:
the rectangle on which subclasses should draw.

virtual void KSelector::drawArrow QPainter *    painter,
bool    show,
const QPoint &    pos
[protected, virtual]
 

Override this function to draw the cursor which indicates the current value. This function is always called twice, once with argument show=false to clear the old cursor, once with argument show=true to draw the new one.

virtual void KSelector::drawContents QPainter *    [protected, virtual]
 

Override this function to draw the contents of the control. The default implementation does nothing.

Draw only within contentsRect().

Reimplemented in KValueSelector, and KGradientSelector.

bool KSelector::indent   const [inline]
 

Returns:
whether the indent option is set.

Definition at line 184 of file kselect.h.

int KSelector::maxValue   const [inline]
 

Returns:
the max value.

Definition at line 220 of file kselect.h.

int KSelector::minValue   const [inline]
 

Returns:
the min value.

Definition at line 208 of file kselect.h.

virtual void KSelector::mouseMoveEvent QMouseEvent *    e [protected, virtual]
 

@reimplemented

virtual void KSelector::mousePressEvent QMouseEvent *    e [protected, virtual]
 

@reimplemented

Orientation KSelector::orientation   const [inline]
 

Returns:
the orientation of the widget.

Definition at line 167 of file kselect.h.

virtual void KSelector::paintEvent QPaintEvent *    [protected, virtual]
 

@reimplemented

void KSelector::setIndent bool    i [inline]
 

Sets the indent option of the widget to i. This determines whether a shaded frame is drawn.

Definition at line 179 of file kselect.h.

void KSelector::setMaxValue int    value [inline]
 

Sets the max value.

Definition at line 214 of file kselect.h.

References value().

void KSelector::setMinValue int    value [inline]
 

Sets the min value.

Definition at line 202 of file kselect.h.

References value().

void KSelector::setValue int    value [inline]
 

Sets the value.

Definition at line 190 of file kselect.h.

References value().

int KSelector::value   const [inline]
 

Returns:
the value.

Definition at line 196 of file kselect.h.

Referenced by setMaxValue(), setMinValue(), and setValue().

virtual void KSelector::valueChange   [protected, virtual]
 

@reimplemented

void KSelector::valueChanged int    value [signal]
 

This signal is emitted whenever the user chooses a value, e.g. by clicking with the mouse on the widget.


The documentation for this class was generated from the following file:
Generated on Wed Aug 13 23:30:22 2003 for kdelibs by doxygen1.2.18