24 #include <tqrangecontrol.h>
25 #include <tdelibs_export.h>
70 class TDEUI_EXPORT
KRuler :
public TQFrame
73 TQ_PROPERTY(
int minValue READ minValue WRITE setMinValue )
74 TQ_PROPERTY(
int maxValue READ maxValue WRITE setMaxValue )
75 TQ_PROPERTY(
int value READ value WRITE setValue )
76 TQ_PROPERTY(
bool showTinyMarks READ showTinyMarks WRITE setShowTinyMarks )
77 TQ_PROPERTY(
bool showLittleMarks READ showLittleMarks WRITE setShowLittleMarks )
78 TQ_PROPERTY(
bool showMediumMarks READ showMediumMarks WRITE setShowMediumMarks )
79 TQ_PROPERTY(
bool showBigMarks READ showBigMarks WRITE setShowBigMarks )
80 TQ_PROPERTY(
bool showPointer READ showPointer WRITE setShowPointer )
81 TQ_PROPERTY(
bool showEndLabel READ showEndLabel WRITE setShowEndLabel )
82 TQ_PROPERTY(
int tinyMarkDistance READ tinyMarkDistance WRITE setTinyMarkDistance )
83 TQ_PROPERTY(
int littleMarkDistance READ littleMarkDistance WRITE setLittleMarkDistance )
84 TQ_PROPERTY(
int mediumMarkDistance READ mediumMarkDistance WRITE setBigMarkDistance )
85 TQ_PROPERTY(
int bigMarkDistance READ bigMarkDistance WRITE setBigMarkDistance )
86 TQ_PROPERTY(
double pixelPerMark READ pixelPerMark WRITE setPixelPerMark )
87 TQ_PROPERTY(
bool lengthFixed READ lengthFixed WRITE setLengthFixed )
103 enum MetricStyle { Custom=0, Pixel, Inch, Millimetres, Centimetres, Metres };
113 KRuler(TQWidget *parent=0,
const char *name=0);
127 KRuler(Orientation orient, TQWidget *parent=0,
const char *name=0,
145 KRuler(Orientation orient,
int widgetWidth, TQWidget *parent=0,
146 const char *name=0, WFlags f=0);
160 void setMinValue(
int);
165 inline int minValue()
const;
173 void setMaxValue(
int);
178 inline int maxValue()
const;
186 void setRange(
int min,
int max);
197 inline int value()
const;
204 void setTinyMarkDistance(
int);
208 inline int tinyMarkDistance()
const;
215 void setLittleMarkDistance(
int);
220 inline int littleMarkDistance()
const;
228 void setMediumMarkDistance(
int);
229 inline int mediumMarkDistance()
const;
236 void setBigMarkDistance(
int);
240 inline int bigMarkDistance()
const;
245 void setShowTinyMarks(
bool);
246 bool showTinyMarks()
const;
250 void setShowLittleMarks(
bool);
251 bool showLittleMarks()
const;
255 void setShowMediumMarks(
bool);
256 bool showMediumMarks()
const;
260 void setShowBigMarks(
bool);
261 bool showBigMarks()
const;
265 void setShowEndMarks(
bool);
266 bool showEndMarks()
const;
270 void setShowPointer(
bool);
271 bool showPointer()
const;
278 void setValuePerLittleMark(
int) TDE_DEPRECATED;
284 void setValuePerMediumMark(
int) TDE_DEPRECATED;
290 void setValuePerBigMark(
int) TDE_DEPRECATED;
318 void setShowEndLabel(
bool);
319 bool showEndLabel()
const;
325 void setEndLabel(
const TQString&);
326 TQString endLabel()
const;
353 void setPixelPerMark(
double rate);
358 inline double pixelPerMark()
const;
378 void setLengthFixed(
bool fix);
379 bool lengthFixed()
const;
392 void slideUp(
int count = 1);
405 void slideDown(
int count = 1);
415 void setOffset(
int offset);
420 inline int offset()
const;
422 int endOffset()
const;
432 void slotNewValue(
int);
440 void slotNewOffset(
int);
442 void slotEndOffset(
int);
445 virtual void drawContents(TQPainter *);
450 TQRangeControl range;
477 virtual void virtual_hook(
int id,
void* data );
486 {
return range.minValue(); }
490 {
return range.maxValue(); }
493 KRuler::value()
const
494 {
return range.value(); }
505 KRuler::mediumMarkDistance()
const
int tinyMarkDistance() const
Returns the distance between tiny marks.
int offset() const
Returns the current ruler offset.
int bigMarkDistance() const
Returns the distance between big marks.
int littleMarkDistance() const
Returns the distance between little marks.
int minValue() const
Returns the minimal value of the ruler pointer.
int maxValue() const
Returns the maximal value of the ruler pointer.
double pixelPerMark() const
Returns the number of pixels between two base marks.
MetricStyle
The types of units used.