2013-07-03 01:01:58 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../GuiComponent.h"
|
|
|
|
|
|
|
|
class ScrollableContainer : public GuiComponent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ScrollableContainer(Window* window);
|
|
|
|
|
2013-07-10 11:29:43 +00:00
|
|
|
Eigen::Vector2d getScrollPos() const;
|
|
|
|
void setScrollPos(const Eigen::Vector2d& pos);
|
2013-07-03 01:01:58 +00:00
|
|
|
void setAutoScroll(int delay, double speed); //Use 0 for speed to disable.
|
|
|
|
void resetAutoScrollTimer();
|
|
|
|
|
|
|
|
void update(int deltaTime) override;
|
2013-07-10 11:29:43 +00:00
|
|
|
void render(const Eigen::Affine3f& parentTrans) override;
|
2013-07-03 01:01:58 +00:00
|
|
|
|
|
|
|
private:
|
2013-07-10 11:29:43 +00:00
|
|
|
Eigen::Vector2f getContentSize();
|
2013-07-03 01:01:58 +00:00
|
|
|
|
2013-07-10 11:29:43 +00:00
|
|
|
Eigen::Vector2d mScrollPos;
|
|
|
|
Eigen::Vector2d mScrollDir;
|
2013-07-03 01:01:58 +00:00
|
|
|
int mAutoScrollDelay;
|
|
|
|
double mAutoScrollSpeed;
|
|
|
|
int mAutoScrollTimer;
|
|
|
|
};
|