CMS 3D CMS Logo

IgSoQtThumbWheel.h

Go to the documentation of this file.
00001 /**************************************************************************
00002  *
00003  *  This file is part of the Coin SoQt GUI binding library.
00004  *  Copyright (C) 1998-2000 by Systems in Motion.  All rights reserved.
00005  *
00006  *  This library is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU Lesser General Public License version
00008  *  2.1 as published by the Free Software Foundation.  See the file
00009  *  LICENSE.LGPL at the root directory of the distribution for all the
00010  *  details.
00011  *
00012  *  If you want to use Coin SoQt for applications not compatible with the
00013  *  LGPL, please contact SIM to acquire a Professional Edition License.
00014  *
00015  *  Systems in Motion, Prof Brochs gate 6, N-7030 Trondheim, NORWAY
00016  *  https://www.sim.no/ support@sim.no Voice: +47 22114160 Fax: +47 22207097
00017  *
00018  **************************************************************************/
00019 
00020 //  $Id: IgSoQtThumbWheel.h,v 1.1 2007/04/02 15:25:35 yana Exp $
00021 
00022 #ifndef IGSOQT_THUMBWHEEL_H
00023 #define IGSOQT_THUMBWHEEL_H
00024 
00025 #include "Iguana/Studio/interface/config.h"
00026 
00027 #include <qwidget.h>
00028 #include <qrangecontrol.h>
00029 
00030 class QPixmap;
00031 class IgSoAnyThumbWheel;
00032 
00033 // *************************************************************************
00034 
00035 class IGUANA_STUDIO_API IgSoQtThumbWheel : public QWidget, public QRangeControl
00036 {
00037   Q_OBJECT
00038 
00039 public:
00040   enum Orientation { Horizontal, Vertical };
00041 
00042   IgSoQtThumbWheel( QWidget * parent = 0, const char * name = 0 );
00043   IgSoQtThumbWheel( Orientation, QWidget * parent = 0, const char * name = 0 );
00044   ~IgSoQtThumbWheel(void);
00045 
00046   void setOrientation( Orientation );
00047   Orientation orientation(void) const;
00048 
00049   void setValue( float value );
00050   float value(void) const;
00051 
00052   void setEnabled( bool enable );
00053   bool isEnabled(void) const;
00054 
00055   enum boundaryHandling {
00056     CLAMP,
00057     MODULATE,
00058     ACCUMULATE
00059   };
00060   void setRangeBoundaryHandling( boundaryHandling handling );
00061   boundaryHandling getRangeBoundaryHandling(void) const;
00062 
00063   QSize sizeHint(void) const;
00064 
00065 signals:
00066   void wheelPressed(void);
00067   void wheelMoved(float value);
00068   void wheelReleased(void);
00069 
00070 protected:
00071   void paintEvent(QPaintEvent *);
00072 
00073   void mousePressEvent(QMouseEvent *);
00074   void mouseReleaseEvent(QMouseEvent *);
00075   void mouseMoveEvent(QMouseEvent *);
00076 
00077 private:
00078   void constructor( Orientation );
00079 
00080   IgSoQtThumbWheel( const IgSoQtThumbWheel & wheel );
00081   IgSoQtThumbWheel & operator = ( const IgSoQtThumbWheel & wheel );
00082 
00083   enum State { Idle, Dragging, Disabled } state;
00084 
00085   Orientation orient;
00086   float wheelValue, tempWheelValue;
00087   int mouseDownPos, mouseLastPos;
00088 
00089   void initWheel( int diameter, int width );
00090 
00091   IgSoAnyThumbWheel * wheel;
00092   QPixmap ** pixmaps;
00093   int numPixmaps;
00094   int currentPixmap;
00095 
00096 }; // class IgSoQtThumbWheel
00097 
00098 // *************************************************************************
00099 
00100 #endif // ! IGSOQT_THUMBWHEEL_H

Generated on Tue Jun 9 17:38:48 2009 for CMSSW by  doxygen 1.5.4