4 // Graphical User Interface menu support
17 Element * (* action)(void);
20 NameAction(std::string n, Element * (* a)(void) = NULL, SDL_Scancode k = SDL_SCANCODE_UNKNOWN): name(n),
21 action(a), hotKey(k) {}
28 bool Inside(uint32_t x, uint32_t y);
31 std::vector<NameAction> item;
34 SDL_Surface * popupBackstore;
37 class Menu: public Element
40 Menu(uint32_t x = 0, uint32_t y = 0, uint32_t w = 0, uint32_t h = 0,
41 uint8_t fgcR = 0x00, uint8_t fgcG = 0x00, uint8_t fgcB = 0x7F, uint8_t fgcA = 0xFF,
42 uint8_t bgcR = 0x3F, uint8_t bgcG = 0x3F, uint8_t bgcB = 0xFF, uint8_t bgcA = 0xFF,
43 uint8_t fgchR = 0x3F, uint8_t fgchG = 0x3F, uint8_t fgchB = 0xFF, uint8_t fgchA = 0xFF,
44 uint8_t bgchR = 0x87, uint8_t bgchG = 0x87, uint8_t bgchB = 0xFF, uint8_t bgchA = 0xFF);
46 virtual void HandleKey(SDL_Scancode key);
47 virtual void HandleMouseMove(uint32_t x, uint32_t y);
48 virtual void HandleMouseButton(uint32_t x, uint32_t y, bool mouseDown);
49 virtual void Draw(void);
50 virtual void Notify(Element *);
51 void Add(MenuItems mi);
52 void SaveStateVariables(void);
53 void CheckStateAndRedrawIfNeeded(void);
56 bool activated, clicked;
57 uint32_t inside, insidePopup;
58 int menuChosen, menuItemChosen;
59 uint32_t fgColorHL, bgColorHL;
62 std::vector<MenuItems> itemList;
63 bool activatedSave, clickedSave;
64 uint32_t insideSave, insidePopupSave;
65 int menuChosenSave, menuItemChosenSave;