Go to the documentation of this file.00001
00002
00003
00004
00005
00010
00011 #ifndef timeBar_H_
00012 #define timeBar_H_
00013
00014 #include "lgrGui.h"
00015 #include "lgrZoomableWidget.h"
00016
00017 #include <absoluteTime.h>
00018
00019 namespace MAKLogger
00020 {
00021 class DtValueSmoother;
00022 class DtLgrGuiModel;
00023
00026 class DT_DLL_LGRGUI DtTimelineBar : public DtLgrZoomableWidget
00027 {
00028 Q_OBJECT
00029
00030 public:
00032 DtTimelineBar(DtLgrGuiModel& model,QWidget* parent);
00033
00035 virtual ~DtTimelineBar();
00036
00037 DtAbsoluteTime firstTime() const;
00038 DtAbsoluteTime lastTime() const;
00039 DtAbsoluteTime currentTime() const;
00040 DtAbsoluteTime startTime() const;
00041 DtAbsoluteTime stopTime() const;
00042
00043 DtRelativeTime duration() const;
00044 DtRelativeTime playDuration() const;
00045
00046 int verticalMargin() const;
00047
00048 public slots:
00049
00050 void setStartStopTimePercentages(float,float);
00051
00053 void testForUpdate();
00054
00055 protected:
00056
00057 static DtRelativeTime textTickSize(DtRelativeTime duration);
00058
00059 virtual void paintEvent( QPaintEvent* );
00060 virtual void mouseReleaseEvent(QMouseEvent*);
00061 virtual void mouseMoveEvent( QMouseEvent* );
00062 virtual void mousePressEvent( QMouseEvent* );
00063 virtual void keyPressEvent( QKeyEvent* );
00064 virtual void contextMenuEvent(QContextMenuEvent * );
00065
00066
00067
00068
00069
00070
00071 virtual void updateCurrentTime(QPoint);
00072
00073 void draw(QPainter& painter,const QRect& boundingRect);
00074 void drawTicks(QPainter& painter,double,double);
00075 void drawBackground(QPainter& painter,double ,double );
00076
00077 double myDrawnCurrentTime;
00078 double myDrawnStartTime;
00079 double myDrawnStopTime;
00080 double myDrawnFirstVisibleTime;
00081 double myDrawnLastVisibleTime;
00082 int myHorizontalMargin;
00083 int myVerticalMargin;
00084
00085 DtAbsoluteTime myOnSelectionCurrentTime;
00086 bool myUpdateTimeFlag;
00087 bool mySelectingArea;
00088 DtValueSmoother* myValueSmoother;
00089
00090
00091
00092
00093
00094
00095
00096
00097 DtLgrGuiModel* myModel;
00098 };
00099
00100 }
00101
00102 #endif