metaforce/specter/include/Specter/ScrollView.hpp

46 lines
944 B
C++
Raw Normal View History

2015-11-29 02:55:30 +00:00
#ifndef SPECTER_SCROLLVIEW_HPP
#define SPECTER_SCROLLVIEW_HPP
#include "View.hpp"
namespace Specter
{
class ViewResources;
2015-11-29 02:55:30 +00:00
class ScrollView : public View
{
public:
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] = {};
public:
ScrollView(ViewResources& res, View& parentView);
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