27 #include <tqrangecontrol.h>
30 #include <kdelibs_export.h>
46 Q_PROPERTY(
int xValue READ xValue WRITE setXValue )
47 Q_PROPERTY(
int yValue READ yValue WRITE setYValue )
54 KXYSelector( TQWidget *parent=0,
const char *name=0 );
66 void setValues(
int xPos,
int yPos );
72 void setXValue(
int xPos );
78 void setYValue(
int yPos );
83 void setRange(
int minX,
int minY,
int maxX,
int maxY );
97 TQRect contentsRect()
const;
104 void valueChanged(
int x,
int y );
113 virtual void drawContents( TQPainter * );
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 * );
128 void valuesFromPosition(
int x,
int y,
int& xVal,
int& yVal )
const;
131 void setPosition(
int xp,
int yp );
143 virtual void virtual_hook(
int id,
void* data );
145 class KXYSelectorPrivate;
146 KXYSelectorPrivate *d;
159 class KDEUI_EXPORT
KSelector :
public TQWidget,
public TQRangeControl
162 Q_PROPERTY(
int value READ value WRITE setValue )
163 Q_PROPERTY(
int minValue READ minValue WRITE setMinValue )
164 Q_PROPERTY(
int maxValue READ maxValue WRITE setMaxValue )
170 KSelector( TQWidget *parent=0,
const char *name=0 );
175 KSelector( 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(); }
245 void valueChanged(
int value );
254 virtual void drawContents( TQPainter * );
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 KSelectorPrivate;
297 Q_PROPERTY( TQColor firstColor READ firstColor WRITE setFirstColor )
298 Q_PROPERTY( TQColor secondColor READ secondColor WRITE setSecondColor )
299 Q_PROPERTY( TQString firstText READ firstText WRITE setFirstText )
300 Q_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
354 virtual TQSize minimumSize()
const
355 {
return sizeHint(); }
365 virtual void virtual_hook(
int id,
void* data );
367 class KGradientSelectorPrivate;
368 KGradientSelectorPrivate *d;
372 #endif // __KSELECT_H__
virtual void drawContents(TQPainter *)
Override this function to draw the contents of the control.
void setFirstColor(const TQColor &col)
Set each color on its own.
void setFirstText(const TQString &t)
Set each description on its own.
void setValue(int value)
Sets the value.
Orientation orientation() const
The KGradientSelector widget allows the user to choose from a one-dimensional range of colors which i...
void setMaxValue(int value)
Sets the max value.
void setIndent(bool i)
Sets the indent option of the widget to i.
void setColors(const TQColor &col1, const TQColor &col2)
Sets the two colors which span the gradient.
KXYSelector is the base class for other widgets which provides the ability to choose from a two-dimen...
void setMinValue(int value)
Sets the min value.
KSelector is the base class for other widgets which provides the ability to choose from a one-dimensi...