1 /*
2 	GWEN
3 	Copyright (c) 2010 Facepunch Studios
4 	See license in Gwen.h
5 */
6 
7 #pragma once
8 #ifndef GWEN_CONTROLS_VERTICALSCROLLBAR_H
9 #define GWEN_CONTROLS_VERTICALSCROLLBAR_H
10 #include "Gwen/Controls/Base.h"
11 #include "Gwen/Controls/ScrollBar.h"
12 #include "Gwen/Gwen.h"
13 #include "Gwen/Skin.h"
14 
15 namespace Gwen
16 {
17 namespace Controls
18 {
19 class GWEN_EXPORT VerticalScrollBar : public BaseScrollBar
20 {
21 	GWEN_CONTROL(VerticalScrollBar, BaseScrollBar);
22 
23 	virtual void Layout(Skin::Base* skin);
24 
25 	virtual void OnMouseClickLeft(int x, int y, bool bDown);
26 	virtual void OnBarMoved(Controls::Base* control);
27 
GetBarSize()28 	virtual int GetBarSize() { return m_Bar->Height(); }
GetBarPos()29 	virtual int GetBarPos() { return m_Bar->Y() - Width(); }
SetBarSize(int size)30 	virtual void SetBarSize(int size) { m_Bar->SetHeight(size); }
GetButtonSize()31 	virtual int GetButtonSize() { return Width(); }
32 
33 	virtual void ScrollToTop();
34 	virtual void ScrollToBottom();
35 	virtual void NudgeUp(Base* control);
36 	virtual void NudgeDown(Base* control);
37 	virtual float GetNudgeAmount();
38 
39 	virtual float CalculateScrolledAmount();
40 	virtual bool SetScrolledAmount(float amount, bool forceUpdate);
41 };
42 }  // namespace Controls
43 }  // namespace Gwen
44 #endif
45