home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / gnu / gchsrc31 / buttons.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-27  |  1.1 KB  |  36 lines

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. //  This file is part of the Atari graphical interface for GNU Chess,
  4. //  and is Copyright 1992 by Warwick W. Allison.
  5. //
  6. //  You are free to copy and modify these sources, provided you acknowledge
  7. //  the origin by retaining this notice, and adhere to the conditions
  8. //  of the CHESS General Public License described in the main chess file
  9. //  gnuchess.cc.
  10. //
  11. //////////////////////////////////////////////////////////////////////////////
  12.  
  13. #include <Sprite.h>
  14.  
  15. class GameButton
  16. {
  17. public:
  18.     GameButton(Sprite* S,int i,int x,int y,int w,int h,char *commandstr,char *HelpText);
  19.     bool Contains(int x, int y) { return x>=X && y>=Y && x<X+W && y<Y+H; }
  20.     virtual char* const Push();
  21.     virtual void Release();
  22.  
  23. protected:
  24.     friend void ReleaseButton(); // Releases last pushed.
  25.     const int X,Y,W,H;
  26.     char* const cmdstr;
  27.     Sprite *Pusher;
  28.     int I;
  29. };
  30.  
  31. extern int NumButtons;
  32. extern int MyLevel;
  33. extern GameButton **Button;
  34. void InitButtons(Screen&);
  35. bool PressButton(int x, int y, char *cmd);
  36.