23#ifndef __TDESELECT_H__
24#define __TDESELECT_H__
27#include <tqrangecontrol.h>
30#include <tdelibs_export.h>
54 KXYSelector( TQWidget *parent=0,
const char *name=0 );
83 void setRange(
int minX,
int minY,
int maxX,
int maxY );
97 TQRect contentsRect()
const;
118 virtual void drawCursor( TQPainter *p,
int xp,
int yp );
120 virtual void paintEvent( TQPaintEvent *e );
121 virtual void mousePressEvent( TQMouseEvent *e );
122 virtual void mouseMoveEvent( TQMouseEvent *e );
123 virtual void wheelEvent( TQWheelEvent * );
131 void setPosition(
int xp,
int yp );
143 virtual void virtual_hook(
int id,
void* data );
145 class KXYSelectorPrivate;
146 KXYSelectorPrivate *d;
159class TDEUI_EXPORT
TDESelector :
public TQWidget,
public TQRangeControl
170 TDESelector( TQWidget *parent=0,
const char *name=0 );
175 TDESelector( Orientation o, TQWidget *parent = 0L,
const char *name = 0L );
185 {
return _orientation; }
190 TQRect contentsRect()
const;
208 { TQRangeControl::setValue(
value); }
214 {
return TQRangeControl::value(); }
220 { TQRangeControl::setMinValue(
value); }
226 {
return TQRangeControl::minValue(); }
232 { TQRangeControl::setMaxValue(
value); }
238 {
return TQRangeControl::maxValue(); }
262 virtual void drawArrow( TQPainter *painter,
bool show,
const TQPoint &pos );
264 virtual void valueChange();
265 virtual void paintEvent( TQPaintEvent * );
266 virtual void mousePressEvent( TQMouseEvent *e );
267 virtual void mouseMoveEvent( TQMouseEvent *e );
268 virtual void wheelEvent( TQWheelEvent * );
271 TQPoint calcArrowPos(
int val );
272 void moveArrow(
const TQPoint &pos );
274 Orientation _orientation;
278 virtual void virtual_hook(
int id,
void* data );
280 class TDESelectorPrivate;
281 TDESelectorPrivate *d;
297 TQ_PROPERTY( TQColor firstColor READ firstColor WRITE
setFirstColor )
298 TQ_PROPERTY( TQColor secondColor READ secondColor WRITE setSecondColor )
299 TQ_PROPERTY( TQString firstText READ firstText WRITE
setFirstText )
300 TQ_PROPERTY( TQString secondText READ secondText WRITE setSecondText )
320 void setColors(
const TQColor &col1,
const TQColor &col2 )
321 { color1 = col1; color2 = col2; update();}
322 void setText(
const TQString &t1,
const TQString &t2 )
323 { text1 = t1; text2 = t2; update(); }
329 { color1 = col; update(); }
330 void setSecondColor(
const TQColor &col )
331 { color2 = col; update(); }
337 { text1 = t; update(); }
338 void setSecondText(
const TQString &t )
339 { text2 = t; update(); }
341 const TQColor firstColor()
const
343 const TQColor secondColor()
const
346 const TQString firstText()
const
348 const TQString secondText()
const
353 virtual void drawContents( TQPainter * );
354 virtual TQSize minimumSize()
const
355 {
return sizeHint(); }
365 virtual void virtual_hook(
int id,
void* data );
367 class KGradientSelectorPrivate;
368 KGradientSelectorPrivate *d;
void setFirstColor(const TQColor &col)
Set each color on its own.
KGradientSelector(TQWidget *parent=0, const char *name=0)
Constructs a horizontal color selector which contains a gradient between white and black.
void setFirstText(const TQString &t)
Set each description on its own.
void setColors(const TQColor &col1, const TQColor &col2)
Sets the two colors which span the gradient.
void setRange(int minX, int minY, int maxX, int maxY)
Sets the range of possible values.
virtual void drawCursor(TQPainter *p, int xp, int yp)
Override this function to draw the cursor which indicates the currently selected value pair.
void setValues(int xPos, int yPos)
Sets the current values in horizontal and vertical direction.
void setXValue(int xPos)
Sets the current horizontal value.
void valuesFromPosition(int x, int y, int &xVal, int &yVal) const
Converts a pixel position to its corresponding values.
virtual void drawContents(TQPainter *)
Override this function to draw the contents of the widget.
KXYSelector(TQWidget *parent=0, const char *name=0)
Constructs a two-dimensional selector widget which has a value range of [0..100] in both directions.
void valueChanged(int x, int y)
This signal is emitted whenever the user chooses a value, e.g.
void setYValue(int yPos)
Sets the current vertical value.
Orientation orientation() const
void valueChanged(int value)
This signal is emitted whenever the user chooses a value, e.g.
void setMinValue(int value)
Sets the min value.
virtual void drawContents(TQPainter *)
Override this function to draw the contents of the control.
void setValue(int value)
Sets the value.
void setIndent(bool i)
Sets the indent option of the widget to i.
TDESelector(TQWidget *parent=0, const char *name=0)
Constructs a horizontal one-dimensional selection widget.
void setMaxValue(int value)
Sets the max value.
virtual void drawArrow(TQPainter *painter, bool show, const TQPoint &pos)
Override this function to draw the cursor which indicates the current value.