2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 12:27:43 +00:00

Initial TableView

This commit is contained in:
Jack Andersen
2015-12-28 16:02:43 -10:00
parent 9a5bfc107e
commit 725990da45
9 changed files with 281 additions and 45 deletions

View File

@@ -3,9 +3,35 @@
namespace Specter
{
ScrollView::ScrollView(ViewResources& system, View& parentView)
: View(system, parentView)
ScrollView::ScrollView(ViewResources& res, View& parentView)
: View(res, parentView)
{
commitResources(res);
}
void ScrollView::scroll(const boo::SWindowCoord& coord, const boo::SScrollDelta& scroll)
{
m_scroll[0] += scroll.delta[0];
m_scroll[1] += scroll.delta[1];
updateSize();
}
void ScrollView::resized(const boo::SWindowRect& root, const boo::SWindowRect& sub)
{
View::resized(root, sub);
if (m_contentView)
{
boo::SWindowRect cRect = sub;
cRect.location[0] += m_scroll[0];
cRect.location[1] += sub.size[1] - m_contentView->nominalHeight() + m_scroll[1];
m_contentView->resized(root, cRect, sub);
}
}
void ScrollView::draw(boo::IGraphicsCommandQueue* gfxQ)
{
if (m_contentView)
m_contentView->draw(gfxQ);
}
}