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

KXYSelector Class Reference

#include <kselect.h>

Inheritance diagram for KXYSelector:

KHSSelector List of all members.

Signals

void valueChanged (int x, int y)

Public Methods

 KXYSelector (QWidget *parent=0, const char *name=0)
 ~KXYSelector ()
void setValues (int xPos, int yPos)
void setRange (int minX, int minY, int maxX, int maxY)
int xValue () const
int yValue () const
QRect contentsRect () const

Protected Methods

virtual void drawContents (QPainter *)
virtual void drawCursor (QPainter *p, int xp, int yp)
virtual void paintEvent (QPaintEvent *e)
virtual void mousePressEvent (QMouseEvent *e)
virtual void mouseMoveEvent (QMouseEvent *e)

Detailed Description

KXYSelector is the base class for other widgets which provides the ability to choose from a two-dimensional range of values. The currently chosen value is indicated by a cross. An example is the KHSSelector which allows to choose from a range of colors, and which is used in KColorDialog.

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

Definition at line 41 of file kselect.h.


Constructor & Destructor Documentation

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

Constructs a two-dimensional selector widget which has a value range of [0..100] in both directions.

KXYSelector::~KXYSelector  
 

Destructs the widget.


Member Function Documentation

QRect KXYSelector::contentsRect  
 

Returns:
the rectangle on which subclasses should draw.

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

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

Draw within contentsRect() only.

Reimplemented in KHSSelector.

virtual void KXYSelector::drawCursor QPainter *    p,
int    xp,
int    yp
[protected, virtual]
 

Override this function to draw the cursor which indicates the currently selected value pair.

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

@reimplemented

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

@reimplemented

virtual void KXYSelector::paintEvent QPaintEvent *    e [protected, virtual]
 

@reimplemented

void KXYSelector::setRange int    minX,
int    minY,
int    maxX,
int    maxY
 

Sets the range of possible values.

void KXYSelector::setValues int    xPos,
int    yPos
 

Sets the current values in horizontal and vertical direction.

void KXYSelector::valueChanged int    x,
int    y
[signal]
 

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

int KXYSelector::xValue   const [inline]
 

Returns:
the current value in horizontal direction.

Definition at line 69 of file kselect.h.

int KXYSelector::yValue   const [inline]
 

Returns:
the current value in vertical direction.

Definition at line 73 of file kselect.h.


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