#pragma once
#include "HF.H"

class Scrollbar
{
	public:
		Scrollbar(int PosX, int PosY, int Height, rect* displayArea, int textHeight, int gutterWidth);
		~Scrollbar();
		bool MouseDown();
		rect* GetSBArea();
		int Mouse(bool LMButtonDown, int x, int y);//returns the new scroll amount
		void ReCalc(int textHeight);//also resets ThumbPos
		bool IsEnabled();
		void Draw();
	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, ThumbPos, GutterWidth, ScrollAmount, LastMouseY;
		rect *DisplayArea, *ScrollBarArea, *TopButtonArea, *BottomButtonArea, *ThumbArea, *GutterArea;
		DWORD UpPic, DownPic;
		int ScrollAmountFromThumb();
		int ThumbFromScrollAmount();
};