4 // Graphical User Interface menu support
17 Element * (* action)(void);
20 NameAction(std::string n, Element * (* a)(void) = NULL, SDLKey k = SDLK_UNKNOWN): name(n),
21 action(a), hotKey(k) {}
28 bool Inside(uint32 x, uint32 y);
31 std::vector<NameAction> item;
34 SDL_Surface * popupBackstore;
37 class Menu: public Element
40 Menu(uint32 x = 0, uint32 y = 0, uint32 w = 0, uint32 h = 0,
41 uint8 fgcR = 0x00, uint8 fgcG = 0x00, uint8 fgcB = 0x7F, uint8 fgcA = 0xFF,
42 uint8 bgcR = 0x3F, uint8 bgcG = 0x3F, uint8 bgcB = 0xFF, uint8 bgcA = 0xFF,
43 uint8 fgchR = 0x3F, uint8 fgchG = 0x3F, uint8 fgchB = 0xFF, uint8 fgchA = 0xFF,
44 uint8 bgchR = 0x87, uint8 bgchG = 0x87, uint8 bgchB = 0xFF, uint8 bgchA = 0xFF);
46 virtual void HandleKey(SDLKey key);
47 virtual void HandleMouseMove(uint32 x, uint32 y);
48 virtual void HandleMouseButton(uint32 x, uint32 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 inside, insidePopup;
58 int menuChosen, menuItemChosen;
59 uint32 fgColorHL, bgColorHL;
62 std::vector<MenuItems> itemList;
63 bool activatedSave, clickedSave;
64 uint32 insideSave, insidePopupSave;
65 int menuChosenSave, menuItemChosenSave;