blob: c313c697859eb0fdfee97a99ac2d7e75edb7f987 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#include "Component.hpp"
#include <algorithm> // std::max
#include <cmath>
namespace cgeditor {
class Scrollbar : public Component {
/// @brief Set to true if it is the horizontal scrollbar
bool IsHorizontal;
Element bg,bar;
double DragY,DragX;
bool Trigger;
/// @brief Canvas size cache used to reset on resize
double CanvasWidth, CanvasHeight;
public:
Scrollbar(Status* s,bool IsHorizontal);
void Refresh();
/// @brief Goto a given graphical coordinate (if possible using current scroll range)
void Focus(double XorY);
};
} // namespace cgeditor
|