]> Shamusworld >> Repos - apple2/blob - apple2/src/gui/window.h
Creating trunk (should've done this from the start)...
[apple2] / apple2 / src / gui / window.h
1 //
2 // WINDOW.H
3 //
4 // Graphical User Interface window class
5 //
6
7 #ifndef __WINDOW_H__
8 #define __WINDOW_H__
9
10 #include "element.h"
11 #include <vector>
12
13 class Button;                                                                   // Forward declaration
14
15 class Window: public Element
16 {
17         public:
18                 Window(uint32 x = 0, uint32 y = 0, uint32 w = 0, uint32 h = 0,
19                         void (* f)(Element *) = NULL);
20                 ~Window(); //Does this destructor need to be virtual? Not sure... Check!
21                 virtual void HandleKey(SDLKey key);
22                 virtual void HandleMouseMove(uint32 x, uint32 y);
23                 virtual void HandleMouseButton(uint32 x, uint32 y, bool mouseDown);
24                 virtual void Draw(void);
25                 virtual void Notify(Element *);
26                 void AddElement(Element * e);
27
28         protected:
29                 void (* handler)(Element *);
30                 Button * closeButton;
31                 std::vector<Element *> list;
32
33         private:
34                 uint16 cbWidth, cbHeight;
35                 SDL_Surface * cbUp, * cbDown, * cbHover;
36 };
37
38 #endif  // __WINDOW_H__