boundsSlider.h
Go to the documentation of this file.
00001 /******************************************************************************
00002 ** Copyright (c) 1992-2010 VT MAK
00003 ** All rights reserved.
00004 ******************************************************************************/
00005 
00008 
00009 #ifndef boundsSlider_H_
00010 #define boundsSlider_H_
00011 
00012 #include "lgrGui.h"
00013 #include "dragComponent.h"
00014 #include "multiBoxSlider.h"
00015 #include "lgrZoomableWidget.h"
00016 
00017 #include <list>
00018 
00019 #include <QtGui/QMatrix>
00020 #include <QtGui/QWidget>
00021 
00022 namespace MAKLogger
00023 {
00024 
00027    class DT_DLL_LGRGUI DtBoundsSlider : public DtLgrZoomableWidget, 
00028       public DtMultiBoxSlider, public DtDragComponent
00029    {
00030       Q_OBJECT
00031 
00032       Q_PROPERTY(float start READ start WRITE setStart)
00033          Q_PROPERTY(float end   READ end   WRITE setEnd)
00034 
00035    public:
00036       DtBoundsSlider(float start = 0.0f, float end = 0.0f, QWidget* p = 0);
00037 
00038       float start() const;
00039       float end()   const;
00040 
00041       inline bool leftSelected()  const;
00042       inline bool rightSelected() const;
00043 
00044       void setBarColors(QColor top,QColor bottom);
00045 
00046       virtual float minimumDistance() const;
00047       virtual void  setMinimumDistance(float);
00048       virtual void  saveMinimumDistance();
00049       virtual void  restoreMinimumDistance();
00050 
00051    public slots:
00052 
00055       void setStart(float startPosition);
00056 
00059       void setEnd(float endPosition);
00060 
00064       void setStartAndEnd(float startPosition,float endPosition);
00065       void setStartAndEndNoEmit(float,float);
00066 
00067       void setLeftSelection(bool);
00068       void setRightSelection(bool);
00069 
00071       void resetStart();
00073       void resetEnd();
00074 
00075    protected slots:
00076 
00079       void startBoxMoved(float startPosition);
00080 
00083       void endBoxMoved(float endPosition);
00084 
00085 signals:
00086       void startAndEndChanged(float,float);
00087       void leftSelectionChanged(bool);
00088       void rightSelectionChanged(bool);
00089 
00090    protected:
00091 
00092       virtual void paintEvent( QPaintEvent* );
00093       virtual void mouseDoubleClickEvent(QMouseEvent* e);
00094       virtual void mouseReleaseEvent(QMouseEvent*);
00095       virtual void mouseMoveEvent( QMouseEvent* );
00096       virtual void mousePressEvent( QMouseEvent* );
00097       
00098       virtual void draw(QPainter& painter);
00099 
00100       virtual void drawBar(QPainter& painter,DtSliderBar* bar) const;
00101       virtual void drawBox(QPainter& painter,DtSliderBox* box) const;   
00102 
00103       float myStart;
00104       float myEnd;
00105 
00106       DtSliderBox* myLeftBox;
00107       DtSliderBox* myRightBox;
00108 
00109       QMatrix myDrawnMatrix;
00110       QColor myTopColor;
00111       QColor myBottomColor;
00112    };
00113 
00114 }
00115 
00116 #endif

Document ID: Generated on Tue Oct 11 19:41:03 EDT 2011 from SVN revision 107422
Copyright © 2005-2011 VT MÄK Inc. All Rights Reserved (www.mak.com)