Main Page | Class List | Directories | File List | Class Members | File Members | Related Pages

slider.h

Go to the documentation of this file.
00001 // $Id: slider.h,v 1.2 2005/06/13 13:12:29 rcr_muc Exp $
00002 // slider with a coloured background
00003 // 2005-05-31 rcr
00004 
00005 #ifndef SLIDER_H
00006 #define SLIDER_H
00007 
00008 #include "rcolor.h"
00009 #include <qpixmap.h>
00010 #include <qframe.h>
00011 
00012 class QPainter;
00013 
00014 class Slider : public QFrame
00015 {
00016   Q_OBJECT
00017 
00018   int maxValue, curValue;
00019   QPixmap bg, txt;
00020 
00021   rColor curCol;
00022   int iwidth, iheight;
00023   int triang;
00024   bool mouseMoving;
00025   int displacement;
00026   void useVal( int ); // extra func, used by mouseMove and mouseUp
00027 public:
00028   enum mode { hue, sat, val, red, green, blue, alpha };
00029   Slider( mode m = hue, QWidget* parent = 0, const char* name = 0, WFlags f = 0 );
00030   ~Slider();
00031   void setColor( const rColor& );
00033   void setValue( int n ) { curValue = n; update(); }
00034 
00035 private:
00036   mode Mode;
00037 
00038 protected:
00039   void drawContents( QPainter* );
00040   void mouseMoveEvent( QMouseEvent* );
00041   void mousePressEvent( QMouseEvent* );
00042   void mouseReleaseEvent( QMouseEvent* );
00043 
00044 signals:
00045   void colorChanged( const rColor& );
00046 };
00047 
00048 
00049 #endif // SLIDER_H

Go back to rwm - the window manager's - Home page.
created 13 Jun 2005 for colordlg $Revision:1.1$ by Rolf C. Rönnau using doxygen 1.4.2