![]() |
Mixxx
|
00001 /*************************************************************************** 00002 wslidercomposed.h - description 00003 ------------------- 00004 begin : Tue Jun 25 2002 00005 copyright : (C) 2002 by Tue & Ken Haste Andersen 00006 email : haste@diku.dk 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef WSLIDERCOMPOSED_H 00019 #define WSLIDERCOMPOSED_H 00020 00021 #include "wabstractcontrol.h" 00022 #include <qstring.h> 00023 #include <qpixmap.h> 00024 //Added by qt3to4: 00025 #include <QPaintEvent> 00026 #include <QMouseEvent> 00033 class WSliderComposed : public WAbstractControl { 00034 Q_OBJECT 00035 public: 00036 WSliderComposed(QWidget *parent=0, float defaultValue=64.0); 00037 ~WSliderComposed(); 00038 void setup(QDomNode node); 00039 void setPixmaps(bool bHorizontal, const QString &filenameSlider, const QString &filenameHandle); 00040 void mouseMoveEvent(QMouseEvent *e); 00041 void mouseReleaseEvent(QMouseEvent *e); 00042 void mousePressEvent(QMouseEvent *e); 00043 void paintEvent(QPaintEvent *); 00044 void wheelEvent(QWheelEvent *e); 00045 public slots: 00046 void setValue(double); 00047 private: 00048 void unsetPixmaps(); 00049 00051 int m_iPos, m_iStartHandlePos, m_iStartMousePos; 00053 int m_iSliderLength; 00055 int m_iHandleLength; 00057 bool m_bHorizontal; 00059 bool m_bEventWhileDrag; 00061 bool m_bDrag; 00063 QPixmap *m_pSlider; 00065 QPixmap *m_pHandle; 00066 }; 00067 00068 #endif