track labels
[mussa.git] / qui / ScrollableScene.hpp
1 #ifndef _SCROLLABLE_SCENE_H_
2 #define _SCROLLABLE_SCENE_H_
3
4 #include <QScrollBar>
5 #include <QWidget>
6 #include "qui/PathScene.hpp"
7
8 class ScrollableScene : public QWidget
9 {
10   Q_OBJECT 
11
12 public:
13   ScrollableScene(QWidget *parent=0);
14   PathScene path_scene;
15
16   PathScene& scene() { return path_scene; }
17 public slots:
18   //! update the scrollbar with current viewport information
19   void updateScrollBar();
20   //! update scene with the properly scalled scrollbar offset
21   void setViewportCenter(int x);
22
23 private:
24   QScrollBar viewportBar;
25   int thumb;
26
27   float range;
28   float scale;
29 };
30
31 #endif