Simple GUI Library
scroll_bar.h
Go to the documentation of this file.
1/**
2 * @author Nikita Mochalov (github.com/tralf-strues)
3 * @file scroll_bar.h
4 * @date 2021-12-12
5 *
6 * @copyright Copyright (c) 2021
7 */
8
9#pragma once
10
11#include "control.h"
12
13namespace Sgl
14{
15 class ScrollBar : public Control
16 {
17 public:
18 ScrollBar(Orientation orientation, float rangeMin, float rangeMax);
19
20 Orientation getOrientation() const;
21
22 float getRangeMin() const;
23 void setRangeMin(float min);
24
25 float getRangeMax() const;
26 void setRangeMax(float max);
27
28 float getValue() const;
29 void setValue(float value);
30
31 float getIncrement() const;
32 void setIncrement(float increment);
33
34 float getVisibleRange() const;
35 void setVisibleRange(float visibleRange);
36
37 void setOnPropertyChange(Sml::PropertyChangeListener<float>* listener);
38 Sml::PropertyChangeListener<float>* getOnPropertyChange(); // TODO: get rid of
39
40 private:
41 const Orientation m_Orientation;
42
43 float m_RangeMin = 0;
44 float m_RangeMax = 0;
45 float m_Value = 0;
46
47 float m_Increment = 0;
48 float m_VisibleRange = 0;
49
50 Sml::PropertyChangeListener<float>* m_PropertyChangeListener = nullptr;
51 };
52};