X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=lib%2Fgui%2Fmenu.h;h=c9ef6ee7b218fc61e53bd3c9ff98f5a01ee55605;hb=db7e44a2f93bd7c0e7477690e7cc30b6d5273b06;hp=31ad4f9d5416bf6d0e50d16571dc0c376719b438;hpb=b2d8d1eac9fd6328d3a8c61cf09d4b2882145042;p=supertux.git diff --git a/lib/gui/menu.h b/lib/gui/menu.h index 31ad4f9d5..c9ef6ee7b 100644 --- a/lib/gui/menu.h +++ b/lib/gui/menu.h @@ -21,15 +21,16 @@ #define SUPERTUX_MENU_H #include +#include +#include +#include #include "SDL.h" -#include "../video/surface.h" -#include "../video/font.h" -#include "../special/timer.h" -#include "../special/base.h" -#include "../special/stringlist.h" -#include "../gui/mousecursor.h" +#include "video/surface.h" +#include "video/font.h" +#include "special/timer.h" +#include "mousecursor.h" namespace SuperTux { @@ -62,19 +63,26 @@ namespace SuperTux class MenuItem { public: + MenuItem() {}; + MenuItem(MenuItemKind kind, int id = -1); + MenuItem(MenuItemKind kind, int id, const std::string& text); MenuItemKind kind; + int id; // item id int toggled; - char *text; - char *input; + std::string text; + std::string input; int *int_p; // used for setting keys (can be used for more stuff...) - int id; // item id - string_list_type* list; + + std::vector list; // list of values for a STRINGSELECT item + size_t selected; // currently selected item + Menu* target_menu; - void change_text (const char *text); - void change_input(const char *text); + void change_text (const std::string& text); + void change_input(const std::string& text); - static MenuItem* create(MenuItemKind kind, const char *text, int init_toggle, Menu* target_menu, int id, int* int_p); + static MenuItem* create(MenuItemKind kind, const std::string& text, + int init_toggle, Menu* target_menu, int id, int* int_p); std::string get_input_with_symbol(bool active_item); // returns the text with an input symbol private: @@ -146,6 +154,7 @@ namespace SuperTux Menu(); ~Menu(); + void additem(const MenuItem& menu_item); void additem(MenuItem* pmenu_item); void additem(MenuItemKind kind, const std::string& text, int init_toggle, Menu* target_menu, int id = -1, int *int_p = NULL);