#pragma once
#include "skinnablewindow.h"
#include "moveablebutton.h"

class VerticalScrollBar :
	public SkinnableButton
{
public:
	VerticalScrollBar(void);
	~VerticalScrollBar(void);

	virtual int Create(HWND parent = 0);
	virtual void OnButtonMove(HWND h);
	virtual void OnButton(HWND h);
	virtual void OnSize(int cx, int cy);
	virtual void Show();
	virtual void OnKeyDown(WPARAM wParam, LPARAM lParam);
	void PageUp();
	void PageDown();
	void LineUp();
	void LineDown();
	void SetPos(float x);
	float GetPos();
	void SetPage(float x); // sets page length as a percentage of scrollable length
	void SetLine(float x);

	virtual void Load(const char * base);

	SkinnableButton scrollarea;
	MoveableButton cursor;
	SkinnableButton linedown;
	SkinnableButton lineup;

private:
	float pos; // scrollbar position 0-->1
	float page; // the size of a page
	float line; // the size of a line

};
