/*---------------------------------------------------------------------------* Copyright (C) 2010-2012 Nintendo. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. *---------------------------------------------------------------------------*/ #ifndef __DEMOWIN_SCROLL_BAR_H_ #define __DEMOWIN_SCROLL_BAR_H_ struct ScrollBar : public MenuItem { ScrollBar(Window* window, CVec3 position, CVec2 size, float _count = 0, float _max = 10) : MenuItem(window, position, size), pos(0), subHeight(size.y / 10), count(_count), max(_max), pPos(&pos) {} ScrollBar(Window* window, CVec3 position, CVec2 size, float* _pPos, float _count, float _max) : MenuItem(window, position, size), subHeight(size.y / 10), count(_count), max(_max), pPos(_pPos) {} ScrollBar(const ScrollBar& copy) : MenuItem(copy), pos(copy.pos), subHeight(copy.subHeight), count(copy.count), max(copy.max), pPos(copy.pPos) {if (copy.pPos == ©.pos) {pPos = &pos;};} static ScrollBar* Add(const ScrollBar& item); bool Update(); void Draw(); void Reset(); float pos; float oldY; float subHeight; float oldPos; bool wasMax; float count; float max; float* pPos; }; const float SCROLLBAR_WIDTH = 0.05; #endif