2013-07-03 01:01:58 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../GuiComponent.h"
|
|
|
|
|
|
|
|
class ScrollableContainer : public GuiComponent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ScrollableContainer(Window* window);
|
|
|
|
|
2014-05-19 01:15:15 +00:00
|
|
|
Eigen::Vector2f getScrollPos() const;
|
|
|
|
void setScrollPos(const Eigen::Vector2f& pos);
|
|
|
|
void setAutoScroll(bool autoScroll);
|
|
|
|
void reset();
|
2013-07-03 01:01:58 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
2014-05-19 01:15:15 +00:00
|
|
|
Eigen::Vector2f mScrollPos;
|
|
|
|
Eigen::Vector2f mScrollDir;
|
|
|
|
int mAutoScrollDelay; // ms to wait before starting to autoscroll
|
|
|
|
int mAutoScrollSpeed; // ms to wait before scrolling down by mScrollDir
|
|
|
|
int mAutoScrollAccumulator;
|
|
|
|
bool mAtEnd;
|
|
|
|
int mAutoScrollResetAccumulator;
|
2013-07-03 01:01:58 +00:00
|
|
|
};
|