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

qwt_plot_canvas.h

Go to the documentation of this file.
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_CANVAS_H
00011 #define QWT_PLOT_CANVAS_H
00012 
00013 #include <qframe.h>
00014 #include <qpen.h>
00015 #include "qwt_global.h"
00016 #include "qwt.h"
00017 
00024 class QWT_EXPORT QwtPlotCanvas : public QFrame
00025 {
00026   Q_OBJECT
00027   friend class QwtPlot;
00028 public:
00029     void enableOutline(bool tf);
00030     bool outlineEnabled() const;
00031 
00032     void setOutlinePen(const QPen &p);
00033     const QPen& outlinePen() const;
00034 
00035     void setOutlineStyle(Qwt::Shape os);
00036     Qwt::Shape outlineStyle() const;
00037     
00038 signals:
00044     void mousePressed(const QMouseEvent &e);
00045 
00051     void mouseReleased(const QMouseEvent &e);
00052     
00058     void mouseMoved(const QMouseEvent &e);
00059 
00060 protected:
00061     QwtPlotCanvas(QwtPlot *);
00062 
00063   virtual void frameChanged();
00064   virtual void drawContents(QPainter *);
00065 
00066     virtual void mousePressEvent(QMouseEvent *e);
00067     virtual void mouseReleaseEvent(QMouseEvent *e);
00068     virtual void mouseMoveEvent(QMouseEvent *e);
00069 
00070 private:    
00071     void drawOutline(QPainter &p);
00072 
00073     bool d_outlineEnabled;
00074     bool d_outlineActive;
00075     bool d_mousePressed;
00076     Qwt::Shape d_outline;
00077 
00078     QPen d_pen;
00079     QPoint d_entryPoint;
00080     QPoint d_lastPoint;
00081 };
00082 
00083 #endif

Generated on Fri Nov 7 14:11:45 2003 for Qwt Developer's Guide by doxygen 1.3.2