X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fmenu.h;fp=src%2Fgui%2Fmenu.h;h=0000000000000000000000000000000000000000;hb=94e1e961b57f253b760298ab0bae96a7de6d20fa;hp=9847418d13c2952102f51934ee15d495502a8598;hpb=f95620384355f3db89f779e1e7be59260ecfc6ff;p=virtualjaguar diff --git a/src/gui/menu.h b/src/gui/menu.h deleted file mode 100644 index 9847418..0000000 --- a/src/gui/menu.h +++ /dev/null @@ -1,68 +0,0 @@ -// -// Menu class & supporting structs/classes -// -// by James L. Hammons -// - -#ifndef __MENU_H__ -#define __MENU_H__ - -#include -#include -#include "element.h" -#include "guimisc.h" // Ick. - -class Window; - -struct NameAction -{ - std::string name; - Window * (* action)(void); - SDLKey hotKey; - - NameAction(std::string n, Window * (* a)(void) = NULL, SDLKey k = SDLK_UNKNOWN): - name(n), action(a), hotKey(k) {} -}; - -class MenuItems -{ - public: - MenuItems(): charLength(0) {} - // Normally, we avoid implementation in a header file but in this case - // we can make an exception. ;-) - bool Inside(uint32 x, uint32 y) - { return (x >= (uint32)extents.x && x < (uint32)(extents.x + extents.w) - && y >= (uint32)extents.y && y < (uint32)(extents.y + extents.h) ? true : false); } - - std::string title; - std::vector item; - uint32 charLength; - SDL_Rect extents; -}; - -class Menu: public Element -{ - public: -// 1CFF -> 0 001 11 00 111 1 1111 -// 421F -> 0 100 00 10 000 1 1111 - Menu(uint32 x = 0, uint32 y = 0, uint32 w = 0, uint32 h = FONT_HEIGHT, - uint32 fgc = 0xFF7F0000, uint32 bgc = 0xFFFF3F3F, uint32 fgch = 0xFFFF3F3F, - uint32 bgch = 0xFFFF8787); - virtual void HandleKey(SDLKey key); - virtual void HandleMouseMove(uint32 x, uint32 y); - virtual void HandleMouseButton(uint32 x, uint32 y, bool mouseDown); - virtual void Draw(uint32 offsetX = 0, uint32 offsetY = 0); - virtual void Notify(Element *) {} - void Add(MenuItems mi); - - protected: - bool activated, clicked; - uint32 inside, insidePopup; - uint32 fgColor, bgColor, fgColorHL, bgColorHL; - int menuChosen, menuItemChosen; - - private: - std::vector itemList; -}; - -#endif // __MENU_H__