source: flair-src/trunk/tools/FlairGCS/src/Scrollbar.h@ 16

Last change on this file since 16 was 15, checked in by Bayard Gildas, 9 years ago

sources reformatted with flair-format-dir script

File size: 1.3 KB
Line 
1// %flair:license{
2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
4// %flair:license}
5#ifndef _SCROLLBAR_H
6#define _SCROLLBAR_H 1
7
8#include <qscrollbar.h>
9
10class ScrollBar : public QScrollBar {
11 Q_OBJECT
12
13public:
14 ScrollBar(QWidget *parent = NULL);
15 ScrollBar(Qt::Orientation, QWidget *parent = NULL);
16 ScrollBar(float minBase, float maxBase, Qt::Orientation o,
17 QWidget *parent = NULL);
18
19 void setInverted(bool);
20 bool isInverted(void) const;
21
22 float minBaseValue(void) const;
23 float maxBaseValue(void) const;
24
25 float minSliderValue(void) const;
26 float maxSliderValue(void) const;
27
28 int extent(void) const;
29
30Q_SIGNALS:
31 void sliderMoved(Qt::Orientation, float, float);
32 void valueChanged(Qt::Orientation, float, float);
33
34public Q_SLOTS:
35 virtual void setBase(float min, float max);
36 virtual void moveSlider(float min, float max);
37
38protected:
39 void sliderRange(int value, float &min, float &max) const;
40 int mapToTick(float) const;
41 float mapFromTick(int) const;
42
43private Q_SLOTS:
44 void catchValueChanged(int value);
45 void catchSliderMoved(int value);
46
47private:
48 void init(void);
49
50 bool d_inverted;
51 float d_minBase;
52 float d_maxBase;
53 int d_baseTicks;
54};
55
56#endif
Note: See TracBrowser for help on using the repository browser.