#pragma once

class Scrollbar
{
	public:
		Scrollbar(int Right, int Top, int Height, int textHeight, DWORD upPic=0, DWORD downPic=0, DWORD thumbPic=0, DWORD gutterPic=0);
		~Scrollbar();
		bool MouseDown();	//is the thumb in the "mousedown" state?
		rect* GetSBArea();
		int Mouse(bool LMButtonDown, int x, int y);//returns the new scroll amount
		void ReCalc(int textHeight);//also resets ThumbArea
		bool IsEnabled();
		void Draw();
		int GetWidth();
	private:
		Scrollbar(); //call me not
		Scrollbar(Scrollbar&);//don't call this
		Scrollbar& operator= (Scrollbar const &); //don't call the assignment operator

		bool ThumbLock;
		bool Enabled;
		int TextHeight, ThumbHeight, GutterWidth, ScrollAmount, LastMouseY, Width, Height, CenterX;
		rect *ScrollBarArea, *TopButtonArea, *BottomButtonArea, *ThumbArea, *GutterArea;
		DWORD UpPic, DownPic, ThumbPic, GutterPic;
		int ScrollAmountFromThumb();
		int ThumbFromScrollAmount();
};