#ifndef _VGUI_SLIDER_H
#define _VGUI_SLIDER_H

/* slider.h */
#include "gui.h"

namespace VGUI
{
	class Slider : public Widget
	{
	public:
		//Slider() { }
		Slider( Widget* w );
		~Slider();
		void Draw();
		void Draw( float opacity );
		void Save();
		bool MouseOver( float x, float y );
		string MousePress( float x, float y );
		string MouseRelease( float x, float y );
		void ResetValue();

		float GetValue() const { return value; }
		float GetAdjustedValue() const;
		float GetMinValue() const { return min_val; }
		float GetMaxValue() const { return max_val; }
		float GetDefaultValue() const { return default_value; }
		void SetValue( float new_value ) { value = new_value; }
		void SetAdjustedValue( float new_adj_val ) { value = ( new_adj_val - min_val ) / ( max_val - min_val ); }
		void SetMinValue( float new_min_val ) { min_val = new_min_val; }
		void SetMaxValue( float new_max_val ) { max_val = new_max_val; }
		void SetDefaultValue( float new_value ) { default_value = new_value; }
		void SetSetting( string new_setting ) { setting = new_setting; }
		bool GetPercent() const { return is_percent; }
		void SetPercent( bool new_percent ) { is_percent = new_percent; }
		void IncValuePress();
		void DecValuePress();
		void IncValueRelease();
		void DecValueRelease();
		void Release() { }

	private:
		TEXTURE_HANDLE slider, cursor;
		float value, default_value, min_val, max_val;
		string setting;
		float wedge_tex_width, wedge_width, wedge_height, cursor_width, cursor_height, cursor_offset;
		bool is_percent;
	};
}


#endif // _VGUI_SLIDER_H
