Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

# qwt_grid.h

    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_GRID_H
    00011 #define QWT_GRID_H
    00012
    00013 #include <qpen.h>
    00014 #include "qwt_global.h"
    00015 #include "qwt_dimap.h"
    00016 #include "qwt_scldiv.h"
    00017
    00018 class QPainter;
    00019
    00032 class QWT_EXPORT QwtGrid
    00033 {
    00034 public:
    00035
    00036     QwtGrid();
    00037     virtual ~QwtGrid();
    00038
    00039     virtual void draw(QPainter *p, const QRect &r,
    00040         const QwtDiMap &mx, const QwtDiMap &my) const;
    00041
    00042     void enableX(bool tf);
    00043     bool xEnabled() const;
    00044
    00045     void enableY(bool tf);
    00046     bool yEnabled() const;
    00047
    00048     void enableXMin(bool tf);
    00049     bool xMinEnabled() const;
    00050
    00051     void enableYMin(bool tf);
    00052     bool yMinEnabled() const;
    00053
    00054     void setXDiv(const QwtScaleDiv &sx);
    00055     const QwtScaleDiv &xScaleDiv() const;
    00056
    00057     void setYDiv(const QwtScaleDiv &sy);
    00058     const QwtScaleDiv &yScaleDiv() const;
    00059
    00060     void setPen(const QPen &p);
    00061
    00062     void setMajPen(const QPen &p);
    00063     const QPen& majPen() const;
    00064
    00065     void setMinPen(const QPen &p);
    00066     const QPen& minPen() const;
    00067
    00068
    00069 protected:
    00070     virtual void gridChanged();
    00071
    00072 private:
    00073
    00074     bool d_xEnabled;
    00075     bool d_yEnabled;
    00076     bool d_xMinEnabled;
    00077     bool d_yMinEnabled;
    00078
    00079     QwtScaleDiv d_sdx;
    00080     QwtScaleDiv d_sdy;
    00081
    00082     QPen d_majPen;
    00083     QPen d_minPen;
    00084 };
    00085
    00086 #endif