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

Opie::Ui::OSelector Class Reference

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

Inheritance diagram for Opie::Ui::OSelector:

Inheritance graph
[legend]
List of all members.

Signals

void valueChanged (int value)

Public Member Functions

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

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)
virtual void wheelEvent (QWheelEvent *)

Properties

int value
int minValue
int maxValue

Private Member Functions

QPoint calcArrowPos (int val)
void moveArrow (const QPoint &pos)

Private Attributes

Orientation _orientation
bool _indent
OSelectorPrivate * d

Detailed Description

OSelector is the base class for other widgets which provides the ability to choose from a one-dimensional range of values. An example is the OGradientSelector 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 151 of file oselector.h.


Constructor & Destructor Documentation

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

Constructs a horizontal one-dimensional selection widget.

Definition at line 217 of file oselector.cpp.

References _indent, _orientation, and TRUE.

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

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

Definition at line 224 of file oselector.cpp.

References _indent, _orientation, and TRUE.

OSelector::~OSelector  ) 
 

Definition at line 232 of file oselector.cpp.


Member Function Documentation

QPoint OSelector::calcArrowPos int  val  )  [private]
 

Definition at line 323 of file oselector.cpp.

References height, maxValue(), minValue(), orientation(), p, and width.

Referenced by paintEvent(), and valueChange().

QRect OSelector::contentsRect  )  const
 

Returns:
the rectangle on which subclasses should draw.

Definition at line 236 of file oselector.cpp.

References height, orientation(), and width.

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

void OSelector::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.

Definition at line 346 of file oselector.cpp.

References orientation().

Referenced by paintEvent(), and valueChange().

void OSelector::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 Opie::Ui::OGradientSelector, and Opie::Ui::OValueSelector.

Definition at line 343 of file oselector.cpp.

Referenced by paintEvent().

bool Opie::Ui::OSelector::indent  )  const [inline]
 

Returns:
whether the indent option is set.

Definition at line 193 of file oselector.h.

References _indent.

Referenced by paintEvent().

int Opie::Ui::OSelector::maxValue  )  const [inline]
 

Returns:
the max value.

Definition at line 235 of file oselector.h.

Referenced by calcArrowPos(), and moveArrow().

int Opie::Ui::OSelector::minValue  )  const [inline]
 

Returns:
the min value.

Definition at line 220 of file oselector.h.

Referenced by calcArrowPos(), and moveArrow().

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

Definition at line 275 of file oselector.cpp.

References moveArrow().

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

Definition at line 270 of file oselector.cpp.

References moveArrow().

void OSelector::moveArrow const QPoint &  pos  )  [private]
 

Definition at line 303 of file oselector.cpp.

References height, maxValue(), minValue(), orientation(), setValue(), val, valueChanged(), and width.

Referenced by mouseMoveEvent(), and mousePressEvent().

Orientation Opie::Ui::OSelector::orientation  )  const [inline]
 

Returns:
the orientation of the widget.

Definition at line 176 of file oselector.h.

References _orientation.

Referenced by calcArrowPos(), contentsRect(), drawArrow(), Opie::Ui::OGradientSelector::drawContents(), Opie::Ui::OValueSelector::drawPalette(), moveArrow(), and paintEvent().

void OSelector::paintEvent QPaintEvent *   )  [protected, virtual]
 

Definition at line 244 of file oselector.cpp.

References calcArrowPos(), drawArrow(), drawContents(), height, indent(), orientation(), pos, TRUE, value(), and width.

void Opie::Ui::OSelector::setIndent bool  i  )  [inline]
 

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

Definition at line 188 of file oselector.h.

References _indent.

void Opie::Ui::OSelector::setMaxValue int  value  )  [inline]
 

Sets the max value.

Definition at line 227 of file oselector.h.

void Opie::Ui::OSelector::setMinValue int  value  )  [inline]
 

Sets the min value.

Definition at line 212 of file oselector.h.

void Opie::Ui::OSelector::setValue int  value  )  [inline]
 

Sets the value.

Definition at line 199 of file oselector.h.

Referenced by moveArrow(), and wheelEvent().

int Opie::Ui::OSelector::value  )  const [inline]
 

Returns:
the value.

Definition at line 205 of file oselector.h.

Referenced by paintEvent(), valueChange(), and wheelEvent().

void OSelector::valueChange  )  [protected, virtual]
 

Definition at line 287 of file oselector.cpp.

References calcArrowPos(), drawArrow(), FALSE, pos, TRUE, and value().

void Opie::Ui::OSelector::valueChanged int  value  )  [signal]
 

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

Referenced by moveArrow(), and wheelEvent().

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

Definition at line 280 of file oselector.cpp.

References setValue(), val, value(), and valueChanged().


Member Data Documentation

bool Opie::Ui::OSelector::_indent [private]
 

Definition at line 288 of file oselector.h.

Referenced by indent(), OSelector(), and setIndent().

Orientation Opie::Ui::OSelector::_orientation [private]
 

Definition at line 287 of file oselector.h.

Referenced by orientation(), and OSelector().

OSelectorPrivate* Opie::Ui::OSelector::d [private]
 

Reimplemented in Opie::Ui::OGradientSelector, and Opie::Ui::OValueSelector.

Definition at line 291 of file oselector.h.


Property Documentation

int Opie::Ui::OSelector::maxValue [read, write]
 

Definition at line 156 of file oselector.h.

int Opie::Ui::OSelector::minValue [read, write]
 

Definition at line 155 of file oselector.h.

int Opie::Ui::OSelector::value [read, write]
 

Definition at line 153 of file oselector.h.


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