home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / C / OMEGA2 / OMBUTTON.HPP < prev    next >
C/C++ Source or Header  |  1992-04-25  |  2KB  |  79 lines

  1. //
  2. // *************************************************************************
  3. // *                                                                       *
  4. // *    OMEGA C++ Windowing Class Library                                  *
  5. // *    =================================                                  *
  6. // *                                                                       *
  7. // *    Copyright 1991,92 Tom Clancy                                       *
  8. // *    Submitted to the public domain, April 1992                         *
  9. // *                                                                       *
  10. // *************************************************************************
  11. // *                                                                       *
  12. // *    Push Button Object                                                 *
  13. // *                                                                       *
  14. // *************************************************************************
  15. //
  16.  
  17.  
  18. #ifndef _OMBUTTON
  19. #define _OMBUTTON
  20. #endif
  21.  
  22. #ifndef _OMWINDOW
  23. #include "omwin.hpp"
  24. #endif
  25.  
  26.  
  27. class oButton : virtual public oWindow{
  28.  
  29.   int Nb;
  30.   int Current;
  31.   int Picked;
  32.   int Pushed;
  33.   int bShaddir;
  34.   int Pressed;
  35.  
  36.   struct butts {
  37.     char *message;
  38.     int  x,y;
  39.     int  Nfg,Nbk;
  40.     int  Hfg,Hbk;
  41.     int  HotFg;
  42.   };
  43.  
  44.   struct butts *Button[255];
  45.   int hotlist[255];
  46.  
  47. public:
  48.  
  49.   oButton();
  50.  ~oButton();
  51.  
  52.   void addbutton(char *mess, int x, int y, int Nfg, int Nbk, int Hfg, int Hbk, int HotFg);
  53.   void display_buttons();
  54.   int  numbuttons() {return Nb;}
  55.   void writebutton(int i);
  56.   void writebuttonshadow(int b);
  57.   int  withinbutton(int i);
  58.   int  onwhichbutton();
  59.   void highlight();
  60.   void unhighlight();
  61.   int  pushbutton();
  62.   void hidebutton(int b);
  63.   int  getpushed() {return Picked;}
  64.   void setpushed(int p) {Picked=p;}
  65.   void gonextbutton();
  66.   void goprevbutton();
  67.   void setcurrent(int c);
  68.   void normwriteoption(int c);
  69.   void highwriteoption(int c);
  70.   void addtohotlist(int i);
  71.   void display_info();
  72.   void pressbutton(int b);
  73.   void unpressbutton(int b);
  74.   int  handle_key_event();
  75.   int  handle_mouse_event();
  76.  
  77.   void run();
  78. };
  79.