Go to the documentation of this file.00001
00002
00003
00004
00005
00008
00009 #ifndef sliderBox_H_
00010 #define sliderBox_H_
00011
00012 #include "lgrGui.h"
00013
00014 #include <QtCore/QObject>
00015 #include <vlutil/vlSmartPointers.h>
00016
00017 class QRectF;
00018
00019 namespace MAKLogger
00020 {
00021
00022 class DtSliderBar;
00023 typedef DtBoost::shared_ptr<DtSliderBar> DtSliderBarSP;
00024 typedef DtBoost::weak_ptr<DtSliderBar> DtSliderBarWP;
00025
00027 class DT_DLL_LGRGUI DtSliderBox : public QObject
00028 {
00029 Q_OBJECT
00030
00031 public:
00032
00033 enum BoxOrientation
00034 {
00035 Left,
00036 Center,
00037 Right
00038 };
00039
00041 DtSliderBox(DtSliderBar* bar,float position,float width,float height);
00042
00044 virtual ~DtSliderBox();
00045
00047 QRectF bounds(QRectF viewport) const;
00048
00050 bool leftBox() const;
00051 bool rightBox() const;
00052
00053 float position() const { return myPosition;}
00054 float savedPosition() const { return mySavedPosition;}
00055 float width() const { return myWidth; }
00056 float height() const { return myHeight; }
00057
00058 inline bool selected() const { return mySelected; }
00059 inline bool pressed() const { return myPressed;}
00060 DtSliderBar* bar() { return myBar; }
00061 const DtSliderBar* bar() const { return myBar; }
00062 BoxOrientation orientation() const { return myOrientation; }
00063
00064 void savePosition();
00065 void setRelativePosition( float relPosition);
00066 void restorePosition();
00067
00069
00070
00071
00072
00073 public slots:
00074
00075 void setPosition( float position);
00076 void setWidth( float width);
00077 void setHeight( float height);
00078 void setSelected( bool selected);
00079 void setPressed( bool selected);
00080 void setOrientation( BoxOrientation);
00081 void setPositionNoEmit(float position);
00082
00083 signals:
00084 void positionChanged(float);
00085 void widthChanged(float);
00086 void heightChanged(float);
00087 void selectedChanged(bool);
00088 void pressedChanged(bool);
00089 void orientationChanged(BoxOrientation);
00090 protected:
00091
00092 float myPosition;
00093 float mySavedPosition;
00094 float myWidth;
00095 float myHeight;
00096
00097 bool mySelected;
00098 bool myPressed;
00099 DtSliderBar* myBar;
00100 BoxOrientation myOrientation;
00101
00102 };
00103
00104
00105
00106 }
00107
00108 #endif