]> Shamusworld >> Repos - apple2/blob - src/gui/draggablewindow.h
41e89667dc4b33f8e16b5d54eba3389de4d86b5b
[apple2] / src / gui / draggablewindow.h
1 //
2 // DRAGGABLEWINDOW.H
3 //
4 // Graphical User Interface window class
5 //
6
7 #ifndef __DRAGGABLEWINDOW_H__
8 #define __DRAGGABLEWINDOW_H__
9
10 #include "element.h"
11 #include <vector>
12
13 class Button;                                                                   // Forward declaration
14
15 class DraggableWindow: public Element
16 {
17         public:
18                 DraggableWindow(uint32 x = 0, uint32 y = 0, uint32 w = 0, uint32 h = 0,
19                         void (* f)(Element *) = NULL);
20                 ~DraggableWindow(); //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                 bool clicked;
33                 SDL_Rect offset;
34
35         private:
36                 uint16 cbWidth, cbHeight;
37                 SDL_Surface * cbUp, * cbDown, * cbHover;
38                 SDL_Surface * img;
39 };
40
41 #endif  // __DRAGGABLEWINDOW_H__