31#define RULER_THICKNESS 20
35class KisRuler : public TQFrame {
38 typedef TQFrame super;
41 KisRuler(TQt::Orientation, TQWidget *parent = 0, const char *name = 0);
45 KoUnit::Unit unit() const;
48 void setZoom( double zoom);
49 void updatePointer(TQ_INT32 x, TQ_INT32 y);
50 void updateVisibleArea(TQ_INT32 xpos, TQ_INT32 ypos);
51 void setUnit(KoUnit::Unit u);
56 virtual void paintEvent(TQPaintEvent *e);
57 virtual void resizeEvent(TQResizeEvent *e);
58 virtual void styleChange(TQStyle& oldStyle);
59 virtual void paletteChange( const TQPalette& oldPalette);
61 void recalculateSize();
63 void initMarker(TQ_INT32 w, TQ_INT32 h);
64 void drawNums(TQPainter *gc, TQ_INT32 x, TQ_INT32 y, TQString& num, bool orientationHoriz);
68 TQt::Orientation m_orientation;
69 TQ_INT32 m_firstVisible;
70 TQ_INT32 m_currentPosition;
71 TQPixmap *m_pixmapBuffer;
72 TQPixmap m_pixmapMarker;
73 TQPixmap m_pixmapNums;
77 static const char *m_nums[];
|