00001 #ifndef _VGUI_CALIBRATE_H
00002 #define _VGUI_CALIBRATE_H
00003
00004
00005 #include "controls.h"
00006 #include "gui/gui.h"
00007
00008 namespace VGUI
00009 {
00010 class CalSet
00011 {
00012 private:
00013 float upper_value, lower_value, cur_value;
00014
00015 public:
00016 CalSet() { upper_value = lower_value = 0.0f; }
00017 CalSet( float upper, float lower ) : upper_value( upper ), lower_value( lower ) { }
00018 ~CalSet() { }
00019 float GetUpperValue() { return upper_value; }
00020 void SetUpperValue( float new_upper_value ) { upper_value = new_upper_value; }
00021 float GetLowerValue() { return lower_value; }
00022 void SetLowerValue( float new_lower_value ) { lower_value = new_lower_value; }
00023 float GetCurrentValue() { return cur_value; }
00024 void SetCurrentValue( float new_cur_value ) { cur_value = new_cur_value; }
00025 };
00026
00027 class Calibrate : public Widget
00028 {
00029 private:
00030 map< int, map<int, CalSet*> > calibrations;
00031 TEXTURE_HANDLE axis_field_tex, joy_cursor_tex, joy_cal_box_tex;
00032 float field_width, field_height, cursor_width, cursor_height;
00033 int cur_joy_idx;
00034
00035 public:
00036 Calibrate();
00037 Calibrate( Widget *w );
00038 ~Calibrate();
00039
00040 void Draw();
00041 void Draw( float opacity );
00042 void Save();
00043 void ResetValue();
00044 void GrabJoyMove( Uint8 joy_idx, Uint8 joy_axis, bool joy_positive, float joy_value );
00045 void HookIncValuePress() { }
00046 void HookDecValuePress() { }
00047 void HookIncValueRelease();
00048 void HookDecValueRelease();
00049 };
00050 }
00051
00052 #endif // _VGUI_CALIBRATE_H