Eneboo - Documentación para desarrolladores
|
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_WHEEL_H 00011 #define QWT_WHEEL_H 00012 00013 #include "qwt_global.h" 00014 #include "qwt_abstract_slider.h" 00015 00025 class QWT_EXPORT QwtWheel : public QwtAbstractSlider 00026 { 00027 Q_OBJECT 00028 Q_PROPERTY( double totalAngle READ totalAngle WRITE setTotalAngle ) 00029 Q_PROPERTY( double viewAngle READ viewAngle WRITE setViewAngle ) 00030 Q_PROPERTY( int tickCnt READ tickCnt WRITE setTickCnt ) 00031 Q_PROPERTY( int internalBorder READ internalBorder WRITE setInternalBorder ) 00032 Q_PROPERTY( double mass READ mass WRITE setMass ) 00033 00034 public: 00035 explicit QwtWheel(QWidget *parent = NULL); 00036 #if QT_VERSION < 0x040000 00037 explicit QwtWheel(QWidget *parent, const char *name); 00038 #endif 00039 virtual ~QwtWheel(); 00040 00041 virtual void setOrientation(Qt::Orientation); 00042 00043 double totalAngle() const; 00044 double viewAngle() const; 00045 int tickCnt() const; 00046 int internalBorder() const; 00047 00048 double mass() const; 00049 00050 void setTotalAngle (double angle); 00051 void setTickCnt(int cnt); 00052 void setViewAngle(double angle); 00053 void setInternalBorder(int width); 00054 void setMass(double val); 00055 void setWheelWidth( int w ); 00056 00057 virtual QSize sizeHint() const; 00058 virtual QSize minimumSizeHint() const; 00059 00060 protected: 00061 virtual void resizeEvent(QResizeEvent *e); 00062 virtual void paintEvent(QPaintEvent *e); 00063 00064 void layoutWheel( bool update = true ); 00065 void draw(QPainter *p, const QRect& update_rect); 00066 void drawWheel(QPainter *p, const QRect &r); 00067 void drawWheelBackground(QPainter *p, const QRect &r); 00068 void setColorArray(); 00069 00070 virtual void valueChange(); 00071 virtual void paletteChange( const QPalette &); 00072 00073 virtual double getValue(const QPoint &p); 00074 virtual void getScrollMode(const QPoint &p, 00075 int &scrollMode, int &direction); 00076 00077 private: 00078 void initWheel(); 00079 00080 class PrivateData; 00081 PrivateData *d_data; 00082 }; 00083 00084 #endif