- fixed a warning
[supertux.git] / src / button.h
index 0ef2231..af2d51b 100644 (file)
@@ -28,7 +28,10 @@ enum ButtonState {
   BUTTON_NONE = -1,
   BUTTON_CLICKED,
   BUTTON_PRESSED,
-  BUTTON_HOVER
+  BUTTON_HOVER,
+  BUTTON_WHEELUP,
+  BUTTON_WHEELDOWN,
+  BUTTON_DEACTIVE
 };
 
 class ButtonPanel;
@@ -43,6 +46,7 @@ public:
   void event(SDL_Event& event);
   void draw();
   int get_state();
+  void set_active(bool active) { active ? state = BUTTON_NONE : state = BUTTON_DEACTIVE; };
   void add_icon(std::string icon_file, int mw, int mh);
   SDL_Rect get_pos() { return rect; }
   int get_tag(){return tag; }
@@ -73,6 +77,8 @@ public:
   void set_button_size(int w, int h);
   Button* manipulate_button(int i);
   void highlight_last(bool b);
+  void set_last_clicked(unsigned int last)
+  { if(hlast) { if(item.size() >= last) { last_clicked = item.begin() + last; } } };
 
 private:
   int bw, bh;