Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Opie::Ui::OXYSelector Class Reference

#include </home/clem/local/src/opie/libopie2/opieui/oselector.h>

Inheritance diagram for Opie::Ui::OXYSelector:

Inheritance graph
[legend]
List of all members.

Signals

void valueChanged (int x, int y)

Public Member Functions

 OXYSelector (QWidget *parent=0, const char *name=0)
 ~OXYSelector ()
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 Member Functions

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)
virtual void wheelEvent (QWheelEvent *)
void valuesFromPosition (int x, int y, int &xVal, int &yVal) const

Private Member Functions

void setPosition (int xp, int yp)

Private Attributes

int px
int py
int xPos
int yPos
int minX
int maxX
int minY
int maxY
QPixmap store
OXYSelectorPrivate * d

Detailed Description

OXYSelector 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 OHSSelector which allows to choose from a range of colors, and which is used in OColorDialog.

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

Definition at line 44 of file oselector.h.


Constructor & Destructor Documentation

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

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

Definition at line 41 of file oselector.cpp.

References maxX, maxY, minX, minY, store, STORE_W2, xPos, and yPos.

OXYSelector::~OXYSelector  ) 
 

Destructs the widget.

Definition at line 55 of file oselector.cpp.


Member Function Documentation

QRect OXYSelector::contentsRect  )  const
 

Returns:
the rectangle on which subclasses should draw.

Definition at line 90 of file oselector.cpp.

References height, and width.

Referenced by Opie::Ui::OHSSelector::drawContents(), and Opie::Ui::OHSSelector::drawPalette().

void OXYSelector::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 Opie::Ui::OHSSelector.

Definition at line 196 of file oselector.cpp.

Referenced by paintEvent().

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

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

Definition at line 200 of file oselector.cpp.

Referenced by paintEvent(), and setPosition().

void OXYSelector::mouseMoveEvent QMouseEvent *  e  )  [protected, virtual]
 

Definition at line 131 of file oselector.cpp.

References setValues(), valueChanged(), valuesFromPosition(), xPos, and yPos.

void OXYSelector::mousePressEvent QMouseEvent *  e  )  [protected, virtual]
 

Definition at line 122 of file oselector.cpp.

References setValues(), valueChanged(), valuesFromPosition(), xPos, and yPos.

void OXYSelector::paintEvent QPaintEvent *  e  )  [protected, virtual]
 

Definition at line 95 of file oselector.cpp.

References bitBlt(), drawContents(), drawCursor(), height, px, py, store, STORE_W, STORE_W2, TRUE, and width.

void OXYSelector::setPosition int  xp,
int  yp
[private]
 

Definition at line 170 of file oselector.cpp.

References bitBlt(), drawCursor(), height, px, py, store, STORE_W, STORE_W2, and width.

Referenced by setValues().

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

Sets the range of possible values.

Definition at line 59 of file oselector.cpp.

References maxX, maxY, minX, minY, px, and py.

Referenced by Opie::Ui::OHSSelector::OHSSelector().

void OXYSelector::setValues int  xPos,
int  yPos
 

Sets the current values in horizontal and vertical direction.

Definition at line 69 of file oselector.cpp.

References height, maxX, maxY, minX, minY, setPosition(), width, xPos, and yPos.

Referenced by mouseMoveEvent(), mousePressEvent(), and wheelEvent().

void Opie::Ui::OXYSelector::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.

Referenced by mouseMoveEvent(), mousePressEvent(), and wheelEvent().

void OXYSelector::valuesFromPosition int  x,
int  y,
int &  xVal,
int &  yVal
const [protected]
 

Converts a pixel position to its corresponding values.

Definition at line 154 of file oselector.cpp.

References height, maxX, maxY, minX, minY, and width.

Referenced by mouseMoveEvent(), and mousePressEvent().

void OXYSelector::wheelEvent QWheelEvent *   )  [protected, virtual]
 

Definition at line 140 of file oselector.cpp.

References Qt::Horizontal, setValues(), valueChanged(), xPos, xValue(), yPos, and yValue().

int Opie::Ui::OXYSelector::xValue  )  const [inline]
 

Returns:
the current value in horizontal direction.

Definition at line 72 of file oselector.h.

Referenced by wheelEvent().

int Opie::Ui::OXYSelector::yValue  )  const [inline]
 

Returns:
the current value in vertical direction.

Definition at line 76 of file oselector.h.

Referenced by wheelEvent().


Member Data Documentation

OXYSelectorPrivate* Opie::Ui::OXYSelector::d [private]
 

Reimplemented in Opie::Ui::OHSSelector.

Definition at line 137 of file oselector.h.

int Opie::Ui::OXYSelector::maxX [private]
 

Definition at line 131 of file oselector.h.

Referenced by OXYSelector(), setRange(), setValues(), and valuesFromPosition().

int Opie::Ui::OXYSelector::maxY [private]
 

Definition at line 133 of file oselector.h.

Referenced by OXYSelector(), setRange(), setValues(), and valuesFromPosition().

int Opie::Ui::OXYSelector::minX [private]
 

Definition at line 130 of file oselector.h.

Referenced by OXYSelector(), setRange(), setValues(), and valuesFromPosition().

int Opie::Ui::OXYSelector::minY [private]
 

Definition at line 132 of file oselector.h.

Referenced by OXYSelector(), setRange(), setValues(), and valuesFromPosition().

int Opie::Ui::OXYSelector::px [private]
 

Definition at line 126 of file oselector.h.

Referenced by paintEvent(), setPosition(), and setRange().

int Opie::Ui::OXYSelector::py [private]
 

Definition at line 127 of file oselector.h.

Referenced by paintEvent(), setPosition(), and setRange().

QPixmap Opie::Ui::OXYSelector::store [private]
 

Definition at line 134 of file oselector.h.

Referenced by OXYSelector(), paintEvent(), and setPosition().

int Opie::Ui::OXYSelector::xPos [private]
 

Definition at line 128 of file oselector.h.

Referenced by mouseMoveEvent(), mousePressEvent(), OXYSelector(), setValues(), and wheelEvent().

int Opie::Ui::OXYSelector::yPos [private]
 

Definition at line 129 of file oselector.h.

Referenced by mouseMoveEvent(), mousePressEvent(), OXYSelector(), setValues(), and wheelEvent().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 18:02:01 2005 for OPIE by  doxygen 1.4.2