2015-11-29 02:55:30 +00:00
|
|
|
#ifndef SPECTER_SCROLLVIEW_HPP
|
|
|
|
#define SPECTER_SCROLLVIEW_HPP
|
|
|
|
|
|
|
|
#include "View.hpp"
|
|
|
|
|
|
|
|
namespace Specter
|
|
|
|
{
|
2015-12-02 01:32:15 +00:00
|
|
|
class ViewResources;
|
2015-11-29 02:55:30 +00:00
|
|
|
|
|
|
|
class ScrollView : public View
|
|
|
|
{
|
|
|
|
public:
|
2015-12-15 21:53:15 +00:00
|
|
|
enum class Style
|
|
|
|
{
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
|
|
|
View* m_contentView = nullptr;
|
2015-12-29 02:02:43 +00:00
|
|
|
int m_scroll[2] = {};
|
2015-12-29 22:58:09 +00:00
|
|
|
int m_targetScroll[2] = {};
|
2015-12-15 21:53:15 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
ScrollView(ViewResources& res, View& parentView);
|
2015-12-23 00:25:46 +00:00
|
|
|
void setContentView(View* v)
|
|
|
|
{
|
|
|
|
m_contentView = v;
|
|
|
|
updateSize();
|
|
|
|
}
|
2015-12-29 02:02:43 +00:00
|
|
|
|
|
|
|
void scroll(const boo::SWindowCoord& coord, const boo::SScrollDelta& scroll);
|
2015-12-29 22:58:09 +00:00
|
|
|
int getScrollX() const {return m_scroll[0];}
|
|
|
|
int getScrollY() const {return m_scroll[1];}
|
2015-12-29 02:02:43 +00:00
|
|
|
|
2015-12-29 22:58:09 +00:00
|
|
|
int nominalWidth() const {return subRect().size[0];}
|
|
|
|
int nominalHeight() const {return subRect().size[1];}
|
|
|
|
|
|
|
|
void think();
|
2015-12-29 02:02:43 +00:00
|
|
|
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub);
|
|
|
|
void draw(boo::IGraphicsCommandQueue* gfxQ);
|
2015-11-29 02:55:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // SPECTER_SCROLLVIEW_HPP
|