//////////////////////////////////////////////////////////////////////////////
//
//  This file is part of the Atari graphical interface for GNU Chess,
//  and is Copyright 1992 by Warwick W. Allison.
//
//  You are free to copy and modify these sources, provided you acknowledge
//  the origin by retaining this notice, and adhere to the conditions
//  of the CHESS General Public License described in the main chess file
//  gnuchess.cc.
//
//////////////////////////////////////////////////////////////////////////////

#include <Sprite.h>

class GameButton
{
public:
	GameButton(Sprite* S,int i,int x,int y,int w,int h,char *commandstr,char *HelpText);
	bool Contains(int x, int y) { return x>=X && y>=Y && x<X+W && y<Y+H; }
	virtual char* const Push();
	virtual void Release();

protected:
	friend void ReleaseButton(); // Releases last pushed.
	const int X,Y,W,H;
	char* const cmdstr;
	Sprite *Pusher;
	int I;
};

extern int NumButtons;
extern int MyLevel;
extern GameButton **Button;
void InitButtons(Screen&);
bool PressButton(int x, int y, char *cmd);
