00001 #ifndef _VGUI_SLIDER_H
00002 #define _VGUI_SLIDER_H
00003
00004
00005 #include "gui.h"
00006
00007 namespace VGUI
00008 {
00009 class Slider : public Widget
00010 {
00011 public:
00012 Slider() { }
00013 Slider( Widget* w );
00014 ~Slider();
00015 void Draw();
00016 void Draw( float opacity );
00017 void Save();
00018 bool MouseOver( float x, float y );
00019 string MousePress( float x, float y );
00020 string MouseRelease( float x, float y );
00021 void ResetValue();
00022
00023 float GetValue() { return value; }
00024 float GetDefaultValue() { return default_value; }
00025 void SetValue( float new_value ) { value = new_value; }
00026 void SetDefaultValue( float new_value ) { default_value = new_value; }
00027 void SetSetting( string new_setting ) { setting = new_setting; }
00028 void IncValuePress();
00029 void DecValuePress();
00030 void IncValueRelease();
00031 void DecValueRelease();
00032 void Release() { }
00033
00034 private:
00035 TEXTURE_HANDLE slider, cursor;
00036 float value, default_value;
00037 string setting;
00038 float wedge_tex_width, wedge_width, wedge_height, cursor_width, cursor_height, cursor_offset;
00039 };
00040 }
00041
00042
00043 #endif // _VGUI_SLIDER_H