class KXYSelector

# class KXYSelector | KXYSelector is the base class for other widgets which provides the ability to choose from a two-dimensional range of values. More...
Definition | `#include <kselect.h>`
Inherits | QWidget (qt) [public ]
Inherited by | KHSSelector
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### 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

#### Signals

- void valueChanged ( int x, int y )

#### Protected Methods

- virtual void drawContents ( QPainter * )
- virtual void drawCursor ( QPainter *p, int xp, int yp )
- virtual void virtual_hook ( int id, void* data )

## 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.

KXYSelector ( QWidget *parent=0, const char *name=0 ) | ### KXYSelector

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

~KXYSelector () | ### ~KXYSelector

Destructs the widget.

void setValues ( int xPos, int yPos ) | ### setValues

Sets the current values in horizontal and vertical direction.

void setRange ( int minX, int minY, int maxX, int maxY ) | ### setRange

Sets the range of possible values.

int xValue () | ### xValue

[const]

Returns: the current value in horizontal direction.

int yValue () | ### yValue

[const]

Returns: the current value in vertical direction.

QRect contentsRect () | ### contentsRect

[const]

Returns: the rectangle on which subclasses should draw.

void valueChanged ( int x, int y ) | ### valueChanged

[signal]

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

void drawContents ( QPainter * ) | ### drawContents

[protected virtual]

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

Draw within contentsRect() only.

void drawCursor ( QPainter *p, int xp, int yp ) | ### drawCursor

[protected virtual]

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

void paintEvent ( QPaintEvent *e ) | ### paintEvent

[protected virtual]

void mousePressEvent ( QMouseEvent *e ) | ### mousePressEvent

[protected virtual]

void mouseMoveEvent ( QMouseEvent *e ) | ### mouseMoveEvent

[protected virtual]

void virtual_hook ( int id, void* data ) | ### virtual_hook

[protected virtual]

Generated by: root on macppc.ports.openbsd.org on Sat Sep 6 10:36:37 2003, using kdoc 2.0a54.