#ifndef CTButton_h
#define CTButton_h
#include "SDL.h"
#include "CSDL.h"
#include "CTools.h"
#include "CTLabel.h"
#include "CFont.h"
#include "CTPicture.h"
#include <iostream>
using namespace std;
class CTButton : public CTools
{
public:
CTButton(int _x, int _y, char *_pText, CFont *_pCFont, CTPicture *_pButtonPicture, CSDL *_pCSDL );
void Draw();
void OnMouseLeft(int _x, int _y);
void OnMouseOn(int _x, int _y);
void OnMouseNotOn(int _x, int _y);
bool GetButtonState();
private:
CTLabel Label;
bool bButtonstate;
bool bMouseOn;
enum{
MOUSENOTON,MOUSEON};
CTPicture *pButtonPicture;
};
#endif
#ifndef CTools_h
#define CTools_h
#include "CSDL.h"
class CTools
{
public:
CTools(){}
CTools(int _x, int _y, CSDL *_pCSDL);
virtual ~CTools(){};
virtual void Draw()=0;
void SetXY(int _x, int _y);
int GetX();
int GetY();
int GetW();
int GetH();
void SetSDL(CSDL *_pCSDL);
virtual void OnMouseLeft(int _x, int _y){}
virtual void OnMouseOn(int _x, int _y){}
virtual void OnMouseNotOn(int _x, int _y) {}
protected:
void SetWH(int _w, int _h);
int x,y,w,h;
CSDL *pCSDL;
};
#endif