robmcmullen-apple2/src/gui/window.h

42 lines
975 B
C
Raw Normal View History

2007-05-29 02:37:11 +00:00
//
// WINDOW.H
//
// Graphical User Interface window class
//
#ifndef __WINDOW_H__
#define __WINDOW_H__
#include "element.h"
#include <vector>
class Button; // Forward declaration
class Window: public Element
{
public:
Window(uint32_t x = 0, uint32_t y = 0, uint32_t w = 0, uint32_t h = 0,
2007-05-29 02:37:11 +00:00
void (* f)(Element *) = NULL);
~Window(); //Does this destructor need to be virtual? Not sure... Check!
virtual void HandleKey(SDL_Scancode key);
virtual void HandleMouseMove(uint32_t x, uint32_t y);
virtual void HandleMouseButton(uint32_t x, uint32_t y, bool mouseDown);
2007-05-29 02:37:11 +00:00
virtual void Draw(void);
virtual void Notify(Element *);
void AddElement(Element * e);
2009-01-30 18:20:05 +00:00
void AddCloseButton(void);
2009-02-03 05:30:08 +00:00
void SetBackgroundDraw(bool);
2007-05-29 02:37:11 +00:00
protected:
void (* handler)(Element *);
Button * closeButton;
std::vector<Element *> list;
private:
uint16_t cbWidth, cbHeight;
2007-05-29 02:37:11 +00:00
SDL_Surface * cbUp, * cbDown, * cbHover;
2009-02-03 05:30:08 +00:00
bool drawBackground;
2007-05-29 02:37:11 +00:00
};
#endif // __WINDOW_H__