X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fgui%2Fmenu.hpp;h=302750684fb05522f4092072273f8595e450bc75;hb=f7be36d821fb67ece9bdc1a4003016e9e4431e63;hp=5c97fa1fbb18710451eb5ff1de2871c3723e7024;hpb=e70165f7a2caf2f7234c3635b8e7d2c452c3c787;p=supertux.git diff --git a/src/gui/menu.hpp b/src/gui/menu.hpp index 5c97fa1fb..302750684 100644 --- a/src/gui/menu.hpp +++ b/src/gui/menu.hpp @@ -21,6 +21,7 @@ #include #include +#include "math/vector.hpp" #include "video/color.hpp" #include "video/surface_ptr.hpp" @@ -36,6 +37,7 @@ class Menu static Color inactive_color; static Color label_color; static Color field_color; + private: /* Action done on the menu */ enum MenuAction { @@ -72,10 +74,6 @@ public: /** Remove all entries from the menu */ void clear(); - /** Return the index of the menu item that was 'hit' (ie. the user - clicked on it) in the last event() call */ - int check (); - virtual void check_menu() =0; MenuItem& get_item(int index) @@ -97,10 +95,12 @@ public: bool is_toggled(int id) const; void set_toggled(int id, bool toggled); - Menu* get_parent() const; - protected: - void additem(MenuItem* pmenu_item); + /** Return the index of the menu item that was 'hit' (ie. the user + clicked on it) in the last event() call */ + int check (); + + MenuItem* add_item(std::unique_ptr menu_item); float get_width() const; float get_height() const; @@ -114,8 +114,7 @@ private: int hit_item; // position of the menu (ie. center of the menu, not top/left) - float pos_x; - float pos_y; + Vector pos; /** input event for the menu (up, down, left, right, etc.) */ MenuAction menuaction; @@ -128,7 +127,7 @@ private: public: bool close; - std::vector items; + std::vector > items; public: float effect_progress; @@ -137,12 +136,6 @@ public: private: int arrange_left; int active_item; - - SurfacePtr checkbox; - SurfacePtr checkbox_checked; - SurfacePtr back; - SurfacePtr arrow_left; - SurfacePtr arrow_right; }; #endif