X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fwindow.h;fp=src%2Fgui%2Fwindow.h;h=2686ff7b1b156890fe1aef6873db89183b863af8;hb=f9098d0570ae6462781e8189518085cb1c8c00ef;hp=0000000000000000000000000000000000000000;hpb=836c7fa1f3e2dc3ec9849cac2584d4544bf2fba4;p=virtualjaguar diff --git a/src/gui/window.h b/src/gui/window.h new file mode 100644 index 0000000..2686ff7 --- /dev/null +++ b/src/gui/window.h @@ -0,0 +1,35 @@ +// +// Window class +// +// by James L. Hammons + +#ifndef __WINDOW_H__ +#define __WINDOW_H__ + +#include +#include "button.h" +#include "element.h" + +class Window: public Element +{ + public: + Window(uint32 x = 0, uint32 y = 0, uint32 w = 0, uint32 h = 0, + void (* f)(Element *) = NULL); + virtual ~Window(); + 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 * e); + void AddElement(Element * e); + + protected: + uint32 fgColor, bgColor; + void (* handler)(Element *); + Button * close; + // We have to use a list of Element *pointers* because we can't make a + // list that will hold all the different object types in the same list... + std::vector list; +}; + +#endif // __WINDOW_H__