Qwt User's Guide
svn
|
00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** 00002 * Qwt Widget Library 00003 * Copyright (C) 1997 Josef Wilgen 00004 * Copyright (C) 2002 Uwe Rathmann 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the Qwt License, Version 1.0 00008 *****************************************************************************/ 00009 00010 #ifndef QWT_PLOT_SCALE_ITEM_H 00011 #define QWT_PLOT_SCALE_ITEM_H 00012 00013 #include "qwt_global.h" 00014 #include "qwt_plot_item.h" 00015 #include "qwt_scale_draw.h" 00016 00017 class QPalette; 00018 00047 class QWT_EXPORT QwtPlotScaleItem: public QwtPlotItem 00048 { 00049 public: 00050 explicit QwtPlotScaleItem( 00051 QwtScaleDraw::Alignment = QwtScaleDraw::BottomScale, 00052 const double pos = 0.0 ); 00053 00054 virtual ~QwtPlotScaleItem(); 00055 00056 virtual int rtti() const; 00057 00058 void setScaleDiv( const QwtScaleDiv& ); 00059 const QwtScaleDiv& scaleDiv() const; 00060 00061 void setScaleDivFromAxis( bool on ); 00062 bool isScaleDivFromAxis() const; 00063 00064 void setPalette( const QPalette & ); 00065 QPalette palette() const; 00066 00067 void setFont( const QFont& ); 00068 QFont font() const; 00069 00070 void setScaleDraw( QwtScaleDraw * ); 00071 00072 const QwtScaleDraw *scaleDraw() const; 00073 QwtScaleDraw *scaleDraw(); 00074 00075 void setPosition( double pos ); 00076 double position() const; 00077 00078 void setBorderDistance( int numPixels ); 00079 int borderDistance() const; 00080 00081 void setAlignment( QwtScaleDraw::Alignment ); 00082 00083 virtual void draw( QPainter *p, 00084 const QwtScaleMap &xMap, const QwtScaleMap &yMap, 00085 const QRectF &rect ) const; 00086 00087 virtual void updateScaleDiv( const QwtScaleDiv &, const QwtScaleDiv & ); 00088 00089 private: 00090 class PrivateData; 00091 PrivateData *d_data; 00092 }; 00093 00094 #endif