Go to the documentation of this file.00001
00002
00003
00004
00005
00009
00010
00011 #ifndef vectorButton_H_
00012 #define vectorButton_H_
00013
00014 #include "lgrGui.h"
00015
00016 #include <QtGui/QAbstractButton>
00017
00018 class QWidget;
00019 class QPolygon;
00020 class QPalette;
00021
00022
00023 namespace MAKLogger
00024 {
00025
00026 class DtVectorButton;
00027
00029 struct DtDrawButtonState
00030 {
00031 bool hasFocus;
00032 bool hasMouseOver;
00033 bool isDown;
00034 bool isEnabled;
00035 };
00036
00037 typedef void (*DtDrawButtonFunction)(QPainter& painter,const QPalette& pal,
00038 DtDrawButtonState& state);
00039
00041 class DT_DLL_LGRGUI DtVectorButton : public QAbstractButton
00042 {
00043 Q_OBJECT
00044
00045 public:
00046
00047 DtVectorButton(QWidget* parent);
00048
00049 DtDrawButtonFunction drawFunction() const;
00050 void setDrawFunction(DtDrawButtonFunction function);
00051
00052 protected:
00053
00054 virtual void enterEvent(QEvent*);
00055 virtual void leaveEvent(QEvent*);
00056 virtual void paintEvent( QPaintEvent* );
00057
00058 DtDrawButtonFunction myDrawFunction;
00059 };
00060
00062 class DT_DLL_LGRGUI DtVectorButtonStyles
00063 {
00064 public:
00065
00066 static void hideButton(QPainter& painter,const QPalette& pal,DtDrawButtonState& state);
00067
00068 static void drawButton(QPainter& painter,QPolygonF& points,
00069 QColor light,QColor mid,QColor dark,QColor fill);
00070
00071 static void leftBoundButton(QPainter& painter,const QPalette& pal,DtDrawButtonState& state,QRectF rect);
00072 static void leftArrowButton(QPainter& painter,const QPalette& pal,DtDrawButtonState& state);
00073 static void leftCircleButton(QPainter& painter, const QPalette& pal,DtDrawButtonState& state,QRectF rect);
00074
00075 static void rightBoundButton(QPainter& painter,const QPalette& pal,DtDrawButtonState& state,QRectF rect);
00076 static void rightArrowButton(QPainter& painter,const QPalette& pal,DtDrawButtonState& state);
00077 static void rightCircleButton(QPainter& painter, const QPalette& pal,DtDrawButtonState& state,QRectF rect);
00078
00079 static void fillArc( QPainter &painter, const QBrush& brush,const QPen& pen, QRectF top,int,int );
00080
00081 };
00082
00083 }
00084
00085 #endif